Sunday, July 5, 2009

Activity 4

In this activity we were tasked to change the improve the contrast of a grayscale image by tweaking it such that its CDF is converted to some desired curve. To do this we took the CDF of the original image then matched the pixel values with the same value on the original CDF and desired. We then edited the image such that every pixel with a given pixel value on the original image is replaced with its matched pixel value from the desired CDF. Here are my results:

BEFORE:

original image 250x250 grayscale

original PDF

original CDF

AFTER:

resulting image 250x250 grayscale

resulting PDF

resulting CDF

The resulting image had much better contrast. The details of the petals and the background are now much more easily distinguishable. The resulting CDF is quite close to the desired (linear). The few kinks on th curve are probably a result of the limitations of histograms. Since histogram values are discrete it is possible that some values on the original CDF dont have corresponding values on a desired CDF. I give myself a 9/10 for this activity because I was able to execute the procedure properly yet I believe that there is room for improvement in the method such that the resulting CDF may be exact.

No comments:

Post a Comment