Histogram.cdf#

property Histogram.cdf: ndarray[source]#

Cumulative distribution function

Returns:

array of normalized cumulative histogram count values

Return type:

ndarray(N) or ndarray(N,P)

The cdf is the cumulative frequency normalized to the range 0 to 1. This is computed by dividing the cumulative frequency by the total number of pixels in each plane.

For a greyscale image this is a 1D array, for a multiplane (color) image this is a 2D array with the normalized cumulative 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.cdf
array([[0.0014, 0.    , 0.002 ],
       [0.003 , 0.    , 0.0042],
       [0.0051, 0.    , 0.0064],
       ...,
       [0.978 , 0.9882, 0.9881],
       [0.9827, 0.9894, 0.9899],
       [1.    , 1.    , 1.    ]], shape=(256, 3))

Changed in version 2.0.0: In earlier releases this method was named ncdf.

Seealso:

h pdf cf