perf_latch.cpp 1.0 KB

123456789101112131415161718192021222324252627282930313233343536
  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 "perf_precomp.hpp"
  5. namespace opencv_test { namespace {
  6. typedef perf::TestBaseWithParam<std::string> latch;
  7. #define LATCH_IMAGES \
  8. "cv/detectors_descriptors_evaluation/images_datasets/leuven/img1.png",\
  9. "stitching/a3.png"
  10. #ifdef OPENCV_ENABLE_NONFREE
  11. PERF_TEST_P(latch, extract, testing::Values(LATCH_IMAGES))
  12. {
  13. string filename = getDataPath(GetParam());
  14. Mat frame = imread(filename, IMREAD_GRAYSCALE);
  15. ASSERT_FALSE(frame.empty()) << "Unable to load source image " << filename;
  16. Mat mask;
  17. declare.in(frame).time(90);
  18. Ptr<SURF> detector = SURF::create();
  19. vector<KeyPoint> points;
  20. detector->detect(frame, points, mask);
  21. Ptr<LATCH> descriptor = LATCH::create();
  22. vector<uchar> descriptors;
  23. TEST_CYCLE() descriptor->compute(frame, points, descriptors);
  24. SANITY_CHECK_NOTHING();
  25. }
  26. #endif // NONFREE
  27. }} // namespace