We define the contrast of a digital image as follows:
Cip = (Limax - Limin)/Domain
where Limax is the maximum and Limin is the minimum lightness in the image and Domain is the domain of the lightness or maximum possible value of the difference Limax - Limin.
The contrast measure just defined obviously depends on the lightness of a single pixel. To get a more robust measure it is necessary to know the frequencies of the lightness values: A value occurring in a small number of pixels is not important. The frequencies are contained in the histogram of the image. ...