Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I believe the culprit is you're looking for a single resolution of template, which is much smaller than the flowers you want to find.</p> <p>So, if you're using matchTemplate - you should run it several times. For different sizes of the template (make your flower bigger with resize). Another option is to scale the image down, and use the template of the same size.</p> <p>Those approaches are rather simple, however, may be sub-optimal - you'll be doing a lot of work resizing and matching all over again. So, you should probably use feature matching and figure out what exactly goes wrong. Don't know if you've seen it, but you can follow the feature matching tutorial <a href="http://docs.opencv.org/doc/tutorials/features2d/feature_flann_matcher/feature_flann_matcher.html" rel="nofollow">http://docs.opencv.org/doc/tutorials/features2d/feature_flann_matcher/feature_flann_matcher.html</a></p> <p><strong>UPD</strong></p> <p>I believe, I misinterpreted your image. I agree with you on the size now - it isn't such a big deal. Well, I don't know how you've done the matching, but the following code</p> <pre><code>Mat image = imread("/home/sergei/Documents/source.jpg"); Mat templ = imread("/home/sergei/Documents/template.jpg"); Mat dst; matchTemplate(image, templ, dst, CV_TM_CCOEFF_NORMED); threshold(dst, dst, 0.2, 0.0, THRESH_TOZERO); for (int i = 0; i &lt; dst.rows; i++) { for (int j = 0; j &lt; dst.cols; j++) { if (dst.ptr&lt;float&gt;(i)[j] &gt; 0.0) { imshow("candidate", image(Rect(j, i, templ.cols, templ.rows))); waitKey(0); } } } </code></pre> <p>misses, I believe, 2 of the matches you consider valid. It gives you few false positives as well, but that's a start.</p> <p>You can improve further by playing with threshold value and matching metric.</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.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      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