title: Finding an icon in an image
body: <p>I'm just starting to learn about computer vision and am working on a simple project to find basic icons in a still image.</p>
  
  <p>I have a template image:
  <a href="https://i.stack.imgur.com/WkbNp.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/WkbNp.png" alt="enter image description here"></a> </p>
  
  <p>and two test images:</p>
  
  <p><a href="https://i.stack.imgur.com/qSME9.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/qSME9.png" alt="enter image description here"></a>
   and <a href="https://i.stack.imgur.com/0oCUf.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/0oCUf.png" alt="enter image description here"></a></p>
  
  <p>I used template matching (using AForge.net, but I think it is the same algorthym 
  that OpenCV and Emgu use.  I could be wrong, I'm new at CV) and discovered that with a threshold of .80563 that I would find exact one match in both of the above, and get no matches in images I tried that the icon was not in.</p>
  
  <p>I thought I was getting somewhere until I looked at what was returned as the match in each image:  (The blue highlighted squares are where the image was matched.)</p>
  
  <p><a href="https://i.stack.imgur.com/nr91Z.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/nr91Z.png" alt="enter image description here"></a> (Correct) and <a href="https://i.stack.imgur.com/UlYR4.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/UlYR4.png" alt="enter image description here"></a> (Completely wrong)</p>
  
  <p>I realize that the issue is any or all of:</p>
  
  <ul>
  <li>Icons I am looking for will be <em>similar</em> in size, color and shade, but no guarantee they will be identical in any of the above.  (Note: Angular orientation and proportions should be consistent.  I wouldn't want a circle with a "+" in it to match the template.  Nor would I want a huge circle with a tiny "X" to match.)</li>
  <li>My template isn't a square, and I'm just guessing that the transparent pixels will not be included in the match.</li>
  <li>Template matching may be the wrong approach given the 2 issues above.  Maybe I need to use something else to do this?</li>
  </ul>
  
  <p>Ultimately, I need some basic help on what is going wrong with my matching so that I can at least get back moving in the correct direction.  Is template matching the right approach, but I need to change something? Or do I need to look at one of the other capabilities in these libraries?  For this simple task, is there much functional difference between OpenCV (and EMGU) functionality and AForge.net functionality?</p>