opencv matchTemplate function usage

 

Template matching function, that is, in one figure, find another one in similar places in the chart

 

CV_EXPORTS_W void matchTemplate( InputArray image, InputArray templ,OutputArray result, int method, InputArray mask = noArray() );

the input image is an image,

templ template image is input,

result is stored in a result matrix, the matrix may be determined by the maximum and minimum function minMaxLoc

image matching method is a method of:

CV_TM_SQDIFF matching squared difference method, the best match is zero, the greater the value the poorer the match

CV_TM_SQDIFF_NORMED normalized square difference matching

CV_TM_CCORR correlation matching method using multiplication operations, the greater the value the better the match

CV_TM_CCORR_NORMED normalized correlation matching method

CV_TM_CCOEFF correlation matching method, the best match is 1, -1 represents the worst match

CV_TM_CCOEFF_NORMED normalized correlation coefficient matching

 After the completion of general image matching, the result will be normalized:

normalize(result, result, 0, 1, NORM_MINMAX, -1, Mat());

Guess you like

Origin www.cnblogs.com/132818Creator/p/12197974.html