From 973f1d99986d75655e17191d45a750de67b0bd68 Mon Sep 17 00:00:00 2001
From: asantamaria <asantamaria@iri.upc.edu>
Date: Wed, 30 Aug 2017 11:18:59 +0200
Subject: [PATCH] fix for test_roi_orb.cpp

---
 src/examples/CMakeLists.txt   | 4 ++--
 src/examples/test_ROI_ORB.cpp | 5 +++--
 2 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/src/examples/CMakeLists.txt b/src/examples/CMakeLists.txt
index 88edc19c9..e8a9b1c1c 100644
--- a/src/examples/CMakeLists.txt
+++ b/src/examples/CMakeLists.txt
@@ -131,8 +131,8 @@ IF(OpenCV_FOUND)
 #    TARGET_LINK_LIBRARIES(test_tracker_ORB ${PROJECT_NAME})
 
     # ORB tracker test
-#    ADD_EXECUTABLE(test_ROI_ORB test_ROI_ORB.cpp)
-#    TARGET_LINK_LIBRARIES(test_ROI_ORB ${PROJECT_NAME})
+    ADD_EXECUTABLE(test_ROI_ORB test_ROI_ORB.cpp)
+    TARGET_LINK_LIBRARIES(test_ROI_ORB ${PROJECT_NAME})
 ENDIF(OpenCV_FOUND)
 
 IF(Ceres_FOUND)
diff --git a/src/examples/test_ROI_ORB.cpp b/src/examples/test_ROI_ORB.cpp
index 1c0498515..8d33f9471 100644
--- a/src/examples/test_ROI_ORB.cpp
+++ b/src/examples/test_ROI_ORB.cpp
@@ -4,6 +4,7 @@
 //opencv includes
 #include "opencv2/features2d/features2d.hpp"
 #include <opencv2/highgui/highgui.hpp>
+#include <opencv2/imgproc/imgproc.hpp>
 #include <opencv2/core/core.hpp>
 
 int main(int argc, char** argv)
@@ -34,7 +35,7 @@ int main(int argc, char** argv)
     unsigned int img_height = image.rows;
     std::cout << "Image size: " << img_width << "x" << img_height << std::endl;
 
-    cv::Feature2D* detector_descriptor_ptr_;
+    cv::Ptr<cv::FeatureDetector> detector_descriptor_ptr_;
 
     unsigned int nfeatures = 20;
     float scaleFactor = 1.2;
@@ -45,7 +46,7 @@ int main(int argc, char** argv)
     unsigned int scoreType = 0;              //#enum { kBytes = 32, HARRIS_SCORE=0, FAST_SCORE=1 };
     unsigned int patchSize = 31;
 
-    detector_descriptor_ptr_ = new cv::ORB(nfeatures, //
+    detector_descriptor_ptr_ = cv::ORB::create(nfeatures, //
                                            scaleFactor, //
                                            nlevels, //
                                            edgeThreshold, //
-- 
GitLab