diff --git a/modules/xfeatures2d/CMakeLists.txt b/modules/xfeatures2d/CMakeLists.txt index 6e66e28fb..63b4240e5 100644 --- a/modules/xfeatures2d/CMakeLists.txt +++ b/modules/xfeatures2d/CMakeLists.txt @@ -1,2 +1,2 @@ set(the_description "Contributed/Experimental Algorithms for Salient 2D Features Detection") -ocv_define_module(xfeatures2d opencv_core opencv_imgproc opencv_features2d opencv_calib3d opencv_shape opencv_highgui opencv_videoio opencv_ml) +ocv_define_module(xfeatures2d opencv_core opencv_cudaarithm opencv_imgproc opencv_features2d opencv_calib3d opencv_shape opencv_highgui opencv_videoio opencv_ml) diff --git a/modules/xfeatures2d/perf/perf_surf.cuda.cpp b/modules/xfeatures2d/perf/perf_surf.cuda.cpp index 4cdbea978..979028a6d 100644 --- a/modules/xfeatures2d/perf/perf_surf.cuda.cpp +++ b/modules/xfeatures2d/perf/perf_surf.cuda.cpp @@ -86,8 +86,7 @@ PERF_TEST_P(Image, CUDA_SURF, } else { - cv::SURF surf; - + cv::xfeatures2d::SURF surf; std::vector cpu_keypoints; cv::Mat cpu_descriptors; diff --git a/modules/xfeatures2d/src/precomp.hpp b/modules/xfeatures2d/src/precomp.hpp index b49bc5954..ddecdbe90 100644 --- a/modules/xfeatures2d/src/precomp.hpp +++ b/modules/xfeatures2d/src/precomp.hpp @@ -43,11 +43,14 @@ #ifndef __OPENCV_PRECOMP_H__ #define __OPENCV_PRECOMP_H__ +#include "opencv2/xfeatures2d/cuda.hpp" + #include "opencv2/xfeatures2d.hpp" #include "opencv2/imgproc.hpp" #include "opencv2/core/utility.hpp" #include "opencv2/core/private.hpp" +#include "opencv2/core/private.cuda.hpp" //#include "opencv2/nonfree/cuda.hpp" //#include "opencv2/core/private.cuda.hpp" diff --git a/modules/xfeatures2d/src/surf.cuda.cpp b/modules/xfeatures2d/src/surf.cuda.cpp index 3b5cf095f..208156c98 100644 --- a/modules/xfeatures2d/src/surf.cuda.cpp +++ b/modules/xfeatures2d/src/surf.cuda.cpp @@ -42,7 +42,7 @@ #include "precomp.hpp" -#if 0 +#if 1 using namespace cv; using namespace cv::cuda; @@ -115,7 +115,7 @@ namespace class SURF_CUDA_Invoker { public: - SURF_CUDA_Invoker(SURF_CUDA& surf, const GpuMat& img, const GpuMat& mask) : + SURF_CUDA_Invoker(cv::cuda::SURF_CUDA& surf, const GpuMat& img, const GpuMat& mask) : surf_(surf), img_cols(img.cols), img_rows(img.rows), use_mask(!mask.empty()) diff --git a/modules/xfeatures2d/test/test_surf.cuda.cpp b/modules/xfeatures2d/test/test_surf.cuda.cpp index 4011f3cc3..7f17e069b 100644 --- a/modules/xfeatures2d/test/test_surf.cuda.cpp +++ b/modules/xfeatures2d/test/test_surf.cuda.cpp @@ -94,7 +94,7 @@ CUDA_TEST_P(SURF, Detector) std::vector keypoints; surf(loadMat(image), cv::cuda::GpuMat(), keypoints); - cv::SURF surf_gold; + cv::xfeatures2d::SURF surf_gold; surf_gold.hessianThreshold = hessianThreshold; surf_gold.nOctaves = nOctaves; surf_gold.nOctaveLayers = nOctaveLayers; @@ -130,7 +130,7 @@ CUDA_TEST_P(SURF, Detector_Masked) std::vector keypoints; surf(loadMat(image), loadMat(mask), keypoints); - cv::SURF surf_gold; + cv::xfeatures2d::SURF surf_gold; surf_gold.hessianThreshold = hessianThreshold; surf_gold.nOctaves = nOctaves; surf_gold.nOctaveLayers = nOctaveLayers; @@ -160,7 +160,7 @@ CUDA_TEST_P(SURF, Descriptor) surf.upright = upright; surf.keypointsRatio = 0.05f; - cv::SURF surf_gold; + cv::xfeatures2d::SURF surf_gold; surf_gold.hessianThreshold = hessianThreshold; surf_gold.nOctaves = nOctaves; surf_gold.nOctaveLayers = nOctaveLayers;