A raw difference score and a mean-centered correlation score respond differently to a brightness offset.
Name the score being compared
Template matching measures can use squared differences, direct correlation or mean-centered correlation, with defined normalization variants. Their best-score directions and intensity sensitivities differ. A reported score therefore needs its selected measure before it can be compared with another score or interpreted as similarity. Primary reference: OpenCV template matching measures.
For an original worksheet, retain the actual template values and candidate patch alongside the measure name. Do not infer that every best score means low difference. Also separate brightness changes from spatial changes so the score's treatment of each can be examined explicitly.
Apply a fictional brightness offset
Use the template [10,20] and patch [20,30]. Their raw squared-difference sum is (10 − 20)² + (20 − 30)² = 200. Subtracting each array's own mean gives [−5,5] for both. Their normalized centered correlation is 50/√(50 × 50) = 1.
The same invented pair therefore has a nonzero raw difference and perfect centered correlation under the stated arithmetic. The centered calculation removes this uniform offset, but that does not prove equal original intensity. Neither number is a universal matching threshold or actual inspection result.
Keep the retained invariance visible
Prepare an original trial matrix with an unchanged patch, a uniform offset and a changed pattern. Compare each result using the expressly chosen measure. Record which differences the measure suppresses before connecting a favorable score to the physical feature question required by the application.
This guide supplies no HM recognition capability or acceptance score. Its decision is whether brightness sensitivity and the score's optimization direction are known. A best numerical result remains bounded by the representation and measure used; it does not certify an object's identity by itself.
Customer Questions
What is the fictional raw squared difference?
Two hundred.
What is the centered normalized correlation?
One for the stated nonconstant arrays.
Does that prove equal original intensities?
No. Their uniform offset remains in the original values.
Primary References
These references support the technical principles discussed in this guide. The worked examples and review questions are educational.
Discuss Your Machine Requirement
Share your product, container, required output and the evidence needed for your technical review.
Request a Technical Review