Monday, October 12, 2009

Activity 19 - Restoration of Blurred Image

Blurring of images can be result of the "spreading effect" caused by the transfer function of the imaging device, such as camera, as it images the object. This transfer function may be internal to the camera, due to its limited resolution. However, an additional factor is upon the capturing of the image. In most cases, motion blur affects the imaging perhaps due to the relative movement of the camera and the scene or object being captured with respect to each other.
The uniform linear motion causing this blurring can help model and provide a basis of removing motion blur in images. From the equation:
where f is the object image, and g is the blurred image, the blurring is attributed to a uniform linear motion along x and y, namely xo(t) and yo(t), respectively, for a given total time T. The total time T corresponds to the total time the camera captures the motion (exposure time). The effective transfer function of the motion blur can be obtained from the previous equation by taking its Fourier transform, and isolating the known form of the Fourier transform of the object image. All the other factors can be considered as the transfer function of the motion blur:
where G and F represents the Fourier transform of the blurred and original image. H is the motion blur transfer function, with xo(t) and yo(t) expressed as at/T and bt/T, respectively. This suggests that the amplitude or extent of the motion blur along x and y is dictated by a and b, respectively.
Motion blur can then be easily removed from an image upon knowing the proper parameters for the transfer function. However, when noise is present, the restoration is not straightforward division of this transfer function from the blurred image. Filtering methods are applied for restoring noisy and motion-blurred iamges. One filter, the Wiener filter, was basically derived such that the mean square error between the original and reconstructed image was minimized. This filter is also called minimum square error filter. The reconstruction is summed up in the equation:

where N is the Fourier transform of the noise. In reality, the noise and the original image cannot be obtained directly, which is why this factor in the equation above is replaced by K:
Optimizing the reconstruction rests on choosing the right value for K.
Using the description of the motion blur model, blurring and addition of Gaussian noise was simulated in this activity. This image was restored using the Wiener filter to determine the effect of certain parameters.
The images below show the original and the blurred image with noise mean and standard deviation at 0.01. The parameters for the blurring is set as a,b=0.01, and T = 1. The degradation is clearly seen in the blurred image.

In restoring the blurred image, K was varied to determine its effect in the reconstruction. The results are shown below
Notice that the decrease in K results into removing the blur of the image, however, it becomes noisy upon further decrease. This is the tradeoff in the adjustment for K, especially if the power of the noise added is very large.
If the added noise is decreased, and the reconstruction used was the Wiener filter with the factors of the noise and the original image (ratio of power spectrum of noise and original image), the reconstruction improves as the noise is lessened. This means that the reconstruction is very sensitive to noise. Notice that the reconstruction of the images below show a better quality since the reconstruction is directly based on the information of the noise and the original image.

This is also verified for varying K, as presented in the set of images below with the noise mean and standard deviation at 0.001. A good reconstruction is already attained K=0.001 unlike the previous results for a stronger noise.

In increasing the amplitude of the blur (a,b = 0.1), the restoration would provide more problems for adjusting the parameters. As seen below, using the noise mean and standard deviation at 0.001, the reconstruction was still undesirable at K=0.0001, in contrast with the results obtained in the previous set of images.
To improve the reconstruction for the larger amplitude of the motion blur, the effect of T was determined. Notice from the set of images below, that a better reconstruction was obtained using a larger value for T, using the same value of K. This would help in the tradeoff between removing noise and removing motion blur upon adjusting K. If the removal of blur is insufficient for a value of K, T may be adjusted.
From the analysis of the effect of different parameters in the restoration, the ideal parameters can be easily determined for restoring a blurred image with noise. This provides an effective way of obtaining quality images, instead of wasting film, memory space or even time from capturing those undesirable blurry images.
For this activity, I would like to give myself a grade of 10 for successfully implementing the motion blur model and the Wiener filter restoration. I think I have also provided a sufficient analysis of the effects of the different parameters.
I would like to thank Dr. Gay Jane Perez for her guidance in this activity.

Reference:
R. Gonzalez, R. Woods, Digital Image Processing, Chapter 5, Prentice Hall, Inc., New Jersey, 2002.

1 comment: