Skip to content
Snippets Groups Projects
Commit 90f74e2b authored by Angel Santamaria-Navarro's avatar Angel Santamaria-Navarro
Browse files

fix examples with opencv3 api change

parent c80b39c1
No related branches found
No related tags found
1 merge request!197Vision devel
......@@ -52,6 +52,7 @@ int main(int argc, char** argv)
unsigned int scoreType = 0; //#enum { kBytes = 32, HARRIS_SCORE=0, FAST_SCORE=1 };
unsigned int patchSize = 31;
#if defined (HAVE_OPENCV3)
detector_descriptor_ptr_ = cv::ORB::create(nfeatures, //
scaleFactor, //
nlevels, //
......@@ -60,6 +61,16 @@ int main(int argc, char** argv)
WTA_K, //
scoreType, //
patchSize);//,
#else
detector_descriptor_ptr_ = cv::ORB(nfeatures, //
scaleFactor, //
nlevels, //
edgeThreshold, //
firstLevel, //
WTA_K, //
scoreType, //
patchSize);
#endif
std::vector<cv::KeyPoint> target_keypoints;
cv::KeyPointsFilter keypoint_filter;
......
......@@ -81,8 +81,16 @@ int main(int argc, char** argv)
cv::moveWindow("Feature tracker", 0, 0);
// set image processors
cv::Ptr<cv::FeatureDetector> detector_descriptor_ptr = cv::ORB::create(1000,2,8,16,0,3,0,31);
cv::Ptr<cv::DescriptorMatcher> matcher_ptr = cv::DescriptorMatcher::create("BruteForce-Hamming(2)");
cv::Ptr<cv::FeatureDetector> detector_descriptor_ptr;
cv::Ptr<cv::DescriptorMatcher> matcher_ptr;
#if defined (HAVE_OPENCV3)
detector_descriptor_ptr = cv::ORB::create(1000,2,8,16,0,3,0,31);
matcher_ptr = cv::DescriptorMatcher::create("BruteForce-Hamming(2)");
#else
detector_descriptor_ptr = cv::ORB(1000,2,8,16,0,3,0,31);
matcher_ptr = cv::BFMatcher();
#endif
// declare all variables
std::vector<cv::KeyPoint> keypoints_1, keypoints_2;
......
......@@ -74,6 +74,7 @@ int main(int argc, char** argv)
unsigned int roi_width = 200;
unsigned int roi_heigth = 200;
#if defined (HAVE_OPENCV3)
detector_descriptor_ptr_ = cv::ORB::create(nfeatures, //
scaleFactor, //
nlevels, //
......@@ -82,12 +83,25 @@ int main(int argc, char** argv)
WTA_K, //
scoreType, //
patchSize);//
matcher_ptr_ = cv::DescriptorMatcher::create("BruteForce-Hamming(2)");
#else
detector_descriptor_ptr_ = cv::ORB(nfeatures, //
scaleFactor, //
nlevels, //
edgeThreshold, //
firstLevel, //
WTA_K, //
scoreType, //
patchSize);//
matcher_ptr_ = cv::DescriptorMatcher::create("BruteForce-Hamming(2)");
matcher_ptr = cv::BFMatcher();
#endif
unsigned int pattern_radius = (unsigned int)(patchSize);
unsigned int size_bits = detector_descriptor_ptr_->descriptorSize() * 8;
matcher_ptr_ = cv::DescriptorMatcher::create("BruteForce-Hamming(2)");
//=====================================================
unsigned int buffer_size = 20;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment