Is the spec of MatchTemplate correct?


Now I am trying to implement MatchTemplate ( VX_COMPARE_CCORR_NORM) but the specification seems to be incorrect.

The spec says that the equation is as below:

sum(T * I) * 2^15 / sqrt(sum(I^2 * T^2))

But the OpenVX sample implementation implements it as below:

sum(T * I) * 2^15 / sqrt(sum(I^2) * sum(T^2))

I checked the value of both case with randomly generated input and template, and found that a result from the specification overflows but ones from OpenVX sample Implementation does not.

Could you tell me if the spec is correct or not?

Thank you in advance.