diff --git a/src/examples/CMakeLists.txt b/src/examples/CMakeLists.txt index 88edc19c905f956a082494b11ba9f149a116e718..e8a9b1c1cc28ffa72076acd3b2e52c634e825676 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 1c0498515b7e997efff291c1c72eb7e0c419f7bc..8d33f947197ea07a8487d178353bccccb4ad050a 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, //