template matching in multiple images
How can i Access result from matchTemplate(InputArray image, InputArray templ, OutputArray result, int method) ???
How can i Access result from matchTemplate(InputArray image, InputArray templ, OutputArray result, int method) ???
Looking at the description of the actual method:
http://docs.opencv.org/modules/imgproc/doc/object_detection.html?highlight=matchtemplate#cv.MatchTemplate
void matchTemplate(InputArray image, InputArray templ, OutputArray result, int method)
It states that the results are stored in a comparison results map.
Beneath the explanation you can find this text:
After the function finishes the comparison, the best matches can be found as global minimums (when CV_TM_SQDIFF was used) or maximums (when CV_TM_CCORR or CV_TM_CCOEFF was used) using the minMaxLoc() function. In case of a color image, template summation in the numerator and each sum in the denominator is done over all of the channels and separate mean values are used for each channel. That is, the function can take a color template and a color image. The result will still be a single-channel image, which is easier to analyze.
So basically try to find global maxima in the output map. This means you need to go over your output matrix and look for maximal values.
ADDITION 1
--> go read tutorial on template matching, it is all explained there:
http://docs.opencv.org/doc/tutorials/imgproc/histograms/template_matching/template_matching.html
Look at my addition and except answers if they serve you well :)
Asked: 2013-03-29 06:27:05 -0600
Seen: 1,308 times
Last updated: Mar 29 '13
Need clarification on matchTemplate
Conversion of templateMatching result to Android Bitmap
android native template matching [closed]
Template matching with the CV_TM_CCOEFF algorithm
matchTemplate function, result processing
Calculating a template matching similarity score?
Problem with template matching in SUB-IMAGE extracted from ORIGINAL-IMAGE.