title: OpenCV, feature matching with code from the tutorial
body: <p>I copied the code of the <a href="http://docs.opencv.org/doc/tutorials/features2d/feature_flann_matcher/feature_flann_matcher.html#feature-flann-matcher" rel="noreferrer">Feature Matching with FLANN</a> from the OpenCV tutorial page, and made the following changes:</p>
  
  <ul>
  <li>I used the SIFT features, instead of SURF;</li>
  <li><p>I modified the check for a 'good match'. Instead of</p>
  
  <pre><code>if( matches[i].distance &lt; 2*min_dist )
  </code></pre></li>
  </ul>
  
  <p>I used</p>
  
  <pre><code>    if( matches[i].distance &lt;= 2*min_dist )
  </code></pre>
  
  <p>otherwise I would get zero good matches when comparing an image with itself.</p>
  
  <ul>
  <li><p>Modified parameter in drawing the keypoints:</p>
  
  <pre><code>drawMatches( img1, k1, img2, k2,
                   good_matches, img_matches, Scalar::all(-1), Scalar::all(-1),
                   vector&lt;char&gt;(), DrawMatchesFlags::DEFAULT);
  </code></pre></li>
  </ul>
  
  <p>I extracted the SIFT from all the images in the folder Ireland of the <a href="http://lear.inrialpes.fr/~jegou/data.php" rel="noreferrer">INRIA-Holidays dataset</a>. Then I compared each image to all the others and draw the matches.</p>
  
  <p>However there is a strange problem I have never experienced with any other SIFT/Matcher implementation I used in the past:</p>
  
  <ul>
  <li>the matches for an image I matched against itself are good. Each keypoint is mapped onto itself except for some. See image above. <img src="https://i.stack.imgur.com/ns3UA.png" alt="Image matched against itselft"></li>
  <li>When I match I against another image J (with J not equal to I), many points are mapped onto the same one. Some examples are below. 
  <img src="https://i.stack.imgur.com/YAUY1.png" alt="Matches"> <img src="https://i.stack.imgur.com/fly3C.png" alt="Matches"><img src="https://i.stack.imgur.com/qDgVY.png" alt="Matches"></li>
  </ul>
  
  <p>Is there anyone who used the same code from the OpenCV tutorial and can report a different experience from mine?</p>