machinevisiontoolbox.Image.A
- property Image.A
Set/get the NumPy array containing pixel values
Getting
- 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.
Setting
Replace the encapsulated NumPy array with another.
Example:
>>> from machinevisiontoolbox import Image >>> import numpy as np >>> 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.A) <class 'numpy.ndarray'> >>> img.A = np.zeros((50,50)) >>> img Image: 50 x 50 (float64) [.../images/flowers1.png]
- Seealso: