From ca01bf55d46123949ac5643ff8792858e1d670dc Mon Sep 17 00:00:00 2001 From: matlabbe Date: Thu, 14 Sep 2017 21:41:00 -0400 Subject: [PATCH] OpenCV3: added error msg with bruteforce GPU if not built with cudafeature2d. Fixed compilation error with OpenCV3+cudafeature2d module. --- src/Vocabulary.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Vocabulary.cpp b/src/Vocabulary.cpp index d1b85368..5392357c 100644 --- a/src/Vocabulary.cpp +++ b/src/Vocabulary.cpp @@ -413,8 +413,10 @@ void Vocabulary::search(const cv::Mat & descriptorsIn, cv::Mat & results, cv::Ma else { gpuMatcher = cv::cuda::DescriptorMatcher::createBFMatcher(cv::NORM_L2); - gpuMatcher.knnMatch(newDescriptorsGpu, lastDescriptorsGpu, matches, k); + gpuMatcher->knnMatch(newDescriptorsGpu, lastDescriptorsGpu, matches, k); } +#else + UERROR("OpenCV3 is not built with CUDAFEATURES2D module, cannot do brute force matching on GPU!"); #endif #endif }