Note that there are some explanatory texts on larger screens.

plurals
  1. POExplain this algorithm (Compare points in SURF algorithm)
    text
    copied!<p>I need to know if this algorithm is a known one:</p> <pre><code>void getMatches(IpVec &amp;ipts1, IpVec &amp;ipts2, IpPairVec &amp;matches, float ratio) { float dist, d1, d2; Ipoint *match; matches.clear(); for (unsigned int i = 0; i &lt; ipts1.size(); i++) { d1 = d2 = FLT_MAX; for (unsigned int j = 0; j &lt; ipts2.size(); j++) { dist = ipts1[i] - ipts2[j]; if (dist &lt; d1) // if this feature matches better than current best { d2 = d1; d1 = dist; match = &amp;ipts2[j]; } else if (dist &lt; d2) // this feature matches better than second best { d2 = dist; } } // If match has a d1:d2 ratio &lt; 0.65 ipoints are a match if (d1 / d2 &lt; ratio) { // Store the change in position ipts1[i].dx = match-&gt;x - ipts1[i].x; ipts1[i].dy = match-&gt;y - ipts1[i].y; matches.push_back(std::make_pair(ipts1[i], *match)); } } } </code></pre> <hr> <pre><code>class Ipoint { public: //! Destructor ~Ipoint() { }; //! Constructor Ipoint() : orientation(0) { }; //! Gets the distance in descriptor space between Ipoints float operator-(const Ipoint &amp;rhs) { float sum = 0.f; for (int i = 0; i &lt; 64; ++i) { //std::cout &lt;&lt; i &lt;&lt; "\n"; try { sum += (this-&gt;descriptor[i] - rhs.descriptor[i])*(this-&gt;descriptor[i] - rhs.descriptor[i]); } catch (char *str) { std::cout &lt;&lt; "Caught some other exception: " &lt;&lt; str &lt;&lt; "\n"; } } return sqrt(sum); }; //! Coordinates of the detected interest point float x, y; //! Detected scale float scale; //! Orientation measured anti-clockwise from +ve x-axis float orientation; //! Sign of laplacian for fast matching purposes int laplacian; //! Vector of descriptor components float descriptor[64]; //! Placeholds for point motion (can be used for frame to frame motion analysis) float dx, dy; //! Used to store cluster index int clusterIndex; }; </code></pre> <p>This compares the results of SURF algorithm. </p> <ol> <li>This is a nearest neighbor algorithm? That looks like the func is searching the nearest point of every point. </li> <li>Can I do the same using Quadtree or kd-tree?</li> <li>There is a better algorithm to compare to images points and know if them are the same or similar?</li> <li>Preferable I want to store them into mysql and build a kd-tree to compare 1 image through all images, that's possible?</li> <li>RANSAC is useful for anything in this task?</li> <li>There is any method to catch false positives?</li> </ol>
 

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