Image.zncc#
- Image.zncc(image2: Any) float[source]#
Zero-mean normalized cross correlation
- Parameters:
image2 (
Image) – second image- Raises:
ValueError – image2 shape is not equal to self
- Returns:
normalised cross correlation
- Return type:
scalar
Returns an image similarity measure which is the zero-mean normalized cross-correlation between the image and
image2. The result is a scalar in the interval -1 (non match) to 1 (perfect match) that indicates similarity.Example:
>>> from machinevisiontoolbox import Image >>> img1 = Image([[10, 11], [12, 13]]) >>> img2 = Image([[10, 11], [10, 13]]) >>> img1.zncc(img2) np.float64(0.7302967433402214) >>> img1.zncc(img2+10) np.float64(0.7302967433402214) >>> img1.zncc(img2*2) np.float64(0.7302967433402214)
Note
The
znccsimilarity measure is invariant to affine changes (offset and scale factor) in image intensity (brightness offset and scale).
- References:
P. Corke, Robotics, Vision & Control for Python, Springer, 2023, Section 11.5.2.
- Seealso: