Note that there are some explanatory texts on larger screens.

plurals
  1. POObject Detection with Hamming distance
    primarykey
    data
    text
    <p>I am using FAST and FREAK to get the descriptors of a couple of images and then I apply knnMatch with a <em>BruteForceMatcher matcher</em> and next I am using a loop to separate the good matches:</p> <pre><code> float nndrRatio = 0.7f; std::vector&lt;KeyPoint&gt; keypointsA, keypointsB; Mat descriptorsA, descriptorsB; std::vector&lt; vector&lt; DMatch &gt; &gt; matches; int threshold=9; // detect keypoints: FAST(objectMat,keypointsA,threshold,true); FAST(sceneMat,keypointsB,threshold,true); FREAK extractor; // extract descriptors: extractor.compute( objectMat, keypointsA, descriptorsA ); extractor.compute( sceneMat, keypointsB, descriptorsB ); BruteForceMatcher&lt;Hamming&gt; matcher; // match matcher.knnMatch(descriptorsA, descriptorsB, matches, 2); // good matches search: vector&lt; DMatch &gt; good_matches; for (size_t i = 0; i &lt; matches.size(); ++i) { if (matches[i].size() &lt; 2) continue; const DMatch &amp;m1 = matches[i][0]; const DMatch &amp;m2 = matches[i][1]; if(m1.distance &lt;= nndrRatio * m2.distance) good_matches.push_back(m1); } //If there are at least 7 good matches, then object has been found if ( (good_matches.size() &gt;=7)) { cout &lt;&lt; "OBJECT FOUND!" &lt;&lt; endl; } </code></pre> <p>I think the problem could be the good matches search method, because using it with the FlannBasedMatcher works fine but with the BruteForceMatcher very weirdly. I'm suspecting that I may be doing a nonsense with this method because the Hamming distance uses binary descriptors, but I can't think of a way to adapt it!</p> <p>Any links, snippets, ideas,... please?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload