Ask Your Question

Revision history [back]

Looking at the matchTemplate documentation you can see that the result parameter contains a map of comparison results. This is actually a response of the input image to the filter (the template created) that will result in a mapping with local maxima. Look for the positions with the largest response (by thresholding the image). This will help you determine more than a single maxima or match, since exact the same images will have the same response.

More information on this problem can be found in the matchTemplate tutorial.

Looking at the matchTemplate documentation you can see that the result parameter contains a map of comparison results. This is actually a response of the input image to the filter (the template created) that will result in a mapping with local maxima. Look for the positions with the largest response (by thresholding the image). This will help you determine more than a single maxima or match, since exact the same images will have the same response.

More information on this problem can be found in the matchTemplate tutorial.

The tutorial mentions

In practice, we use the function minMaxLoc to locate the highest value (or lower, depending of the type of matching method) in the R matrix.

which actually means that they use that minMaxLoc to locate the maximum value, but if you threshold the image on your own threshold, you will basically find more local maxima.