Histogram.h#

property Histogram.h: ndarray[source]#

Histogram count values

Returns:

array of histogram count values

Return type:

ndarray(N) or ndarray(N,P)

This is the raw histogram count, which is the number of pixels in the image plane with grey values equal to the index of the bin.

For a greyscale image this is a 1D array, for a multiplane (color) image this is a 2D array with the histograms of each plane as columns.

Example:

>>> from machinevisiontoolbox import Image
>>> import numpy as np
>>> hist = Image.Read('flowers1.png').hist()
>>> with np.printoptions(threshold=10):
...     hist.h
array([[ 388,    2,  546],
       [ 443,    2,  596],
       [ 555,    2,  610],
       ...,
       [1003,  186,  407],
       [1284,  324,  487],
       [4705, 2880, 2762]], shape=(256, 3))
Seealso:

pdf cf cdf