Thursday, October 8, 2009

ACTIVITY 18 Noise Modeling and Basic Image Restoration

In this activity, we explored the different types of noise and used the common filters to clean the noisy images. I used Figure 1 as my original image. The noise we introduced on the image are the common types of noise, namely, Gaussian (normal), exponential, gamma, Rayleigh, uniform and impulse (salt& pepper). These noises are described in equations 1 to 6. The resulting noisy images are shown in Figure 2. On the right side of the images are the histogram (PDF) of the noisy images. Given a noisy image with unknown type of noise, one can then determine the type of noise from its PDF. However, it must be noted that the images I am talking here are grayscale images.

Figure 1.

Figure 2.

Equation 1. Gaussian (normal) noise.

Equation 2. Rayleigh noise.


Equation 3. Erlang (gamma) noise.

Equation 4. Exponential noise.

Equation 5. Uniform noise.

Equation 6. Impulse (salt & pepper) noise.


The filters I used are the following: arithmetic mean filter, geometric mean filter, harmonic mean filter and contraharmonic mean filter. Equations 7 to 10 illustrate how these filters work. Figure 3 shows the cleaned images after applying the different filters. As you can see, no filter was able to perfectly restore the noisy images to the original image. For different types of noise introduced, a filter cleans the noisy images differently. Consider the cleaned images when ageometric mean filter was used (3rd row of Figure 3). The image with impulse noise obviously has a different cleaned image as compared to the other noises. Arithmetic mean and geometric mean slightly clean the image but it can be observed that there is partial blurring. Harmonic mean filter has the best result in some images (gamma and exponential) but it also fails to restore some images (normal and uniform). I think this is due to the type of distribution these noises produce. Gamma and exponential have similar PDF, as well as normal and uniform. The cleaned images using contraharmonic filter is shown in Figure 4. Recall equation 10. When Q is +/-, salt(white)/pepper (black) noise is removed. This is why the images is dark/bright when Q is +/-.

Equation 7. Arithmetic mean filter.

Equation 8. Geometric mean filter.

Equation 9. Harmonic mean filter.

Equation 10. Contraharmonic mean filter.

Figure 3. The first row is the set of images with noise incorporated in the following sequence: salt & pepper, exponential, normal (Gaussian), gamma, uniform. In the succeeding rows are the resulting images after applying the arithmetic filter, geometric filter and harmonic filter, respectively.

Figure 4. The first row is the set of images with noise incorporated in the following sequence: salt & pepper, exponential, normal (Gaussian), gamma, uniform. In the succeeding rows are the resulting images after applying the contraharmonic mean filter with Q (-) and Q (+), respectively.

In equations 7 to 10, notice that the computation of the new pixel values is confined in a window of size m x n. I investigated how the cleaning varies for different window sizes. Figure 5 shows the cleaned images. As you can see, more noise is removed when the window size is bigger. However, the images become more blurry also. So, the window size must be properly chosen such that enough noise is removed and the restored image is not so blurry.

Figure 5. The resulting images after applying all the filters with different window sizes
(1st row - 3 x 3, 2nd - 5 x 5, 3rd - 9 x 9) in one of the noisy images.

I also tried applying the filters to the noisy images I downloaded from the internet (see Figure 6). From their PDFs,it can be inferred that the noise is Gaussian. The cleaned images are shown in Figures 7 to 10. As you can see, the restoration is still not perfect. The results are just the same as the cleaning of the images in Figure 2.

Figure 6. PDFs of the images.

Figure 7.

Figure 8.

Figure 9.

Figure 10.

I would give myself a grade of 10 for this activity.

No comments:

Post a Comment