Saturday, October 10, 2009

Act 19: Restoration of blurred image

In this activity, we blur and noise an image, and using the knowledge of the process involved in the degradation of the image, we attempt to restore it.

First, we make use of this image

(source: http://www.misterguitar.us/news/images/tapestry1969.jpg)

We then degrade the image by blurring, which is governed by

where a and b are the total respective x- and y- displacement.
and adding Gaussian noise, using (grand, 'nor' function in Scilab), whose Fourier transform is represented as N(u,v). The degraded image is obtained from the equation

where F(u,v) is the Fourier transform of the original image.

We now try to vary the parameters and see the resulting image. First, we hold T=1, and vary a and b, a=1 b=1, a=0.1 b=0.1, a=0.01 b=0.01, a= 0.001 b=0.001. The resulting respective images are shown below.

It can be seen that as a and b are increased the image becomes less blurred, and the features become discernible once again.

This time we hold a=0.01 b=0.01, and vary T, T=0.001, T=0.01, T=0.1, T=1, T=10, T=1000

It can be seen that the image inverts at small T, while it reverts and approach a certain threshold as T is increased.

Next, we attempt to reconstruct the image using Weiner filtering.

where


Since the power spectrum of the undegraded image is known, we can use this filtering. We make use of the image a=0.01 b=0.01 T=1


Note that the above is only applicable when the power spectrum of the undegraded image is known, i.e. we have the original image at hand. Supposing it is unkown, we can guess a good value by letting the ratio of the power spectra become K, an arbitrary constant. In equation form:

Making use of K=0.1, K=0.0001, K=0.000001, we obtain these images

It can be seen that decreasing K improves the image, thus the ratio of the power spectra must be small.

I will give myself a grade of 10/10 for completing this activity. Again, I would like to thank Earl for the cooperative effort, and Gilbert for showing me that (1.)/ is correct for matrix inversion instead of just 1./.