Image statistics
The image is characterised by a probability density function (PDF). The PDF f describes the probability of the occurrence of a discrete grey level q in the range of grey levels Q.
latex error! exitcode was 2 (signal 0), transscript follows:
Example
The following code calculates the PDF pdf for a byte image img in the intervall [0,255]
The expression normed=True is used for the normalization of the PDF.
latex error! exitcode was 2 (signal 0), transscript follows:
The anti-derivative of the PDF is the cumulative density function (CDF). It can be approximated from the cumulative sum
1 cdf=pdf.cumsum()