Ask Your Question

Revision history [back]

Template matching with zero mean normalized cross-correlation

I wonder how to compute zero mean normalized cross-correlation in opencv? According to this answer cv::matchTemplate with TM_COEFF_NORMED should do the trick. Answer states that

According to the documentation CV_TM_CCOEFF and CV_TM_CCOEFF_NORMED both subtract the mean from the window and the template

however I can not see that mean is subtracted in formula given in the documentation.

So is there any built-in way to compute zncc in opencv?