title: Opencv matchTemplate not matching
body: <p>I'm using OpenCV 3.0.0 to locate an image into another image. A priori the function matchTemplate is what i need to use, but seeing the results i am not sure anymore.</p>
  
  <p>The problem is that depending on the input images, the result is perfectly accurate or completely inaccurate.</p>
  
  <p>Example 1:</p>
  
  <p>Main image</p>
  
  <p><img src="https://i.stack.imgur.com/v3jot.jpg" alt="Simple"></p>
  
  <p>Template</p>
  
  <p><img src="https://i.stack.imgur.com/AaaYY.jpg" alt="Simple"></p>
  
  <p>Result</p>
  
  <p><img src="https://i.stack.imgur.com/2ru4c.jpg" alt="Simple"></p>
  
  <p>No complaints here. The matching is perfect in this case. But now i replace the images for the ones i want to use and...</p>
  
  <p>Main image</p>
  
  <p><img src="https://i.stack.imgur.com/7yhS3.jpg" alt="Complex"></p>
  
  <p>Template </p>
  
  <p><img src="https://i.stack.imgur.com/MQrwV.jpg" alt="Complex"></p>
  
  <p>Result</p>
  
  <p><img src="https://i.stack.imgur.com/hZR3B.jpg" alt="enter image description here"></p>
  
  <p>So, not working at all (result rectangle on top right of the image). Any of the methods (in this example CORR NORMED) prints the rectangle where the template is located. All the results are far away from being accurate.</p>
  
  <p>So, my question is, does the result of matchTemplate depend on how many different colors/shapes the main image has? 
  Would SURF or SIFT help me here?
  Do you guys now any function that would help me locate a template into another image?</p>
  
  <p>Thank you in advance!</p>
  
  <p>PS: I didn't add any code because i guess is not that kind of problem, since the first example works well. </p>