Use the equalize function to perform a histogram equalization. Equalization can be used as an advanced form of level mapping to enhance features of a picture, or to use a particular display device more efficiently.
1. Read in an image and plot the following histogram.
This image is very dark. You can spread the intensities over a larger portion of the available spectrum.
2. Define the cumulative histogram by the difference equation for CK.
3. Linearize the cumulative histogram.
4. Plot the new image histogram.
5. Plot the cumulative histogram of the equalized image.
6. Compare the original and equalized images.
(arcs.bmp)
(arcs_eq.bmp)
The equalized image contains details that are not visible in the original image.
The above technique can be used in the following situations:
• The image contains mainly highlights and insufficient shadows.
• The full dynamic range of the image is not used. For example, the image contains large gaps where no intensities are used.
Some highlights or shadows can become over exaggerated in equalized photographic images due to the sensitivity of the human eye and PC monitor. You can perform level mapping and attempt to correct the problem.
Scaling and clipping are other useful techniques for adjusting the dynamic range of an image. You can use these techniques only for images with intensity spectrum that is narrower than 0 to 255. Equalization can be used even when intensity levels 0 and 255 are present.