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 you want to order the matches, I think that you just have to test the coordinates manually.