image-processinghistogramcontraststretching

Difference between contrast stretching and histogram equalization


I would like to know the difference between contrast stretching and histogram equalization.

I have tried both using OpenCV and observed the results, but I still have not understood the main differences between the two techniques. Insights would be of much needed help.


Solution

  • Lets Define Contrast first,

    Contrast is a measure of the “range” of an image; i.e. how spread its intensities are. It has many formal definitions one famous is Michelson’s:

    He says contrast = ( Imax - Imin )/( Imax + I min )

    Contrast is strongly tied to an image’s overall visual quality. Ideally, we’d like images to use the entire range of values available to them.

    Contrast Stretching and Histogram Equalisation have the same goal: making the images to use entire range of values available to them. An image that utilizes a full range of intensities (rather than a small subsection of intensities) means we can pick up on more details in the image.image with two different curves, where each curve's x-axis measures intensity from 0 to 255. The top image represents the original image, and the bottom image represents the Stretched image. The top image shows a large number of pixels clustered around a medium intensity (roughly 84-100) with fewer pixels spread out up to intensity 153. There are no pixels with intensities 0 to 83, and 153-255. The bottom image shows a different curve that has pixels with all intensity values, though the number of pixels per intensity value varies.

    But they use different techniques. Contrast Stretching works like mapping.

    This is why Contrast Stretching is un-reliable, if there exist only two pixels have 0 and 255 intensity, it is totally useless.

    A better approach than Contrast Stretching is Histogram Equalisation, which uses probability distribution (PDF). You can learn the steps here