Image.ssd#
- Image.ssd(image2: Any) float[source]#
Sum of squared differences
- Parameters:
image2 (
Image) – second image- Raises:
ValueError – image2 shape is not equal to self
- Returns:
sum of squared differences
- Return type:
scalar
Returns a simple image disimilarity measure which is the sum of the squared differences between the image and
image2. The result is a scalar and a value of 0 indicates identical pixel patterns and is increasingly positive as image dissimilarity increases.Example:
>>> from machinevisiontoolbox import Image >>> img1 = Image([[10, 11], [12, 13]]) >>> img2 = Image([[10, 11], [10, 13]]) >>> img1.ssd(img2) np.uint64(4) >>> img1.ssd(img2+10) np.uint64(364) >>> img1.ssd(img2*2) np.uint64(454)
Note
Not invariant to pixel value scale or offset.
- References:
P. Corke, Robotics, Vision & Control for Python, Springer, 2023, Section 11.5.2.
- Seealso: