Monday, June 30, 2008

..on enhancement by histogram manipulation

Below is sample image w/ poor contrast. Our goal is to enhance the image by manipulating its histogram.



www.flickr.com






Original Image

The image was first converted into gray scale. Below is the corresponding probability distribution function(PDF) and the commulative distribution function (CDF) of image.





Original PDF













Original CDF








We now enhance the image by manipulating the original CDF. We do this by getting the T(r) of the CDF corresponding to the value of the pixel. The corresponding T(r) would be the new value of that pixel. We do this for every pixel of the original image. Below are the resulting enhanced images and their corresponding PDF and CDF. The resulting PDF is more "spread" than the original PDF. Also, The resulting CDF is now linear. We could observe that the contrast of the image was improved. The image of the rose petal becomes more distinct.




Resulting PDF













Resulting CDF










Resulting Image








Another Technique

We now apply another technique. In this method, we manipulate the CDF of the original image by "mapping" it on the desired CDF (G(z)). Specifically, we do this by getting the T(r) of the original CDF corresponding to the value of the pixel. We then map T(r) into G(z) and find the corresponding z. Below is an illustration of the "mapping".









We use G(z)=sqrt(z). Below is the original image and the resulting image with the corresponding CDF.



Original Image
theterroristsdictionary.blogspot.com












Original CDF










Desired CDF (G(z)=sqrt(z))









Resulting Image











Resulting CDF






The resulting CDF is verry much like the desired CDF. And we could see that the contrast of the resulting image is enhanced.

I want to give myself a 10. I have done the activity successfully.

Acknowledgment to Julie and Ed for the help.

1 comment:

Jing said...

Impressive result!