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

landsat_b80.png

The following code calculates the PDF pdf for a byte image img in the intervall [0,255]

   1 h=histogram(img,bins=256,range=[0,255],normed=True)
   2 pdf,x=h[0],h[1]

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()

landsat_b80_pdfcdf.png