Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

In the matrix res, you have at each pixel location the correlation score between the template image and the query image.

The function minMaxLoc will return the global minimum and maximum in an array" and also the pixel locations.

In case of possible multiple matches:

  • if all the matches have the same score, minMaxLoc will return the first location found (searching direction from top to bottom and from left to right)
  • otherwise, it will return the location of the best score and if the others matches have the same score, the order will depend of their location in the image

If you want to order the matches, I think that you just have to test the coordinates manually.