title: Logo recognition - how to improve performance
body: <p>I am working on a project of recognizing TV Channels.
  I am taking photos of the channels suck that i try to avoid the background and to take the sample from the center of the logo.
  I recognize 4 different logos, here are the templates:</p>
  
  <p><img src="https://i.stack.imgur.com/BoSuf.jpg" alt="Channel1"> <img src="https://i.stack.imgur.com/Lpfeh.jpg" alt="Channel2"><img src="https://i.stack.imgur.com/tVka3.jpg" alt="Channel3"><img src="https://i.stack.imgur.com/SXa4X.jpg" alt="Channel4"></p>
  
  <p><strong>How does my template matching algorithm work:</strong><br>
  Given 4 templates of size 100x100, each representing a different TV Channel, each having a different threshold (of probability).
  The user is capturing the logo from the TV set, and then the algorithm is:
   - Run 4 independent template matching on each template to receive the probability for each template to match the captured image.
   - for every channel probability, if the probability of a channel is lower then the threshold of the channel, the the probability is changed into 0;
   - announce the recognized logo to be the one with highest probability. If all probabilities are 0, announce "no recognition".</p>
  
  <p>For example, if i got one channel with probability of 0.85 and threshold of 0.9, and the second channel with probability of 0.8 and threshold of 0.75, then the second channel "wins".</p>
  
  <p>When i take a photo of one of the logos, 95% of the times it recognizes the photos.</p>
  
  <p><strong>Current results:</strong></p>
  
  <ul>
  <li>When trying to detect the first ("smiling face" logo), out of 10 detections i got 10 correct detections. For the template matching between the correct template and the image i get probabilities between 0.91 to 0.94. For the other logos i get probabilities between 0.77 to 0.91.</li>
  <li>When trying to detect the second ("green" logo), out of 10 detections i got 10 correct detections. For the template matching between the correct template and the image i get probabilities between 0.78 to 0.91. For the other logos i get probabilities between 0.71 to 0.83 (but because of high threshold, the detection succeeds).</li>
  <li>When trying to detect the third ("round" logo), out of 10 detections i got 9 correct detections. For the template matching between the correct template and the image i get probabilities between 0.83 to 0.92. For the other logos i get probabilities between 0.73 to 0.91.</li>
  <li>When trying to detect the fourth ("black and white" logo), out of 10 detections i got 10 correct detections. For the template matching between the correct template and the image i get probabilities between 0.91 to 0.94. For the other logos i get probabilities between 0.78 to 0.92.</li>
  <li>When trying to detect a "negative" image, many times i get a logo detection (which is bad). If i take, for example, an image of a complete white sheet, it detects the first, third and fourth logos with probability of over 0.9</li>
  </ul>
  
  <p>How can i improve my algorithm, or change it, to get better results on "Negative" images?</p>
  
  <p>Thanks for helping,</p>
  
  <p>Eyal</p>