Ask Your Question

Revision history [back]

matchTemplate isn't returning a result each time. It computes the overlapping of the template to the image, with the specified method. Therefore, there is always a results (for all pixels, the square difference, or the correlation, ...). When you use MinMaxLocation to find the "most probable position of the template on the image", I insist on the "most probable", you have a score, that you can threshold if it's too low. It's up to you and depend on your context.