title: how to get correctly matched features
body: <p>I am making features detection in two different images, and the resultant image from the Descriptors Matcher contains features that do not belong to each other as see in the <code>img_1</code> below.</p>
  
  <p>The steps I followed are as follows:</p>
  
  <ol>
  <li>Features detection using SIFT algorithm. and this step yields MatOdKeyPoint object for each image, which means
  MatKeyPts_1 and MatKeyPts_2</li>
  <li>Descriptors extractor using SURF algorithm.</li>
  <li>Descriptors matching using BRUTFORCE algorithm. the code of this step is posted below, and the descriptor extractor of the <code>query_img</code> and the <code>train_img</code> were used as input in this step. I am also using my own classes that I created to control and maintain this process.</li>
  </ol>
  
  <p>The problem is, the result from step 3 is the image posted below <code>img_1</code>, which has completely non-similar features linked to eah others, i expected to see,for an example, the specific region of the hand(img_1, right) is linked to the similar feature in the hand in the (img_1,left), but as you see i got mixed and unrelated features.</p>
  
  <p>My question is how to get correct features matching using SIFT and SURF as features detectors and descriptor extractor respectively?</p>
  
  <pre><code>private static void descriptorMatcher() {
      // TODO Auto-generated method stub
      MatOfDMatch matDMatch = new MatOfDMatch();//empty MatOfDmatch object
      dm.match(matFactory.getComputedDescExtMatAt(0), matFactory.getComputedDescExtMatAt(1), matDMatch);//descriptor extractor of the query and the train image are used as parameters 
      matFactory.addRawMatchesMatDMatch(matDMatch);
  
      /*writing the raw MatDMatches*/
      Mat outImg = new Mat();
      Features2d.drawMatches(matFactory.getMatAt(0), matFactory.getMatKeyPtsAt(0), matFactory.getMatAt(1), matFactory.getMatKeyPtsAt(1), MatFactory.lastAddedObj(matFactory.getRawMatchesMatDMatchList()), 
              outImg);
      matFactory.addRawMatchedImage(outImg);
      MatFactory.writeMat(FilePathUtils.newOutputPath(SystemConstants.RAW_MATCHED_IMAGE), MatFactory.lastAddedObj(matFactory.getRawMatchedImageList()));//this produce img_2 below posted
  
      /*getting the top 10 shortest distance*/
      List&lt;DMatch&gt; dMtchList = matDMatch.toList();
      List&lt;DMatch&gt; goodDMatchList = MatFactory.getTopGoodMatches(dMtchList, 0, 10);//this method sort the dMatchList ascendingly and picks onlt the top 10 distances and assign these values to goodDMatchList
  
      /*converting the goo DMatches to MatOfDMatches*/
      MatOfDMatch goodMatDMatches = new MatOfDMatch();
      goodMatDMatches.fromList(goodDMatchList);
      matFactory.addGoodMatchMatDMatch(goodMatDMatches);
  
      /*drawing the good matches and writing the good matches images*/
      Features2d.drawMatches(matFactory.getMatAt(0), matFactory.getMatKeyPtsAt(0), matFactory.getMatAt(1), matFactory.getMatKeyPtsAt(1), MatFactory.lastAddedObj(matFactory.getGoodMatchMatDMatchList()), 
              outImg);
      MatFactory.writeMat(FilePathUtils.newOutputPath(SystemConstants.GOOD_MATCHED_IMAGE), outImg);// this produce img_1 below posted
  }
  </code></pre>
  
  <p>Img_1<img src="https://i.stack.imgur.com/YTqpo.jpg" alt="enter image description here"></p>