Sunday, October 11, 2009

Activity 18: Noise Model and Basic Image Restoration

Introduction
The objective of this activity is to restore images with noise using different restoration methods.

Methodology
First a test image is deliberately added with noise. The noise added have different probability distributions, namely

Gaussian

Rayleigh
Gamma
Exponential
Uniform
Salt & Pepper


To restore the images, mean filters are used. In this activity we used four filters. To get the pixel value of the restored image G at some pixel coordinate (x,y), we define an area S with dimension m x n enclosing (x,y) where we can compute for the mean. To compute for the mean, we used the following equations.

Arithmetic mean filter
Geometric mean filter
Harmonic mean filter
Contraharmonic mean filter, where Q can be positive or negative

For the test image, we used the image below.


Figure 1. Left: Test image. Right: Its corresponding PDF.

Results
Upon the addition of noise, we obtained the following images together with their PDFs. (click to enlarge)


Figure 2. Test image with noise added.

As evident in figure 2, upon addition of noise, the PDF of the original image takes the form of the distribution of the noise.

The following are the restored images. (click to enlarge) Here, we used a 3x3 area to compute the mean. Although not shown, the method is also tested for a 5x5 area. Using large area will result in a more blurred reconstruction.


Figure 3. Image restoration for image with Exponential noise.


Figure 4. Image restoration for image with Gamma noise.


Figure 5. Image restoration for image with Gaussian noise.


Figure 6. Image restoration for image with Rayleigh noise.


Figure 7. Image restoration for image with Salt & Pepper noise.


Figure 8. Image restoration for image with Uniform noise.

To check the quality of restoration, we should look back to the PDF of the original image. From our results, the image is much restored except for the exponential noise wherein all of methods fail. Notice that the white part of the original image is not recovered. Also notice that at the addition of noise, the exponential noise resulted in an almost unrecognizable image. The distribution is bias to black (i.e. close to zero grayvalues).

Salt & pepper noise is also another stubborn noise. Only the arithmetic filter shows satisfactory result. It is also observed that at positive Q, pepper noise is removed however white spots remain (i.e. salt noise). The effect is reversed for negative Q.

It is also observed the restored image have shifted PDFs in comparison with the original PDF. This is probably due to the averaging method used by the filter. To get an average of 1 or 255 (i.e. white) the area used must contain only white values which is impossible due to the presence of noise.

For this activity, I'll give myself a 10 for completing the activity together with the analysis and for having cute plots ^_^

Thanks to Gilbert Gubatan et al. for sharing the MODNUM toolbox for the Rayleigh noise.

1 comment: