Image.mean#
- Image.mean(**kwargs: Any) generic | ndarray[source]#
Mean value of all pixels
- Parameters:
kwargs (dict) – additional keyword arguments passed to
numpy.nanmean- Returns:
mean value
Example:
>>> from machinevisiontoolbox import Image >>> img = Image.Read('flowers1.png') >>> img.mean() # mean over all planes np.float64(105.4632164514867) >>> img.mean(axis=(0,1)) # per-plane mean array([103.68 , 112.0241, 100.6856])
Note
The return value type is the same as the image type.
NaN values are ignored
For
axisremember the axes are in NumPy order: 0=rows, 1=columns, 2=planes.