I am struggling to understand OpenCv's formula for the CV_TM_CCOEFF template matching algorithm
Where
Specifically, in R(x,y), what do the x' and y''s mean? I dont imagine they are derivatives, because the values are all integers so its derivative wrt anything would be 0. Then x + 0 = x.
Secondly, what is T'(x',y')?
I found the other topic asking a question exactly on this but the answer is very vague and unhelpful. Thanks
Edit:
After further reading, apparently T(x', y') is the image pixel value for a pixel (x,y) in the template image and I(x+x', y+y') is the image pixel value for the corresponding pixel position in the target image. With that in mind, what is T(x'',y'') and I(x+x'', y+y'')?


x'andx''are just variables distinct fromx. It's awkward notation, yes.T'is a normalized version ofT, where the mean ofTis subtracted. Likewise forI'(though this one is not used anywhere? I think the equation forRshould useI'rather thanI).Then,
Ris the convolution of the imageIwith the normalized and mirroredT(cross-correlation is the same as convolution, but without the mirroring of the kernel, note how it usesx+x'rather thanx-x'as you would see in a convolution).