Missing the cost function of TM_CCOEFF_NORMED with mask for matchTemplate() in API doc

Hi guys,

When reading the documentation of API matchTemplate of 4.5.4, there misses the cost function of TM_CCOEFF_NORMED with mask, as showing below. But this API does support mask when choosing TM_CCOEFF_NORMED.

Is it missing in documentation?
I am a newbie to template matching. Could someone help to find this cost function?

Thanks in advance.

Regards,
Yongqiang

I’ve noticed that omission too, and wondered whether it’s a mistake?

To add to the confusion, this tutorial says “Only two matching methods currently accept a mask: TM_SQDIFF and TM_CCORR_NORMED”, but the documentation seems to contradict that.

my two cents: I find those unwieldy “world formulae” (cram it all in, to hell with structure) a disservice to the reader. half the scribbles in every term encode “run on every pixel”, which is the same for all modes. and none of them indicate how the mask affects the calculation.

very likely an oversight. someone once wrote this, then nobody ever touched it again. prime candidate for some drive-by improvements.

1 Like

Yes. I also noticed this tutorial. The API documentation was updated.

After the second look at the API doc, the masked formula is already covered in the line of TM_CCOEFF.

My problem is resolved! Thanks for everyone’s comment.