In image restoration, the objective is to recover the original image f(x,y) from the observed image g(x,y) with an a priori knowledge of the degradation process h(x,y) and the noise n(x,y) added on the image. This kind of modeling is shown in the figure below.
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh6MjwXNBPEZ_YFKceg87MJ2djF3ttpsGr8bMeVkK3jkF7RehKexH2Vha8Ru5Zpy91SYYyhhzC8FjBe2DtXZz6CL6U4_g6IwSOP2QFbl68L48f2VeeJG0BX2IFOdGD1nScaTVgD45W0kCk/s400/noiserestore.png)
FIG 1: Image degradation and restoration model. The original image f(x,y) undergoes degradation by a known process h(x,y) and added with noise n(x,y) leading th the observed image g(x,y). With the use of restoration filters, image restoration aims to recover f(x,y). [1]
In this activity, we only cover half of the image restoration modelling by adding a known noise n(x,y) to the image and performing restoration algorithm to recover the original image. The strength and properties of the noise n(x,y) can be characterized from its probability distribution function PDF shown below for different noise models.
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiHEyspDgn2H_jUI6hyphenhyphen-L0aYvceGQwafBxCw-FhpLO8968yY2eiIYMOrvU8daj3OPXaNj28z9UHrfeaxK9zONn2HQYXVgCgp19ulbfbEHSu2Esi7VRK1d7rS3_XTS6HnBIEUZchg-ypl_o/s400/PDF_nopise.png)
FIG 2: PDF of the different noise models used characterized by its mean and variance. (click to zoom)
The different noise models were generated using scilab's builtin grand and imnoise function. The Rayleigh noise was generated using a module modnum downloaded from [2] while the other noise were generated using grand and imnoise (see scilabs documentation for more detail on these functions). Below is the resulting image after adding different noise to a test image.
Restoring in the presence of noise
Below are the different noise-reduction filters used when only noise is added to the image [1].
Consider a window, i.e., 3x3 window, we perform the 'mean filtering' on this window. For each pixel in the noisy image g(x,y), we choose a window and perform mean filtering for that pixel. This was done for all the pixels in the images. In order for the algorithm to be effective around the boundaries, the image was tiled in the manner below:
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiKYsyUSk9Tm9w6ezyyvwcLaoYtPFS_V5iYaXiasQrSodJVu2F9b8ONbkrTQZLUcJF-oUBjv1LIhA3kql9tZIMfrnfKkRnrCGQDSoNwHTlrsfJtAQ8cj9ECvOYPd8WZzmUONDMdwH1GIok/s400/tile.png)
FIG 5: Tiled image to wrap the boundary conditions. The red window represents the area where the spatial noise filtering was applied.
The following pictures below show the result of the restoration process using the different mean filtering methods in FIG 4 for each noise model. The window used is 5x5 and the restoration for the contraharmoic was divided into two depending on the value of Q, {Q=2 & Q=-2}.
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiT5tIXDEqAcy588Np-dzfUBB4CzmjiEudSUgqh0U5wc7qNfpf1JCgE8TP8FO-wLtBSKhp2zdoJUQwRLzwFOO2cpgairnldE-2akmVG6rLKCRKqKxSH1MP6OnM20_nj3IDhgMlLFH7wYP0/s400/Gaussian.png)
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh74YNJW_ZEAymUMKDO0X7HfMWoQexoSkI60qhFDF2sZmJRDjZA_tF-TDGG9TkifT7wf2AkuxaHoNycIze3ViB92qzDj9WEG4CIrQK22Bt6JbfSTujCZTY-6uQhYxvcVlzNUkdML-ywg4M/s400/Rayleigh.png)
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjfUBpeRaKaXfHQctKON2KUqjOqkjcPLGbkK-aIfBOTnQij4IwBZBAwgHgS-4qEj-ICnPV7HeiJnkKmPvNwAV97_KRARsOsAsfMbCQ2ppRTqJAAjpllZfrhg_GGEtk260isKhtOqhJOy9g/s400/Gamma.png)
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjZnwM0YvFde5x4-7MxVs3T3An6TvlZu3QRLOkYNpPkzcC3MdHz9jOprMvecwB3QrCslpSzSoHpbC5pqv3Qw9uJzHTqKVlPQa00pbJvOUV-4AjRA90f1qIcQfNUVsw-Wm60eHju5YFVfGw/s400/exponential.png)
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh480MZ8AY8Yh0_9JBiDD1tXnnQ9kowCjKgbCtt4r4cwtipg159y4oLnMLZwoH7MgWzlw39cw7EKFqG1Z4HK58c6_z2JgxecMTUNOdOoJ7BmUGVMH-GqpArLOXE3ddAj8kYHWXP1qGTr5A/s400/Uniform.png)
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhSewWoH881tju0J_CoYoUDIHgQxSlrr6eyYpBttX6GkyWHYHU-rX08l6IAObslTyX5pY5VR7VDWTIVSvy-tpxqaEPBwDdUCVkv_Yfn0nTJpHNi-AOagnmXV2pc4YaM8NZK5fj8cKWlP1g/s400/salt&pepper.png)
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhadD0YceXX21AlSoBBF5DL3wPdlJNKEv3ZDPqFp_xtoKkoCGdZBeClH1eDSuC7EnYfo2NStLTriQHJBCKrywE1yPyuZuz_JHMBQSyOUROqpm-rcDCr3_Yr5RvbObtt0dGceZmNWEUpLtw/s400/lock_jay.jpg)
Applying this restoration to a grayscale image (obtained from my brother's picture collection), we perform the same method, adding a known noise term to the image and restoring the image using the mean filters of FIG 4.
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhfQD-pOzbSgqA2Ep5bVsIgFIqqa0fEN7sy6uU9JeRelUJ-4iq8JUNcr4EmmkDuIBKmkSJxbiVvc8wYiQqECdHYqJs_PbTv48Fsu2C6-lYM3dN0hJH1nKdJC1FPzzcJMHHnijYNEPrTGFU/s400/gaussian_image.png)
FIG 13: Grayscale image added with Gaussian noise with the corresponding restorations.
In general, geometric and arithemetic filtering work for all kinds of noise models presented. In particular, the author recommends geometric mean as it seems to be flexible and suitable enough for all noise models studied above.
In this activity, I give myself a grade of 10 for performing the restoration and doing all the required activities.
Acknowledgement
I would like to acknowledge Gilbert Gubatan for providing the downloaded modnum module for generating Rayleigh noise and my brother for lending one of his collection pictures.
[1] Image Restoration. fromhttp://www.ph.tn.tudelft.nl/~
[2] http://www.scicos.org/ScicosModNum/modnum_web/src/modnum_421/interf/scicoslab/help/eng/htm/rayleigh_sim.htm