mirror of
https://github.com/introlab/rtabmap.git
synced 2026-09-03 01:50:24 +08:00
Fixed build with OpenCV4+CUDA10 (#334)
This commit is contained in:
@@ -900,9 +900,9 @@ IF(OpenCV_FOUND)
|
|||||||
ENDIF()
|
ENDIF()
|
||||||
ELSE()
|
ELSE()
|
||||||
IF(OPENCV_XFEATURES2D_FOUND)
|
IF(OPENCV_XFEATURES2D_FOUND)
|
||||||
MESSAGE(STATUS " *With OpenCV 3 xfeatures2d module (SIFT/SURF/BRIEF/FREAK) = YES (License: Non commercial)")
|
MESSAGE(STATUS " *With OpenCV ${OpenCV_VERSION_MAJOR} xfeatures2d module (SIFT/SURF/BRIEF/FREAK) = YES (License: Non commercial)")
|
||||||
ELSE()
|
ELSE()
|
||||||
MESSAGE(STATUS " *With OpenCV 3 xfeatures2d module (SIFT/SURF/BRIEF/FREAK) = NO (not found, License: BSD)")
|
MESSAGE(STATUS " *With OpenCV ${OpenCV_VERSION_MAJOR} xfeatures2d module (SIFT/SURF/BRIEF/FREAK) = NO (not found, License: BSD)")
|
||||||
ENDIF()
|
ENDIF()
|
||||||
ENDIF()
|
ENDIF()
|
||||||
ENDIF(OpenCV_FOUND)
|
ENDIF(OpenCV_FOUND)
|
||||||
|
|||||||
@@ -1082,17 +1082,19 @@ std::vector<int> VWDictionary::findNN(const cv::Mat & queryIn) const
|
|||||||
#ifdef HAVE_OPENCV_CUDAFEATURES2D
|
#ifdef HAVE_OPENCV_CUDAFEATURES2D
|
||||||
cv::cuda::GpuMat newDescriptorsGpu(query);
|
cv::cuda::GpuMat newDescriptorsGpu(query);
|
||||||
cv::cuda::GpuMat lastDescriptorsGpu(_dataTree);
|
cv::cuda::GpuMat lastDescriptorsGpu(_dataTree);
|
||||||
|
cv::cuda::GpuMat matchesGpu;
|
||||||
cv::Ptr<cv::cuda::DescriptorMatcher> gpuMatcher;
|
cv::Ptr<cv::cuda::DescriptorMatcher> gpuMatcher;
|
||||||
if(query.type()==CV_8U)
|
if(query.type()==CV_8U)
|
||||||
{
|
{
|
||||||
gpuMatcher = cv::cuda::DescriptorMatcher::createBFMatcher(cv::NORM_HAMMING);
|
gpuMatcher = cv::cuda::DescriptorMatcher::createBFMatcher(cv::NORM_HAMMING);
|
||||||
gpuMatcher->knnMatchAsync(newDescriptorsGpu, lastDescriptorsGpu, matches, k);
|
gpuMatcher->knnMatchAsync(newDescriptorsGpu, lastDescriptorsGpu, matchesGpu, k);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
gpuMatcher = cv::cuda::DescriptorMatcher::createBFMatcher(cv::NORM_L2);
|
gpuMatcher = cv::cuda::DescriptorMatcher::createBFMatcher(cv::NORM_L2);
|
||||||
gpuMatcher->knnMatchAsync(newDescriptorsGpu, lastDescriptorsGpu, matches, k);
|
gpuMatcher->knnMatchAsync(newDescriptorsGpu, lastDescriptorsGpu, matchesGpu, k);
|
||||||
}
|
}
|
||||||
|
gpuMatcher->knnMatchConvert(matchesGpu, matches);
|
||||||
#else
|
#else
|
||||||
UERROR("Cannot use brute Force GPU because OpenCV is not built with cuda module.");
|
UERROR("Cannot use brute Force GPU because OpenCV is not built with cuda module.");
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -34,6 +34,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|||||||
#include <rtabmap/utilite/UTimer.h>
|
#include <rtabmap/utilite/UTimer.h>
|
||||||
#include <rtabmap/utilite/UThreadC.h>
|
#include <rtabmap/utilite/UThreadC.h>
|
||||||
#include <rtabmap/utilite/UConversion.h>
|
#include <rtabmap/utilite/UConversion.h>
|
||||||
|
#include <opencv2/videoio/videoio_c.h>
|
||||||
|
|
||||||
|
|
||||||
namespace rtabmap
|
namespace rtabmap
|
||||||
|
|||||||
Reference in New Issue
Block a user