machinevisiontoolbox.Image.image

property Image.image

Image as NumPy array

Returns:

image as a NumPy array

Return type:

ndarray(H,W) or ndarray(H,W,3)

Return a reference to the encapsulated NumPy array that holds the pixel values.

Example:

>>> from machinevisiontoolbox import Image
>>> img = Image.Read('flowers1.png')
>>> img
Image: 640 x 426 (uint8), R:G:B [.../images/flowers1.png]
>>> type(img)
<class 'machinevisiontoolbox.ImageCore.Image'>
>>> type(img.image)
<class 'numpy.ndarray'>
Note:

For a color image the color plane order is given by the colororder dictionary.

Seealso:

A colororder