A19: Restoration of blurred images

In this activity, we attempt to restore an image f(x,y) that has been affected by a degradation function for motion blur h(u,v) and additive noise n(u,v) represented. The following equation shows the expression for the blurred image: .


Figure 1.

The degradation function acts on the image via convolution and plus some common noise (Activity 18). As in many activities before, we simplify things by looking at the frequency domain instead so that the convolution becomes simple multiplication. If we assume that no additive noise is present, we find that the degradation function for motion blur is: .

To restore the image, we apply a Weiner filter:

where K is some constant. So from spatial restoration in Activity 18, we now attempt frequency restoration.

Figure 2 shows the results of attempts at restoration from different noise types and at different K values. Images we flipped, as expected, from FFT. We find that restoration is better for smaller K. The small text on the image is still not readable at K=1x10-3. It becomes readable at around K=1x10-5. At around K=1x10-10 some increase in contrast and quality but others start to lose these.
Noise
K = 1E-3
K = 1E-5
K = 1E-10
No noise



Gaussian



Rayleigh



Gamma



Exponential



Uniform



Impulse





I give myself a grade of 9 because restorations were pretty near the original image.

I would like to thank Ms. Kaye Vergel for very useful discussions. :)

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.