perf_precomp.hpp 641 B

123456789101112131415161718192021222324252627282930
  1. #ifndef __OPENCV_PERF_PRECOMP_HPP__
  2. #define __OPENCV_PERF_PRECOMP_HPP__
  3. #include "opencv2/ts.hpp"
  4. #include "opencv2/stitching.hpp"
  5. #ifdef HAVE_OPENCV_XFEATURES2D
  6. #include "opencv2/xfeatures2d/nonfree.hpp"
  7. #endif
  8. namespace cv
  9. {
  10. static inline Ptr<Feature2D> getFeatureFinder(const std::string& name)
  11. {
  12. if (name == "orb")
  13. return ORB::create();
  14. #if defined(HAVE_OPENCV_XFEATURES2D) && defined(OPENCV_ENABLE_NONFREE)
  15. else if (name == "surf")
  16. return xfeatures2d::SURF::create();
  17. #endif
  18. else if (name == "akaze")
  19. return AKAZE::create();
  20. else
  21. return Ptr<Feature2D>();
  22. }
  23. } // namespace cv
  24. #endif