ENEE 631 Homework #3

Daniel Garcia-Romero (dgromero.at.umd.edu)

                                                                                                                                                                                          

 

 

1. Function implementation

 

§         For this homework all the image processing has been done in the RGB color space. Two Matlab functions have been coded to perform image restoration:

 

o       Regularized Pseudo-inverse filter, as introduced in [Lagendijk, 1988]: my_pseudo_inverse_filter.m

o       Wiener filter: my_wiener_filter.m

 

§         A Matlab script with the optimum configuration of each of these two functions, for each original image, has been created:

 

o       Script with the optimum parameters for the original images: script_hw_3.m

 

 

2. Model estimation

 

 

§         In order to restore the degraded images using a pseudo-inverse or Wiener filter, it is necessary to estimate the frequency response of the degradation function H(u,v). There are many different ways to perform this estimation. In this homework we are going to focus on parametric estimation, i.e., assuming a model and estimating the parameters that better represent the data. For the two cases at hand (out of focus blur and motion blur) there are two sound models widely used in the technical literature [Gonzalez, 2002]. Figure 1, shows the frequency responses for these two models:

 

 

 

(a)

(b)

 

(c)

(d)

 

 

 

Figure 1. (a,b) OTF of the out of focus model (disk shaped psf with r=4).

(c,d) OTF of the linear motion blur model (Length of the motion = 23 pixels and angle = 0 degrees).

 

 

 

§         It is interesting to note that the OTF of the out of focus model is almost isotropic, whereas for the motion blur the OTF is highly anisotropic. This is very logical since in the first case the blur is equally spread throughout all the spatial directions, and for the second case the image is only blurred along the horizontal axis.

 

§         The parameter selection has been done experimentally by selecting the values yielding the best visual quality. For the linear motion filter, the angle has been set to 0 degrees and the displacement to L=23 (this is consistent with the black bands appearing on the left and right part of the image whose length is 11 pixels). For the out of focus blur, a disk of radius 4 has produced the best results.

 

 

3. Results

 

 

§         Figure 2 shows the results for the out of focus image. The restored image with the best visual quality, see subfigure (b), was obtained by using a linear combination of the regularized pseudo-inverse filtered image and the degraded image. The mask used for the linear combination is shown in subfigure (e). We used this approach to eliminate the ringing artifacts created in the image boundaries of the restored image due to the regularization error. The Wiener filtered image shows higher ringing artifacts around the sharp intensity transitions of the image than the regularized pseudo-inverse filtered image. The value of the Noise-to-signal ratio was set to 0 since there is no visually perceptual noise added to the image.

 

 

(a)

 

(b)

(c)

 

(d)

 

 

 

(e)

 

 

Figure 2. (a) Original out of focus image. (b) Restored image created as a linear combination of the pseudo-inverse filtered image and the original image. The mask in subfigure (e) was used for the linear combination. (c) Restored image using Regularized Pseudo-inverse filter. (d) Restored image using Wiener filter.

 

 

§         The restored images from Figure 2 are available in the links bellow in (768 x 1024) size:

 

o       (b) Restored image combining pseudo-inverse filtered  image and original image: I_blur_mix.jpg

o       (c) Restored image using regularized pseudo-inverse filter: I_blur_inverse.jpg

o       (d) Restored image using Wiener filter: I_blur_wiener.jpg

 

 

§         Figure 3 shows the results for the motion blur image. The restored image with the best visual quality, see subfigure (c), was obtained by using the regularized pseudo-inverse filter over the “edge tapered” image shown in subfigure (b). The left and right image boundaries were smoothed using a Gaussian filter. This pre-processing was done in order to reduce the ringing artifacts introduced in the restored image around the lateral boundaries (due to the discontinuity generated by the implicit periodic expansion of the DFT). The Wiener filtered image shows higher ringing artifacts around the sharp intensity transitions of the image than the regularized pseudo-inverse filtered image. The value of the Noise-to-signal ratio was set to 0 since there is no visually perceptual noise added to the image.

 

 

(a)

 

(b)

(c)

 

(d)

 

Figure 3. (a) Original motion blur image. (b) Original motion blur image with edges tapered. (c) Restored image using Regularized Pseudo-inverse filter using the edge-tapered image as input. (d) Restored image using Wiener filter (NSR =0) using the edge-tapered image as input.

 

 

 

§         The restored images from Figure 3 are available in the links bellow in (768 x 1024) size:

 

o       (c) Restored image using regularized pseudo-inverse filter: I_motion_inverse.jpg

o       (d) Restored image using Wiener filter: I_motion_wiener.jpg

 

 

4. Conclusions

 

§         Image restoration is, in the most general case, an ill-posed problem that requires regularization in order to obtain a practical solution. As a consequence of this concept, even if we know the exact form of H(u,v) that generated the distorted image version g, the exact original image f cannot be computed.

 

§         The total resulting error of the process consists of two contributions. First, the regularization error that is introduced by the use of a regularized filter H’(u,v) instead of the inverse filter H-1(u,v). Second, the noise magnification error that is due to the ill-posedness of the problem. While it is possible to find a solution that jointly minimizes both types of error, there is a trade of between the final sharpness of the restored image and the noise magnification.

 

§         As a consequence of the regularization error, a visual artifact denoted as “Ringing” (generally known as Gibbs oscillations) is introduced in the restored images. This artifact is strongly related to the local structures encountered within the image, mainly around the image boundaries and the sharp intensity transitions. During the processing of the out of focus image, the ringing artifacts around the sharp intensity transitions were the most problematic. On the other hand, for the motion blur distorted image, the boundary artifacts were more pronounced.

 

 

 

5. Bibliography

 

        [Gonzalez, 2002] R. Gonzalez and R. Woods. Digital Image Processing. Addison-Wesley Pub., 2002.

 

[Lagendijk, 1988] R. Lagendijk, J. Biemond and D. Boekee. Regularized Iterative Image Restoration with Ringing Reduction. IEEE Transactions on Acoustics, Speech and Signal Processing, Vol 36, n. 12, December 1988.