Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

minMaxLoc() always returns values even template doesn't exist in image

matchTemplate(Image, Template, ResImage, CV_TM_CCOEFF);
double Min, Max;
Point MinLoc, MaxLoc;
minMaxLoc(ResImage, &Min, &Max, &MinLoc, &MaxLoc, Mat());

minMaxLoc() always returns values even "Template" doesn't exist in "Image".
How do we know if it really exists or not?

The documentation says that if CV_TM_CCOEFF is used, the best match is MaxLoc.
But MaxLoc always contains values.