Image.__str__#

Image.__str__() str[source][source]#

Summary of image parameters

Returns:

summary of image

Return type:

str

Example:

>>> from machinevisiontoolbox import Image
>>> img = Image.Read('street.png')
>>> print(img)
Image: 1280 x 851 (uint8), 1 anonymous plane [.../images/street.png]
  span=[0, 255]; mean=92.4315, 𝜎=70.3398; median=65
>>> img = Image.Read('flowers1.png')
>>> str(img)
'Image: 640 x 426 (uint8), R:G:B [.../images/flowers1.png]\n  R: span=[0, 255]; mean=103.68, 𝜎=74.3457; median=80\n  G: span=[0, 255]; mean=112.024, 𝜎=50.0397; median=105\n  B: span=[0, 255]; mean=100.686, 𝜎=65.6138; median=85'

The repr method provides a more compact summary of the image parameters, whereas the str method provides a more detailed summary, including statistics about the pixel values.

Seealso:

stats __repr__