From 982ef83f807c7c2e4285f3d24894d2e251a66fa2 Mon Sep 17 00:00:00 2001 From: Sergei Nosov Date: Thu, 13 Jun 2013 11:51:45 +0400 Subject: [PATCH] Fixes bug #3071. If we have perfect matches (min_dist == 0.0), then strict comparison fails. Making it non-strict results in treating perfect matches as good. --- .../feature_flann_matcher/feature_flann_matcher.rst | 5 +---- samples/cpp/tutorial_code/features2D/SURF_FlannMatcher.cpp | 2 +- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/doc/tutorials/features2d/feature_flann_matcher/feature_flann_matcher.rst b/doc/tutorials/features2d/feature_flann_matcher/feature_flann_matcher.rst index 47eafedbc7..54d28890ab 100644 --- a/doc/tutorials/features2d/feature_flann_matcher/feature_flann_matcher.rst +++ b/doc/tutorials/features2d/feature_flann_matcher/feature_flann_matcher.rst @@ -85,7 +85,7 @@ This tutorial code's is shown lines below. You can also download it from `here < std::vector< DMatch > good_matches; for( int i = 0; i < descriptors_1.rows; i++ ) - { if( matches[i].distance < 2*min_dist ) + { if( matches[i].distance <= 2*min_dist ) { good_matches.push_back( matches[i]); } } @@ -127,6 +127,3 @@ Result .. image:: images/Feature_FlannMatcher_Keypoints_Result.jpg :align: center :height: 250pt - - - diff --git a/samples/cpp/tutorial_code/features2D/SURF_FlannMatcher.cpp b/samples/cpp/tutorial_code/features2D/SURF_FlannMatcher.cpp index f4cde9b2ee..ead7fd7182 100644 --- a/samples/cpp/tutorial_code/features2D/SURF_FlannMatcher.cpp +++ b/samples/cpp/tutorial_code/features2D/SURF_FlannMatcher.cpp @@ -70,7 +70,7 @@ int main( int argc, char** argv ) std::vector< DMatch > good_matches; for( int i = 0; i < descriptors_1.rows; i++ ) - { if( matches[i].distance < 2*min_dist ) + { if( matches[i].distance <= 2*min_dist ) { good_matches.push_back( matches[i]); } } -- GitLab