0% found this document useful (0 votes)
74 views

Analysis and Comparison On Image Restoration Algorithms Using Matlab IJERTV2IS120564 PDF

This document summarizes and compares different image restoration algorithms using MATLAB. It discusses various types of blur and noise models that degrade images, including Gaussian, salt and pepper, and speckle noise. The objectives are to find an accurate restoration algorithm, investigate the strengths and limitations of different algorithms like Wiener filter, regularized filter, and Lucy-Richardson method, and generate estimates of original images prior to degradation. The paper focuses on analyzing and comparing these restoration methods by applying them to an image degraded by motion blur and different noise models.

Uploaded by

abhishek panda
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
74 views

Analysis and Comparison On Image Restoration Algorithms Using Matlab IJERTV2IS120564 PDF

This document summarizes and compares different image restoration algorithms using MATLAB. It discusses various types of blur and noise models that degrade images, including Gaussian, salt and pepper, and speckle noise. The objectives are to find an accurate restoration algorithm, investigate the strengths and limitations of different algorithms like Wiener filter, regularized filter, and Lucy-Richardson method, and generate estimates of original images prior to degradation. The paper focuses on analyzing and comparing these restoration methods by applying them to an image degraded by motion blur and different noise models.

Uploaded by

abhishek panda
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 11

International Journal of Engineering Research & Technology (IJERT)

ISSN: 2278-0181
Vol. 2 Issue 12, December - 2013

Analysis and Comparison on Image Restoration Algorithms Using


MATLAB

Admore Gota
School of Electronics Engineering, Tianjin University of Technology and Education (TUTE),
Tianjin P.R China.

Zhang Jian Min


School of Electronics Engineering, Tianjin University of Technology and Education (TUTE),
Tianjin P.R China.

Abstract
However, due to imperfections in the imaging and
capturing process, the recorded image invariably
TheImage restoration is the recovery of an represents a degraded version of the original scene.
image that has been degraded by blur and noise. The undoingof these imperfections is crucial to
Degradation typically involves blurring of the many of the subsequent image processing tasks. A
original image and corruption noise. The recovery wide range of degradations such as noise,
of an original image from degraded observations is geometrical degradations, illumination and color
RT
of paramount importance and can find its imperfections and blur. This paper concentrates on
application in several scientific areas including basic methods for removing blur and noise, in this
medical and diagnostics, military case Gaussian, Salt and Pepper and Speckle noise
surveillance,satellite and astronomical imaging, from recorded and spatially images.
IJE

remote sensing, authentication automated industry


inspection and many areas. Image restoration The field of image restoration which is sometimes
assures good insights of image when it is subjected referred to as image deblurring or image
to further techniques of image processing. deconvolution is concerned with the reconstruction
or estimation of uncorrupted image from blurred
Presentation of the results and comparisons of the and noisy one. Image restoration is associated with
restoration algorithms namely Weiner Filter, the minimizing or even removing artifacts due to
Regularized filter and Lucy-Richardson as blurring and noise. Blurring which is a linear form
implemented in Matlab. This is done using an of degradation can occur due to camera
image that is degraded by motion blur with defocussing or due to motion. This project
Gaussian, Salt and Pepper and Speckle noise concentrates on the Analysis and Comparison of
models respectively and restoration of same image methods of image restoration algorithms.
using various algorithms mentioned above. Image
restoration algorithms, distinguish themselves from
enhancement methods in that they are based on 2. The Objectives of the project are:
models for degrading process and for the ideal  To find out a suitable highly accurate
image. The image restoration methods in this paper restoration algorithm to filter and remove
fall under the class of linear spatially invariant the degradation on an image using Matlab
restoration filters. Degradation typically involves simulation.
blurring of the original image and corruption  To investigate the strength and limitations
noise. of each image restoration algorithm.
 To find a suitable algorithm with high
1. Introduction performance of filtering and doing a great
job of restoring the image.
 To generate an estimate of the original
Visual information transmitted in the form of
image prior to the degradation.
digital images is becoming a major method of
communication in the modern age. Images are
produced to record or display useful information.

IJERTV2IS120564 www.ijert.org 1350


International Journal of Engineering Research & Technology (IJERT)
ISSN: 2278-0181
Vol. 2 Issue 12, December - 2013

3. Blur Models multiplicative in nature. Noise is present in an


image either in an additive or multiplicative form.
In most cases the blurring of images is a spatially
continuous process. Since identification and A.Gaussian Noise
restoration algorithms are always based on spatially
discrete images, we present the blur models in their Its evenly distributed over the signal. This means
continuous forms. The imperfections in the image that each pixel in the noisy image is the sum of the
formation process are modelled as passive true pixel value and a random Gaussian distributed
operations on the data that is no energy is absorbed noise value. As the name indicates, this type of
or generated. Following is the presentation of four noise has Gaussian distribution, which has a bell-
common point-spread functions, which are shaped probability distribution function given by,
encountered regularly in practical situations of
interest.

A.No Blur

In case the recorded image is imaged perfectly, no


blur will be apparent in the discrete image.
Where g represents the gray level is the mean or
B.Linear motion blur average of the function, and 𝜎 𝑖𝑠 the standard
deviation of the noise. Graphically it is represented
Many types of motion blur can be distinguished all as shown in Figure 1.When introduced into an
of which are due to relative motion between the image, Gaussian noise with zero mean and variance
recording device and the scene. This can be in the as 0.05 would look as in figure 2a. Figure 2b
form of a translation, a rotation, a sudden change of illustrates the Gaussian noise with mean (variance)
scale. Here only the important case of a global as 1.5 (10) over a base image.
RT
translation will be considered.

C.Uniform Out of focus blur


IJE

When a camera images a 3-D scene onto a 2-D


imaging plane, some parts of the scene are in focus
while other parts are not. If the aperture of the
camera is circular, the image of any point source is
a small disk, known as the circle of confusion
(COC).

D.Atmospheric turbulence blur

Atmospheric turbulence is a severe limitation in


remote sensing. Although the blur introduced by
atmospheric turbulence depends on a variety of Figure 1.Gaussian Distribution
factors such as temperature, wind speed and
exposure time, for long-term exposures the point
spread function can be described reasonably well
by a Gaussian function.

4. Noise Models

The noise commonly present in an image. Note that


noise is undesired information that contaminates
the image. In the image de-noising process,
information about the type of noise present in the
original image plays a significant role. Typical
images are corrupted with noise modelled with
either a Gaussian, or salt and pepper distribution.
Another typical noise is a speckle noise, which is

IJERTV2IS120564 www.ijert.org 1351


International Journal of Engineering Research & Technology (IJERT)
ISSN: 2278-0181
Vol. 2 Issue 12, December - 2013

(a) (mean=0, variance =0.05)

(b) (mean=1.5, variance=10) C. Speckle Noise

Figure 2: Image degraded by Gaussian noise Is a multiplicative noise. This type of noise occurs
with different mean and variance values in almost all coherent imaging systems such
aslaser, acousticsand SAR (Synthetic Aperture
Radar) imaginery. The source of this noise is
attributed to random interference between the
B. Salt and Pepper Noise
coherent returns. Fully developed speckle noise has
the characteristic of multiplicative noise. Speckle
Is an impulse type of noise, which is also referred noise follows a gamma distribution and is given as
to as intensity spikes. This is caused generally due
RT
to errors in data transmission. It has only two
possible values, a and b. The probability of each is
typically less than 0.1. The corrupted pixels are set
IJE

alternatively to the minimum or to the maximum


value, giving the image a salt and pepper like
appearance. Unaffected pixels remain unchanged.
For an 8-bit image, the typical value for pepper
noise is 0 and for salt noise 255.The salt and pepper
noise is generally caused by malfunctioning of
pixel elements in the camera sensors, faulty The where variance is a2α andgis the gray level.
memory locations, or timing errors in the The gamma distribution is given below in Figure 5.
digitization process. The probability density While the speckle noise (with variance 0.05) on an
function for this type of noise is shown in Figure 3. image looks as shown in Figure 6.
Salt and pepper noise with a variance of 0.05 is
shown in Figure 4.

Figure 3: PDF for Salt and Pepper noise.


Figure 5: Gamma Distribution.

IJERTV2IS120564 www.ijert.org 1352


International Journal of Engineering Research & Technology (IJERT)
ISSN: 2278-0181
Vol. 2 Issue 12, December - 2013

filtering is the optimal tradeoff of inverse filtering


and noise smoothing, in this case when the blurring
filter is singular, the Wiener filtering actually
amplify the noise.The implementation of the
regularized inverse filter involves the estimation of
the power spectrum of the original image in the
spatial domain.

C. Lucy-Richardson algorithm

The Lucy-Richardson algorithm can be used


effectively when the point-spread function PSF
(blurring operator is known, but little or no
information is available for the noise. The blurred
and noisy image is restored by the iterative,
accelerated, damped Lucy-Richardson algorithm.
The additional optical system such as camera
Figure 6: Image degraded by Speckle noise. characteristics can be used as input parameters to
improve the quality of the image restoration. The
algorithm requires a good estimate of the process
by which the image is degraded for accurate
5. Restoration Algorithms restoration. The degradation can be caused in many
ways, such as subject movement, out-of-focus
In image restoration the improvement in quality of lenses, or atmospheric turbulence, and is described
the restored image over the recorded blurred one is by the point spread function (PSF) of the system.
measured by the signal-to-noise ratio improvement. The image is assumed to come from a Poisson
RT
When applying restoration filters to real images of process and therefore is corrupted by signal-
which the ideal image is not available, often only dependent noise. There may also be electronic or
the visual judgement of the restored image can be quantization noise involved in obtaining the image.
IJE

relied upon.
6. Software Algorithm

A. Wiener Filter
% Digital Image Processing
This filter can be used effectively when the
frequency characteristics of the image and additive Clc;
noise are known, to at least some degree. Wiener Close all;
filters are often applied in the frequency domain. FltInitialCpuTime = cputime;
An important advantage of this algorithm is that it
removes the additive noise and inverts the blurring ImgTemp = imread ('Gota.jpg', 'jpg');
simultaneously. A demerit of the Wiener filters is % Normalize Image
that they are unable to reconstruct frequency imgTissue1 = double (imgTemp). / 255;
components which have been degraded by noise,
but can only suppress them. These filters are %-----------------------------------------------------------
comparatively slow to apply, since they require --------------------
working in the frequency domain. The spatially % Part 1 - Convert image to gray level
truncated Wiener filter is inferior to the frequency %[X, map] = rgb2ind (imgTissue1, 256);
domain version, but may be much faster. %imgTissue1 = ind2gray(X, map);
%imwrite (imgTissue1, 'Gota.jpg', 'jpg');
B. Regularized Filter
%-----------------------------------------------------------
--------------------
Regularized filtering constraints are applied on the
% Part 2 - Generation of Gaussian noise matrix
recovered image (e.g. smoothness) and limited
vctTissue1Size = size(imgTissue1);
information is known about the additive noise. The
MxGaussianNoise = 0.1.* randn
blurred and noisy image is restored by a
(vctTissue1Size (1), vctTissue1Size (2));
constrained least square restoration algorithm that
use a regularizedfilter. Although the Wiener

IJERTV2IS120564 www.ijert.org 1353


International Journal of Engineering Research & Technology (IJERT)
ISSN: 2278-0181
Vol. 2 Issue 12, December - 2013

%----------------------------------------------------------- title('Degraded Image');


-------------------- subplot(323);
% Part 3 - Point Spread Function (PSF) imagesc(imgTissue1Weiner1);
Generation title('Default Weiner Filter with NSR =
filterPSF = fspecial('motion', 21, 11); 0');
imgTissue1Blur = imfilter(imgTissue1, subplot(324);
filterPSF); imagesc(imgTissue1Weiner2);
imgTissue1BlurAndNoise = imadd title('Weiner Filter Using Noise to Signal
(imgTissue1Blur, mxGaussianNoise); Ratio');
imwrite (imgTissue1BlurAndNoise, subplot(325);
'Gota_blur_and_noise.jpg', 'jpg'); imagesc(imgTissue1Weiner3);
title('Weiner Filter Using Autocorrelation
%----------------------------------------------------------- with NSR');
--------------------
% Part 4 - Noise to Image Power Ratio %-----------------------------------------------------------
imgTissue1Spectrum = --------------------
abs(fft2(imgTissue1)).^2; % Part 7 - Regularized Filtering
fltTissue1Power = sum imgTissue1Regular1 =
(imgTissue1Spectrum (:)) / numel deconvreg(imgTissue1BlurAndNoise, filterPSF);
(imgTissue1Spectrum); imgTissue1Regular2 =
deconvreg(imgTissue1BlurAndNoise, filterPSF,
mxGaussianNoiseSpectrum = abs (fft2 fltGaussianNoisePower); figure('Name','Regular
(mxGaussianNoise)). ^2; Filter', 'NumberTitle', 'off', 'MenuBar', 'none');
fltGaussianNoisePower = sum colormap(gray);
(mxGaussianNoiseSpectrum (:)) / numel subplot(221);
(mxGaussianNoiseSpectrum); imagesc(imgTissue1);
title('Original Image');
fltNSR = fltGaussianNoisePower / subplot(222);
RT
fltTissue1Power; imagesc(imgTissue1BlurAndNoise);
disp ('Noise to Signal Power Ratio:'); title('Degraded Image');
disp (fltNSR); subplot(223);
IJE

imagesc (imgTissue1Regular1);
%----------------------------------------------------------- title('Regular Filter With No Noise
-------------------- Power');
% Part 5 - Autocorrelation Functions subplot(224);
mxTissue1Autocorrelation = imagesc(imgTissue1Regular2);
fftshift(real(ifft2(imgTissue1Spectrum))); title('Regular Filter Using Noise Power');
mxGaussianNoiseAutocorrelation =
fftshift (real (ifft2(mxGaussianNoiseSpectrum))); %-----------------------------------------------------------
--------------------
%----------------------------------------------------------- % Part 8 - Lucy-Richardson Filtering
-------------------- imgTissue1LucyRichardson1 =
% Part 6 - Wiener Filtering deconvlucy(imgTissue1BlurAndNoise, filterPSF,
imgTissue1Weiner1 = deconvwnr 5);
(imgTissue1BlurAndNoise, filterPSF); imgTissue1LucyRichardson2 =
imgTissue1Weiner2 = deconvwnr deconvlucy(imgTissue1BlurAndNoise, filterPSF,
(imgTissue1BlurAndNoise, filterPSF, fltNSR); 3);
imgTissue1Weiner3 =
deconvwnr(imgTissue1BlurAndNoise, filterPSF, figure('Name', 'Lucy-Richardson Filter',
mxGaussianNoiseAutocorrelation, 'NumberTitle', 'off', 'MenuBar', 'none');
mxTissue1Autocorrelation); colormap(gray);
subplot(221);
figure('Name', 'Wiener Filter', imagesc(imgTissue1);
'NumberTitle', 'off', 'MenuBar', 'none'); title('Original Image');
colormap(gray); subplot(222);
subplot(321); imagesc(imgTissue1BlurAndNoise);
imagesc(imgTissue1); title('Degraded Image');
title('Original Image'); subplot(223);
subplot(322); imagesc(imgTissue1LucyRichardson1);
imagesc(imgTissue1BlurAndNoise);

IJERTV2IS120564 www.ijert.org 1354


International Journal of Engineering Research & Technology (IJERT)
ISSN: 2278-0181
Vol. 2 Issue 12, December - 2013

title('Lucy-Richardson Filter, Step 2


iterations=5');
subplot(224); A Gaussian Noise Matrix was generated using the
imagesc(imgTissue1LucyRichardson2); RANDN function. The output of the noise matrix
title('Lucy-Richardson Filter, was intensity scaled and shown below in Figure 3.
iterations=3'); The intensities of the image matrix were scaled
such that the highest intensity was 0.1 and the
%----------------------------------------------------------- lowest: 0.0.
--------------------
disp('CPU Time:');
disp((cputime - fltInitialCpuTime));

disp('Done.');
%-----------------------------------------------------------
--------------------

7. Simulation Results

Exploring the results of the restoration algorithms


explained in section 5 as implemented in
MATLAB.
Step 1

The original image, Gota.jpg is an RGB image and


RT
was converted to a grayscale image using the
RGB2IND and IND2GRAY functions.
IJE

Fig.1: Original image (Gota.jpg)

Fig.3: The Gaussian Noise Matrix scaled by


intensity to 0 and 1 respectively

Step 3
Fig.2: Converted grayscale image (Gota_gray.jpg)
A PSF was created using the FSPECIAL function
using the motionparameter. The image in Figure 2
was then motion blurred using this PSF and the

IJERTV2IS120564 www.ijert.org 1355


International Journal of Engineering Research & Technology (IJERT)
ISSN: 2278-0181
Vol. 2 Issue 12, December - 2013

IMFILTER function. Then, Gaussian noise was Step 6


added with the IMADD function and the Gaussian
Noise Matrix. The output of this operation on
Figure 2 is shown below:
The DECONVWNR function was used to perform
Wiener filtering on Figure 3. There are many
different parameters that can be used with this type
of inverse filtering. Figure 5 shows these
parameters being applied. Notice that the more
information we give the filtering function, the
better the results.

Fig.4: Degraded image of Figure 2 using motion


blur and Gaussian noise

Step 4
The Noise to Signal Power Ratio was computed
RT
using the following equations:

Spectrum = abs (fft2 (image)). ^2;


IJE

Fig.5: Results of Wiener filtering using different


parameters.

Power= sum (Spectrum (:)) /prod (size


(Spectrum)) ; Step 7

The equations were calculated for the image of


Figure 2 and the image of Figure 3. The powers The DECONVREG function was used to perform
were then divided to get the Noise to Signal Power Regulated filtering on Figure 3. There are many
Ratio. The value of which is obtained as; different parameters that can be used with this type
of inverse filtering. Figure 6 shows these
Noise to Signal Power Ratio: 0.0319 parameters being applied. Notice that the more
information we give the filtering function, the
Step 5 better the results. With no noise power information,
the image is heavily degraded. This is because the
filter looks at the extra noise in the image as part of
The autocorrelation matrices were computed using some degradation function blurring possibly and
the IFFT2 command. This returned the real part of not as additive noise.
the inverse fast Fourier transforms of the spectrums
of figure 2 and figure 3. These matrices are used in
the inverse filtering of Figure4 as would be seen
later.

IJERTV2IS120564 www.ijert.org 1356


International Journal of Engineering Research & Technology (IJERT)
ISSN: 2278-0181
Vol. 2 Issue 12, December - 2013

filters. Similarly, the variance v, for the speckle


noise model was set at its default value of 0.04 for
all filters. For the motion blur model, the linear
motion of the camera LEN, with the angle of
inclination THETA, were set at values of 21pixels
and 11degrees respectively.

The following results were obtained:

A.Wiener filtering of salt and pepper noise

Fig.6: Results of Regulated filtering using different


parameters.

Step 8

The DECONVLUCY function was used to perform


Lucy-Richardson filtering on Figure 3. There are
many different parameters that can be used with
RT
this type of inverse filtering. Figure 7 shows these
parameters being applied. Notice that as the
number of iteration we performed on the image
increased, the better quality output image was
IJE

realized. This filter is particularly interesting as it


could remove much of the blur and still leave the
noise in the image. This was not found with the two
previous filters.

Fig.8: Results of Wiener filtering of Salt and


Pepper noise using different parameters.

Fig.7: Results of Lucy-Richardson filtering using


different parameters.

Same steps above where applied using motion blur


but with Salt and Pepper and Speckle noise models
respectively. The value of the Pepper and salt noise
models respectively. The value of 0.05 for all the

IJERTV2IS120564 www.ijert.org 1357


International Journal of Engineering Research & Technology (IJERT)
ISSN: 2278-0181
Vol. 2 Issue 12, December - 2013

B.Regular filtering of Salt and Pepper noise

E.Regular filtering of Speckle noise

C.Lucy-Richardson filtering of Salt and Pepper


RT
noise
IJE

D.Wiener filtering of speckle noise

IJERTV2IS120564 www.ijert.org 1358


International Journal of Engineering Research & Technology (IJERT)
ISSN: 2278-0181
Vol. 2 Issue 12, December - 2013

F.Lucy-Richardson filtering of speckle noise performs rather well at removing the degradation
from the PSF (blur in the case) but not the noise.
Therefore, having a good PSF, the Wiener and
Regularized filters will perform better where the
noise information is available whereas, the Lucy-
Richardson filter performs better in blurs
elimination and not particularly the noise.

8. References

1] www.owlnet.rice.edu/elec539/projects99

[2] www.ee.un/v.edu

[3] www.gerltd.com

[4]
www.mathworks.com/help/toolbox/images/bqqhlb
w.html
7. Conclusion
[5] A.S. Awad, A Comparison between previously
In conclusion, often times the colour information if known and two novel Image Restoration
an image is irrelevant to analysis and when such is Algorithms, MS Thesis, Department of Electrical &
RT
the case, a colour image is often converted to
Electronics Engineering, East Mediterranean
grayscale to speed up computation. The point-
spread function (PSF) is unknown in real life and is University. June 2001.
often assumed based on camera parameters or other
IJE

system characteristics. It can be computed by trial [6]R. L. Lagendijk and J. Biemond, Basic Methods
and error. However, the PSF is usually a model as for Image Restoration and
it is very complex to determine an exact
PSF.Although this paper tried exploring the effects Identification, Information and Communication
of other noise models, noise in an image is Theory Group, Faculty of Information Technology
commonly modelled as Gaussian. The noise to and Systems Delft University of Technology, The
image power ratio is good measure of how much
Netherlands (February, 1999).
noise is in an image. This information, along with
the noise power, can be used in the inverse filtering
process to realize a much less degraded image. As [7] R.C. Gonzalez and R.E. Woods, Digital Image
expected the more information you add to the Processing (Third Edition), Publishing House of
inverse filtering process, the better the output. Electronics Industry, Beijing (2010).
Inverse filtering is achieved by the use of
autocorrelation matrices that are obtained from [8] M. Jiang and G. Wang, Development of Blind
noise and blur information about the image. This Image
information expressed as a correlation is
convenient way to implement it into an inverse
[9] M.R. Banham and A.K. Katsaggelos, Digital
filter. It can be observed from the results obtained
that with no noise information, the Wiener and Image Restoration, IEEE Signal Processing
Regularized filters performance in realizing the Magazine 14(2) (March 1997), 24–41.
degraded image was poor. However, the Lucy-
Richardson filter had a good performance, despite [10] M.I. Sezan and A.M. Tekalp, Survey of
having no information about the noise in the image. Recent Developments in Digital Image Restoration,
With noise information, the Wiener and Optical Engineering, vol. 29, No. 5, pp. 393-404,
Regularized filters did a great job at restoring the (1990).
image. However, the Wiener filter is much better at
the blur than the Regularized filter. Despite having
no noise information, the Lucy-Richardson filter [11] Pitas I., Digital Image Processing Algorithms,
Prentice Hall, New York, (1993).

IJERTV2IS120564 www.ijert.org 1359


International Journal of Engineering Research & Technology (IJERT)
ISSN: 2278-0181
Vol. 2 Issue 12, December - 2013

[12] Yung N.H.C., Lai A.H.C., Poon K.M.,


Modified CPI Filter Algorithm for Removing Salt-
and-Pepper Noise in Digital Images, Proc. SPIE in
Visual Communication and Image Processing’96,
vol. 2727, (1996).

[13]X.Tai,O.Christiansen,P. Lin and I.Skjaelaaen.


ARemark o n theMBOSchemeandSomePiecewise
ConstantLevelSetMethods,submitted.

[14]R. Glowinski, P. Lin andX.-B.


Pan.Anoperator-splitting methodfor aliquid
crystalmodel.CompPhysComm152,2003,pp.242-
252.

[15]T. Lu,P. NeittaanmakiandX-CTai.


Aparallelsplitting upmethodand itsapplication
tonavier-stoke e q ua t i o n s .
AppliedMathematicsLetters, 4,1991,pp.25-29.

[16]T.Lu,P.Neittaanmaki, andX-
CTai.Aparallelsplittingupmethodforpartial
differentialequations anditsapplication t o navier-
stokes equations. RAIRO Math.
Model.AndNumer. Anal.,26,1992,pp.673-708.
RT
[17]J.Weickert, B.H.Romeny,
andM.A.Viergever.Efficientandreliableschemesfor
non- linear diffusionfiltering.IEEE Trans.
IJE

ImageProcess,7,1998,pp.398-409,1998.

IJERTV2IS120564 www.ijert.org 1360

You might also like