perf_vgg.cpp 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839
  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. #ifdef OPENCV_XFEATURES2D_HAS_VGG_DATA
  7. typedef perf::TestBaseWithParam<std::string> vgg;
  8. #define VGG_IMAGES \
  9. "cv/detectors_descriptors_evaluation/images_datasets/leuven/img1.png",\
  10. "stitching/a3.png"
  11. PERF_TEST_P(vgg, extract, testing::Values(VGG_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<KAZE> detector = KAZE::create();
  19. vector<KeyPoint> points;
  20. detector->detect(frame, points, mask);
  21. Ptr<VGG> descriptor = VGG::create();
  22. Mat_<float> descriptors;
  23. // compute keypoints descriptor
  24. TEST_CYCLE() descriptor->compute(frame, points, descriptors);
  25. SANITY_CHECK_NOTHING();
  26. }
  27. #endif // OPENCV_XFEATURES2D_HAS_VGG_DATA
  28. }} // namespace