Huwebes, Setyembre 22, 2011

Activity 5 Enhancement by Histogram Manipulation

Histogram Manipulation

A grayscale image’s histogram is the graylevel probability distribution function(PDF) when normalized by the total number of pixels. Manipulating an image’s histogram has been a means of improving its quality. One way to do this is by the method called backprojection. Backprojection is the manipulation of an image’s cumulative distribution function(CDF) to obtain a desired distribution. The CDF  can be obtained by collectively adding up the y values of the PDF for every x.

I chose this dark looking image for this activity.  

Figure 1. A dark image

I loaded it into Scilab and converted it to a grayscale image. Then I obtained the histogram and the CDF of the image.

Figure 2. The converted to a grayscale image  Figure 1

Figure 3. Histogram of Figure 2  

Figure 4. CDF of Figure 2
  Our desired CDF for the first part is linear. It was a line with slope 1.   Below is the code used to obtain the resulting image.   
Figure 5. Desired linear CDF



  

  

Figure 6. Resulting image after Histogram Manipulation with a desired linear CDF

Figure 7. The histogram of figure 6
Figure 8. Histogram of Figure 6.

Notice that the resulting iimage become brighter, but some of the information was lost. Also we can see that the CDF of the image is very similar to our desired CDF.  
The second part our desired CDF was something non-linear like a normal distribution for the histogram. Here is the resulting image and the histograms.    

Figure 9.   . Resulting image after Histogram Manipulation with a desired non-linear CDF  


Figure 10. Histogram of Figure 9




Figure 11. CDF of  Figure 9





Notice that the histogram resembles a normal distribution. The resulting imae though is too bright and the image was not really enhanced well.
The next thing I did was load the image in figure 1 to an image editing software called GIMP. I converted it to a grayscale image then go to Colors and choose Curves. HEre you can easily manipulate the histogram of the image. A snapshot of GIMP software in use is shown below.





I would give myself a grade of 7//10 for posting it this late. Actually I hit a mental block here and the activity on image segmentation helped me finish this.

References:

2. Soriano M. Enhancement by Histogram Manipulation AP 186 2011

Walang komento:

Mag-post ng isang Komento