Report 2: Basic Image Manipulation II

This assignment dealt with thresholding and experimentation with histogram equalization methods.

Source Code:

Binary Images

The images below show how binarization can help detect the objects in the image by chosing a proper threshold. The histogram shows the distribution of the 256 intensity levels in the image. By picking an appropriate threshold, one can come up with a binary image showing most of the edges contained in the original image. At lower thresholds, the resultant image is very bright and at higher thresholds, very dark. By picking a threshold close to the center of pixel distribution, a significant percentage of the details contained in the image can be preserved.

Examples of thresholding:


mandrill.pgm (original image)

Threshold = 58

Threshold = 122

Threshold = 174



Histogram Equalization

In most images, the sampled pixels do not utilize the entire range of available intensities (256 in our case). Histogram equalization helps out by stretching the histogram so that the contrast is increased and the image becomes clearer. As seen below, the image lenna.pgm has been significantly enhanced. Local equalization comes into play when there are hidden features in a bright or dark region of the image. By doing histogram equalization on just that area, the hidden features can be made visible to the human eye.


lenna.pgm

Global Equalization

4 subimages

16 subimages



The figures below show the histogram for lenna.pgm before and after global histogram equalization. Notice how the intensities spread out to use the entire spectrum (0 to 255).

Original Histogram

After Equalization



Example of Local Equalization


lax.pgm (original image)

Selected area equalized


Conclusion

Binarization and Histogram Equalization are powerful techniques used when working in the spatial domain. Equalization can improve the quality of the image by enhancing the contrast and making the image more "visible." Binarization can be used as a preprocessor for edge detection and other applications.


Back to Reports