Sunday, July 5, 2009

Activity 4:Enhancement by Histogram Manipulation





Objective: To manipulate images via their corresponding histogram and to enhance images by altering the gray levels as indicated by the histograms.

Tools: Scilab with SIP toolbox.

Procedure: The first order of business is to convert a colored image into grayscale or find a low contrast grayscale image. In this case we use an image of the M17 Nebula taken by the Hubble Space Telescope from the site:
http://www1.cs.columbia.edu/~johnc/ta_page/6998s07/
schedule/proj1/proj1.html

We then take the histogram of this, as in the previous activity, by finding and counting the number of pixels which have a specific grayscale value and plotting these against the actual values. This yields a histogram like this:

We then take another function related to the histogram
called the CDF. This is essentially the cumulative sum
of the histogrm at each grayscale value. This is found simply by using the cumsum() function in Scilab. The CDF of the image above looks like:



In order to enhance the image the idealized CDF for thi
s is a straight, increasing line. Thus after generating such a f
unction, we use projection to replace the grayscale values in the original image with the grayscale values of the y-axis equivalents. This effectively replaces the grayscale values which cause the CDF to deviate from the ideal. The net effect, at least in theory is an increase in the contrast between light and dark regions. However as shown by the new, enhanced image below, the contrast does not change too drastically.
But if we look at the histogram and the CDF of this new image, we see that the new CDF is already ideal:
Additionally, we present other examples of images enhanced using respectively:


No comments:

Post a Comment

Followers