Tuesday, June 30, 2009

Activity 4: Enhancement by Histogram Manipulation

In this activity we were able to enhance images through histogram manipulation. The steps in doing this are as as follows:

1. The normalized histogram of the image is determined. This was done with the help of the find command in Scilab.
2. From the obtained counts per grayscale value, the cumulative distribution probability (CDF) of the image is also determined.
3. A desired CDF is plotted. This is user-defined but for the purpose of this activity linear and logarithmic CDF were used.
4. Pixel per pixel, the grayscale values of the image are replaced by the corresponding grayscale value of the desired CDF with y values equal to the y values of the image's CDF. This is illustrated by figure 1.


This is the original image that was enhanced.

www.crestock.com/uploads/blog/b%26w-tutorial/street-havana-grayscale.jpg

Image Histogram

From the obtained image histogram, it was seen that the minimum grayscale value is 5 while the maximum is 255.
CDF

The figure shows the obtained normalized CDF. As can be observed from the figure the CDF is increasing. However it's increase is not linear.

The image above shows the desired CDF which is a linear plot ranging from 0 to 1. Using this desired CDF, backprojection is implemented and resulted to the enhanced image.The histogram and CDF of this enhanced image is as follows. Applying histogram equalization resulted to a more contrast image. It can be observed when the histogram of the enhanced image is compared to that of the original that the histogram of the enhanced is a strecthed version of the original. As can be seen the length of the grayscale values where peaks occured widened. This is in accordance to the desired CDF. In addition, it can be observed that the calculated CDF for the enhanced image follows the plot of the desired CDF. This is expected since backprojection is a pixel per pixel mapping of CDFs.

This same process were applied to the image below.


original image
http://gallery.photo.net/photo/5476781-md.jpgenhanced image

The shown enhancements are for linear CDF. The human eye however has a non-linear response and is similar to a logarithmic plot. Using logarithmic plot as the desired CDF resulted to the following enhanced images.As can be seen the enhanced images of a desired logarithmic CDF became darker as compared to that of the original.

For this activity I give myself a grade of 9 for I was able to enhance the images through histogram manipulation.

I thank Cherry Palomero, Irene Crisologo and Jaziel Vitug for discussing the activity with me.













No comments:

Post a Comment