aboutsummaryrefslogtreecommitdiff
path: root/ports/rtabmap/001_opencv.patch
blob: 5d3a9611ed179ee0b9d20c37953bc0418fc55768 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 1cb24ae36..a5414e26e 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -320,6 +320,9 @@ IF(WITH_QT)
         ENDIF()
         ADD_DEFINITIONS(-DQT_NO_KEYWORDS) # To avoid conflicts with boost signals/foreach and Qt macros
     ENDIF(QT4_FOUND OR Qt5_FOUND)
+ELSE()
+    # Unconditionally disable VTK related features since no visualization tools will be built.
+    ADD_DEFINITIONS("-DDISABLE_VTK")
 ENDIF(WITH_QT)
 
 IF(WITH_SUPERPOINT_TORCH)
diff --git a/corelib/src/Features2d.cpp b/corelib/src/Features2d.cpp
index e4048eefb..862cdc68f 100644
--- a/corelib/src/Features2d.cpp
+++ b/corelib/src/Features2d.cpp
@@ -982,7 +982,7 @@ std::vector<cv::KeyPoint> SIFT::generateKeypointsImpl(const cv::Mat & image, con
 {
 	UASSERT(!image.empty() && image.channels() == 1 && image.depth() == CV_8U);
 	std::vector<cv::KeyPoint> keypoints;
-#if defined(RTABMAP_NONFREE) || CV_MAJOR_VERSION > 4 || (CV_MAJOR_VERSION == 4 && CV_MINOR_VERSION >= 3)
+#if defined(RTABMAP_NONFREE) && ( CV_MAJOR_VERSION > 4 || (CV_MAJOR_VERSION == 4 && CV_MINOR_VERSION >= 3) )
 	cv::Mat imgRoi(image, roi);
 	cv::Mat maskRoi;
 	if(!mask.empty())
@@ -1000,7 +1000,7 @@ cv::Mat SIFT::generateDescriptorsImpl(const cv::Mat & image, std::vector<cv::Key
 {
 	UASSERT(!image.empty() && image.channels() == 1 && image.depth() == CV_8U);
 	cv::Mat descriptors;
-#if defined(RTABMAP_NONFREE) || CV_MAJOR_VERSION > 4 || (CV_MAJOR_VERSION == 4 && CV_MINOR_VERSION >= 3)
+#if defined(RTABMAP_NONFREE) && ( CV_MAJOR_VERSION > 4 || (CV_MAJOR_VERSION == 4 && CV_MINOR_VERSION >= 3) )
 	_sift->compute(image, keypoints, descriptors);
 
 	if( rootSIFT_ && !descriptors.empty())