A18: Noise models and basic image restoration

In this activity, we demonstrate the effects of common noise models on images and attempt restoration by spatial filtering using different filters.

Different noise types were generated using Scilab's built-in functions grand and imnoise and genrayl from the modnum toolbox. Figure 2 summarizes the effects of different additive noise types on the image shown in Figure 1, which is composed of three pixel values (0,0.5, and 1). To check, we also show the distribution for each noise. We find that these are expected (expected PDFs).


Figure 1.

Gaussian


Rayleigh


Gamma


Exponential


Uniform


Impulse


Figure 2.

In image restoration, we use simple mean filtering. We scan the image with an mxn window g(s,t) and the pixel value of the window's center pixel f(x,y) is calculated from all the pixels within the window. We use four kinds of filters:
  1. Arithmetic mean
  2. Geometric mean
  3. Harmonic mean
  4. Contraharmonic mean

Results of restoration

Arithmetic mean

Since this applies simple averaging, we find graying of most noise points.

Noise
raw image with noise
3x3
7x7
Gaussian



Rayleigh



Gamma



Exponential



Uniform



Impulse



Figure 3.

Geometric mean
Because it's the product of pixel values, once a black pixel is present, the central pixel value is automatically zero. Hence, the geometric mean filter is good for restoring images with lots of dark features.

Noise
raw image with noise
3x3
7x7
Gaussian



Rayleigh



Gamma



Exponential



Uniform



Impulse



Figure 4.

Harmonic mean
This filter is good at removing white or near-white pixel noise.

Noise
raw image with noise
3x3
7x7
Gaussian



Rayleigh



Gamma



Exponential



Uniform



Impulse



Figure 5.

Contraharmonic mean
This filter is good at removing white or near-white noise pixels when P<0 and good at removing black or near-black noise pixels when P>0.

Noise
P
raw image with noise
3x3
7x7
Gaussian
-0.5




0.5




1



Rayleigh
-0.5




0.5




1



Gamma
-0.5




0.5




1



Exponential
-0.5




0.5




1



Uniform
-0.5




0.5




1



Impulse
-0.5




0.5




1



Figure 6.




Figure 7.

As expected, for all noise and filter types, images appear more blurry with increase in window size. And using non-square windows result to more blurring along the axis with larger window length (Figure 8). One thing we need to note in this spatial restoration technique is that it is important that the original image does not have very small features (smaller than the window used) that may be neglected in the averaging process.


Figure 8. Left: 7x21 window. Right: 21x7 window.

Arithmetic mean filtering does better in most most (4/6) noise types for the larger window size while harmonic mean filtering does better (2/6) for the smaller window size based on their restorations' structural content C or relative sharpness. Arithmetic, geometric, and harmonic mean filters produced restorations with better fidelity F or general similarity with respect to the original image. The contra-harmonic mean filter does better in 5 of the 6 noise types when it comes to the correlation quality Q or the alignment of features. (Monterola et. al.)

Table 1.


I give myself a grade of 9 for being able to demonstrate all the different noise types and being able to show the different filters that may be used for restoration in the presence of additive noise.

I would like to thank Ms. Kaye Vergel and Mr. Janno Vergara for sharing the function for generating rayleigh noise on Scilab. I also thank Mr. Jay Samuel Combinido and Mr. Luis Buno III for useful discussions.


0 comments:

Post a Comment