test_descriptors_invariance.cpp 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. // This file is part of OpenCV project.
  2. // It is subject to the license terms in the LICENSE file found in the top-level directory
  3. // of this distribution and at http://opencv.org/license.html
  4. #include "test_precomp.hpp"
  5. #include "test_invariance_utils.hpp"
  6. #include "test_descriptors_invariance.impl.hpp"
  7. namespace opencv_test { namespace {
  8. const static std::string IMAGE_TSUKUBA = "features2d/tsukuba.png";
  9. const static std::string IMAGE_BIKES = "detectors_descriptors_evaluation/images_datasets/bikes/img1.png";
  10. #define Value(...) Values(make_tuple(__VA_ARGS__))
  11. /*
  12. * Descriptors's rotation invariance check
  13. */
  14. INSTANTIATE_TEST_CASE_P(SIFT, DescriptorRotationInvariance,
  15. Value(IMAGE_TSUKUBA, SIFT::create(), SIFT::create(), 0.98f));
  16. INSTANTIATE_TEST_CASE_P(BRISK, DescriptorRotationInvariance,
  17. Value(IMAGE_TSUKUBA, BRISK::create(), BRISK::create(), 0.99f));
  18. INSTANTIATE_TEST_CASE_P(ORB, DescriptorRotationInvariance,
  19. Value(IMAGE_TSUKUBA, ORB::create(), ORB::create(), 0.99f));
  20. INSTANTIATE_TEST_CASE_P(AKAZE, DescriptorRotationInvariance,
  21. Value(IMAGE_TSUKUBA, AKAZE::create(), AKAZE::create(), 0.99f));
  22. INSTANTIATE_TEST_CASE_P(AKAZE_DESCRIPTOR_KAZE, DescriptorRotationInvariance,
  23. Value(IMAGE_TSUKUBA, AKAZE::create(AKAZE::DESCRIPTOR_KAZE), AKAZE::create(AKAZE::DESCRIPTOR_KAZE), 0.99f));
  24. /*
  25. * Descriptor's scale invariance check
  26. */
  27. INSTANTIATE_TEST_CASE_P(SIFT, DescriptorScaleInvariance,
  28. Value(IMAGE_BIKES, SIFT::create(0, 3, 0.09), SIFT::create(0, 3, 0.09), 0.78f));
  29. INSTANTIATE_TEST_CASE_P(AKAZE, DescriptorScaleInvariance,
  30. Value(IMAGE_BIKES, AKAZE::create(), AKAZE::create(), 0.6f));
  31. INSTANTIATE_TEST_CASE_P(AKAZE_DESCRIPTOR_KAZE, DescriptorScaleInvariance,
  32. Value(IMAGE_BIKES, AKAZE::create(AKAZE::DESCRIPTOR_KAZE), AKAZE::create(AKAZE::DESCRIPTOR_KAZE), 0.55f));
  33. }} // namespace