Note that there are some explanatory texts on larger screens.

plurals
  1. POC++ compare surf descriptors algorithm match breaks some times
    primarykey
    data
    text
    <p>I wrote a c++ application that compares points matches from images (OpenSurf C++) but some times, 1 from some thousands of "getUniqueMatches", the application breaks in some point inside "getUniqueMatches". I has this log:</p> <pre><code>05/13/11 10:17:16: this-&gt;pointsA = 227 05/13/11 10:17:16: this-&gt;pointsB = 226 05/13/11 10:17:16: this-&gt;matches before = 0 05/13/11 10:17:16: 227 226 0 0.650000 05/13/11 10:17:16: Starting in getUniqueMatches -- And here breaks, inside getUniqueMatches -- </code></pre> <p>And this is the code:</p> <pre><code>inline bool findInVector(std::vector&lt;int&gt; v, int value) { int size = v.size(); for(int i=0; i&lt;size; i++) { if(v[i] == value) { return true; } } return false; } void getUniqueMatches(IpVec &amp;ipts1, IpVec &amp;ipts2, IpPairVec &amp;matches, float ratio) { try { wLog(f("%d %d %d %f", ipts1.size(), ipts2.size(), matches.size(), ratio)); float dist, d1, d2; Ipoint *match; matches.clear(); std::vector&lt;int&gt; matched; wLog("Starting in getUniqueMatches"); // Breaks after here int size = ipts1.size(); int size2 = ipts2.size(); for (int i = 0; i &lt; size; i++) { d1 = d2 = FLT_MAX; int foundJ = -1; for (unsigned int j = 0; j &lt; size2; j++) { dist = ipts1[i] - ipts2[j]; if (dist &lt; d1 &amp;&amp; !findInVector(matched, j)) { d2 = d1; d1 = dist; match = &amp;ipts2[j]; foundJ = j; } else if (dist &lt; d2) { d2 = dist; } } if (d1 / d2 &lt; ratio) { 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)); matched.push_back(foundJ); } } } catch(std::exception ex) { wLog(f("Exception in getUniqueMatches: ", ex.what())); return; } } </code></pre> <p>Only some times breaks here. I don't know what is happening, maybe something wrong? The application uses only 1 thread when executing this function. When extracting points uses 10 threads.</p> <p>Using it on Centos5 (VPS). 2 Gb RAm 20% hd used Compiled using g++ (Performance mode), IDE used Netbeans. OpenCV, libcurl.</p>
    singulars
    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.
 

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