Bug: matchTemplate() returns a -1 value with CV_TM_SQDIFF (ver 2.3.4) (Bug #2679)
Description
I'm getting some very strange behaviour (OpenCV ver 2.3.4): matchTemplate() returns a -1 value with CV_TM_SQDIFF.
How can a square be negative?
Here's the code:
{ cv::Mat templ = imread("template.png"); cv::Mat img = imread("img.png"); cv::Mat matchRes ; cv::matchTemplate(img, templ, matchRes, CV_TM_SQDIFF); double best; cv::minMaxLoc(matchRes, &best);// best should NOT be -1 }
The offending images are attached.
History
Updated by Kirill Kornyakov about 12 years ago
- Pull request set to https://github.com/Itseez/opencv/pull/280
- Target version set to 2.4.4