2014-07-23 04:36:23 -0600 | commented question | Is the document of CV_TM_SQDIFF_NORMED template matching method correct ? I ended up reading the source code of OpenCV. The document is actually correct, but OpenCV's implementation is a little bit different: if the calculated value is larger than 1, the value would be set to 1. |
2014-07-12 23:42:15 -0600 | commented question | Is the document of CV_TM_SQDIFF_NORMED template matching method correct ? I need the formula in order to implement the algorithm in OpenCL, because the OpenCL implementation from OpenCV is way too slow. |
2014-07-11 05:25:46 -0600 | received badge | ● Student (source) |
2014-07-11 05:24:33 -0600 | asked a question | Is the document of CV_TM_SQDIFF_NORMED template matching method correct ? The link to the document is here http://docs.opencv.org/doc/tutorials/imgproc/histograms/template_matching/template_matching.html#template-matching According to the formula (or my understanding of the formula), in some cases, the result would be larger than 1. For example, let Img be a 4x4 image: let Tpl be a 2x2 template: The dividend of the first element of the matching result would be: The divisor of the first element of the matching result would be: So the first element would roughly be: According to the documentation, CV_TM_SQDIFF_NORMED results would be between 0 and 1.0, apparently, my result isn't. Which part of my calculation is wrong ? Or the documentation is incorrect ? Thanks |