Histograms are used to depict image statistics in an easily interpreted visual format. With a histogram, it is easy to determine certain types of problems in your image.

What Is a Histogram?
Histogram is a frequency distribution of pixel values. Histograms of images describe the frequency of the intensity values that occur in an image.
In general grayscale image, a histogram is the number of pixels in image with the intensity value in the range 0,1,2,…,255, where for a typical 8 bit grayscale image. Therefore the histogram of the intensity value 0 is the number of all black pixels with the value 0. Finally, the histogram of the intensity value 255 is the number of all white pixels with the maximum intensity value 255.
Histograms contain no information about the spatial arrangement of pixels in the image. These images would appear different but have exactly the same histogram.
Three very different images with coincidental histograms.
You can try in coding the any image histogram with this example programming guideline as shown in this link:

Image Acquisition
Exposure: The brightness that occur in the period during the image acquisition. Histograms make classic exposure problems readily apparent. Exposure errors are readily provided in histograms.
Underexposed (a), properly exposed (b), overexposed (c)
Contrast: Contrast provides the range of intensity values that define the difference between the image’s maximum and minimum pixel values.
low contrast (a), normal contrast (b), high contrast (c)
Dynamic range: The dynamic range of an image provides the number of distinct pixel values in an image.
high dynamic range (a), low dynamic range (b), extremely low dynamic range (c)
Image Defects
Histograms can be applied to detect a wide range of image defects either during image acquisition or as the result of later image processing.
Saturation: The illumination outside of the sensor’s contrast range cannot be captured any highlights and dark parts of the scene. The result is a histogram that is saturated at one or both ends of its range.
Spikes: Decreasing the contrast causes histogram lines to squeeze together and spikes are created in the histogram.
Gaps: Increasing the contrast causes the histogram lines to separate from each other and gaps are created in the histogram.
saturation of high intensities (a), histogram gaps caused by increase contrast (b), histogram spikes caused by decrease contrast (c).
Reference
Principles of digital image processing, Fundamental techniques, Wilhelm Burger Mark J. Burg
Leave a comment