Commit 982ef83f authored by Sergei Nosov's avatar Sergei Nosov

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.
parent 98f6a4a6
...@@ -85,7 +85,7 @@ This tutorial code's is shown lines below. You can also download it from `here < ...@@ -85,7 +85,7 @@ This tutorial code's is shown lines below. You can also download it from `here <
std::vector< DMatch > good_matches; std::vector< DMatch > good_matches;
for( int i = 0; i < descriptors_1.rows; i++ ) 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]); } { good_matches.push_back( matches[i]); }
} }
...@@ -127,6 +127,3 @@ Result ...@@ -127,6 +127,3 @@ Result
.. image:: images/Feature_FlannMatcher_Keypoints_Result.jpg .. image:: images/Feature_FlannMatcher_Keypoints_Result.jpg
:align: center :align: center
:height: 250pt :height: 250pt
...@@ -70,7 +70,7 @@ int main( int argc, char** argv ) ...@@ -70,7 +70,7 @@ int main( int argc, char** argv )
std::vector< DMatch > good_matches; std::vector< DMatch > good_matches;
for( int i = 0; i < descriptors_1.rows; i++ ) 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]); } { good_matches.push_back( matches[i]); }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment