title: how to improve orb feature matching?
body: <p>I am trying to register two binary images. I used opencv orb detector and matcher to generate and match feature points. However, the matching result looks bad. Can anybody tell me why and how to improve? Thanks. 
  Here are the images and matching result.</p>
  
  <p><a href="https://i.stack.imgur.com/CNgAP.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/CNgAP.png" alt="enter image description here"></a></p>
  
  <p><a href="https://i.stack.imgur.com/YlTh1.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/YlTh1.png" alt="enter image description here"></a></p>
  
  <p><a href="https://i.stack.imgur.com/ox8N9.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ox8N9.png" alt="enter image description here"></a></p>
  
  <p>Here is the code</p>
  
  <pre><code>OrbFeatureDetector detector; //OrbFeatureDetector detector;SurfFeatureDetector
  vector&lt;KeyPoint&gt; keypoints1;
  detector.detect(im_edge1, keypoints1);
  vector&lt;KeyPoint&gt; keypoints2;
  detector.detect(im_edge2, keypoints2);
  
  OrbDescriptorExtractor extractor; //OrbDescriptorExtractor extractor; SurfDescriptorExtractor extractor;
  Mat descriptors_1, descriptors_2;
  extractor.compute( im_edge1, keypoints1, descriptors_1 );
  extractor.compute( im_edge2, keypoints2, descriptors_2 );
  
  //-- Step 3: Matching descriptor vectors with a brute force matcher
  BFMatcher matcher(NORM_L2, true);   //BFMatcher matcher(NORM_L2);
  
  vector&lt; DMatch&gt; matches;
  matcher.match(descriptors_1, descriptors_2, matches);
  
  
  vector&lt; DMatch &gt; good_matches;
  vector&lt;Point2f&gt; featurePoints1;
  vector&lt;Point2f&gt; featurePoints2;
  for(int i=0; i&lt;int(matches.size()); i++){
      good_matches.push_back(matches[i]);
  }
  
  //-- Draw only "good" matches
  Mat img_matches;
  imwrite("img_matches_orb.bmp", img_matches);
  </code></pre>