Image.sameas#
- Image.sameas(other, colororder: bool = True) bool[source][source]#
Compare two images for exact equality and return a scalar bool.
- Parameters:
other (
Image) – image to compare againstcolororder (bool, optional) – compare
colororder_strvalues ifTrue, defaults toTrue
- Returns:
exact image equality test
- Return type:
bool
Unlike
==, which returns an element-wise boolean Image, this method returnsTrueonly if:otheris anImageimage shape is identical
image dtype is identical
color order is identical (if
colororderisTrue)all pixel values are identical
Example:
>>> from machinevisiontoolbox import Image >>> a = Image([[1, 2], [3, 4]]) >>> b = Image([[1, 2], [3, 4]]) >>> a.sameas(b) True >>> True True