From 3fe69f4e67a404e2e52a07fc8e02b45098cd38c5 Mon Sep 17 00:00:00 2001 From: berak Date: Sun, 10 May 2015 13:44:49 +0200 Subject: [PATCH] small fixes for features2d tutorials --- .../feature_description/feature_description.markdown | 6 +++--- .../feature_flann_matcher/feature_flann_matcher.markdown | 6 +++--- .../feature_homography/feature_homography.markdown | 9 +++++---- .../good_features_to_track.markdown | 2 +- 4 files changed, 12 insertions(+), 11 deletions(-) diff --git a/doc/tutorials/features2d/feature_description/feature_description.markdown b/doc/tutorials/features2d/feature_description/feature_description.markdown index 047fa5ba09..eea5a29c1d 100644 --- a/doc/tutorials/features2d/feature_description/feature_description.markdown +++ b/doc/tutorials/features2d/feature_description/feature_description.markdown @@ -49,13 +49,13 @@ int main( int argc, char** argv ) int minHessian = 400; Ptr detector = SURF::create(); - detector->setMinHessian(minHessian); + detector->setHessianThreshold(minHessian); std::vector keypoints_1, keypoints_2; Mat descriptors_1, descriptors_2; - detector->detectAndCompute( img_1, keypoints_1, descriptors_1 ); - detector->detectAndCompute( img_2, keypoints_2, descriptors_2 ); + detector->detectAndCompute( img_1, Mat(), keypoints_1, descriptors_1 ); + detector->detectAndCompute( img_2, Mat(), keypoints_2, descriptors_2 ); //-- Step 2: Matching descriptor vectors with a brute force matcher BFMatcher matcher(NORM_L2); diff --git a/doc/tutorials/features2d/feature_flann_matcher/feature_flann_matcher.markdown b/doc/tutorials/features2d/feature_flann_matcher/feature_flann_matcher.markdown index b310c65b9f..9b6a384d3c 100644 --- a/doc/tutorials/features2d/feature_flann_matcher/feature_flann_matcher.markdown +++ b/doc/tutorials/features2d/feature_flann_matcher/feature_flann_matcher.markdown @@ -58,13 +58,13 @@ int main( int argc, char** argv ) int minHessian = 400; Ptr detector = SURF::create(); - detector->setMinHessian(minHessian); + detector->setHessianThreshold(minHessian); std::vector keypoints_1, keypoints_2; Mat descriptors_1, descriptors_2; - detector->detectAndCompute( img_1, keypoints_1, descriptors_1 ); - detector->detectAndCompute( img_2, keypoints_2, descriptors_2 ); + detector->detectAndCompute( img_1, Mat(), keypoints_1, descriptors_1 ); + detector->detectAndCompute( img_2, Mat(), keypoints_2, descriptors_2 ); //-- Step 2: Matching descriptor vectors using FLANN matcher FlannBasedMatcher matcher; diff --git a/doc/tutorials/features2d/feature_homography/feature_homography.markdown b/doc/tutorials/features2d/feature_homography/feature_homography.markdown index 98c3374ea2..dd96302baf 100644 --- a/doc/tutorials/features2d/feature_homography/feature_homography.markdown +++ b/doc/tutorials/features2d/feature_homography/feature_homography.markdown @@ -20,6 +20,7 @@ This tutorial code's is shown lines below. #include #include #include "opencv2/core.hpp" +#include "opencv2/imgproc.hpp" #include "opencv2/features2d.hpp" #include "opencv2/highgui.hpp" #include "opencv2/calib3d.hpp" @@ -50,8 +51,8 @@ int main( int argc, char** argv ) std::vector keypoints_object, keypoints_scene; Mat descriptors_object, descriptors_scene; - detector->detectAndCompute( img_object, keypoints_object, descriptors_object ); - detector->detectAndCompute( img_scene, keypoints_scene, descriptors_scene ); + detector->detectAndCompute( img_object, Mat(), keypoints_object, descriptors_object ); + detector->detectAndCompute( img_scene, Mat(), keypoints_scene, descriptors_scene ); //-- Step 2: Matching descriptor vectors using FLANN matcher FlannBasedMatcher matcher; @@ -81,13 +82,13 @@ int main( int argc, char** argv ) Mat img_matches; drawMatches( img_object, keypoints_object, img_scene, keypoints_scene, good_matches, img_matches, Scalar::all(-1), Scalar::all(-1), - vector(), DrawMatchesFlags::NOT_DRAW_SINGLE_POINTS ); + std::vector(), DrawMatchesFlags::NOT_DRAW_SINGLE_POINTS ); //-- Localize the object std::vector obj; std::vector scene; - for( int i = 0; i < good_matches.size(); i++ ) + for( size_t i = 0; i < good_matches.size(); i++ ) { //-- Get the keypoints from the good matches obj.push_back( keypoints_object[ good_matches[i].queryIdx ].pt ); diff --git a/doc/tutorials/features2d/trackingmotion/good_features_to_track/good_features_to_track.markdown b/doc/tutorials/features2d/trackingmotion/good_features_to_track/good_features_to_track.markdown index 1b939765c6..e4d9769952 100644 --- a/doc/tutorials/features2d/trackingmotion/good_features_to_track/good_features_to_track.markdown +++ b/doc/tutorials/features2d/trackingmotion/good_features_to_track/good_features_to_track.markdown @@ -96,7 +96,7 @@ void goodFeaturesToTrack_Demo( int, void* ) /// Draw corners detected cout<<"** Number of corners detected: "<