title: C# AForge pattern matching very low accuracy - what I'm doing wrong?
body: <p>I need to find objects on images, so I'm trying to do it with AForge library. I've started with very simple pattern and picture, but recognition accuracy is awful already. I'm using ExhaustiveTemplateMatching:</p>
  
  <pre><code>ExhaustiveTemplateMatching tm = new ExhaustiveTemplateMatching(0);
  Bitmap img = new Bitmap("C:/img.bmp");
  Bitmap pat = new Bitmap("C:/pat.bmp");
  TemplateMatch[] matchings = tm.ProcessImage(img, pat);
  Debug.WriteLine("Similar: " + matchings[0].Similarity);
  </code></pre>
  
  <p>That's my pattern:</p>
  
  <p><a href="https://i.stack.imgur.com/iCYs2.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/iCYs2.png" alt="Pattern"></a></p>
  
  <p>That's my image (it's just rotated pattern). It gets only 0,7400396 similarity:</p>
  
  <p><a href="https://i.stack.imgur.com/VGpy3.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/VGpy3.png" alt="Image1"></a></p>
  
  <p>This is practically equal to pattern's similarity to black square (0,7373355):</p>
  
  <p><a href="https://i.stack.imgur.com/oZbfP.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/oZbfP.png" alt="Image2"></a></p>
  
  <p>What I'm doing wrong, getting so low accuracy? How can I improve it?</p>