RESTORATION OF BLURRED IMAGES
CS-467 Digital Image Processing
1
Image Degradation and Restoration
2
© 1992-2008 R. C. Gonzalez & R.E. Woods
Image Deblurring: Problem
Statement
Mathematically a variety of image capturing principles can be
described by the Fredholm integral of the first kind
where is a point-spread function (PSF) of an optical
system, is a function of a real object, is
an additive noise, and is an observed signal.
( , )(( , () , ),) f xg x h x y dt yy xy η= +∫
( , )h x y
( , )f x y
( , )g x y
( , )x yη
Point-Spread Function (PSF)
4
Convolution
• If the PSF h is a linear and shift-invariant
function, then the degraded image is
expressed in the spatial domain by its
convolution with the spatial representation of
the PSF h
5
( , ) ( , ), ) , )( (fg x h x y y yx xy η= ∗ +
Frequency Domain Representation
• An equivalent frequency domain
representation is as follows
Where is the Fourier transform of ,
is the Fourier transform of ,
is the Fourier transform of ,
and is the Fourier transform of
6
(( , ) ,( ) ), , )(FG u Nu vH u v u vv= +
( , )G u v
( , )H u v
( , )F u v
( , )N u v
( , )g x y
( , )h x y
( , )f x y
( , )x yη
Problem statement: capturing
• Mathematically a variety of capturing principles can be
described by the Fredholm integral of the first kind
• where h(x,y) is a point-spread function (PSF) of a system,
q(x,y) is a function of a real object and g(x,y) is an observed
signal.
2
( , ) ( , ) ( , ) , ,
R
g x y h x y f x y dxdy x y R= ∈∫
Micro
scopy
∈
Photo
7
Degradation in Spatial and
Frequency Domain
• In the spatial domain, image degradation (blurring) is
observed as fuzziness, small image details and edges look
unsharpened and many of them become even
undistinguishable
• In the frequency domain, image degradation (blurring)
significantly affects a power spectrum (as a result of
convolution with PSF whose Fourier transform contains
many zeros, some frequencies “disappear” from the Fourier
transform of a blurred image)
• At the same time, symmetric PSFs almost do not affect a
phase spectrum (particularly its low and medium frequency
area is almost not affected, while a high frequency area is
just slightly affected)
8
Degradation in Spatial and Frequency Domain
log Z
True Image Horizontal
Motion blur
Gaussian
blur
Images and log of their Power Spectra
True Image Rectangular
(2D motion) blur
Optical
Defocus blur
Degradation in Spatial and Frequency Domain
log ZImages and log of their Power Spectra
Examples of Different PSFs
The Gaussian PSF:
is a parameter (variance)
The uniform linear motion:
t is a parameter (the length of motion)
The uniform optical defocus:
t is a parameter
(the size of smoothing area)
2 2
2 2
1
( , ) exp
2
x y
h x y
πσ σ
 +
= − 
 
2 2
1
, / 2, cos sin ,
( , )
otherwise,0,
x y t x y
h x y t
φ φ

 + < =
= 

2
1
, , ,
( , ) 2 2
otherwise,0,
t t
x y
h x y t

< <
= 

2
σ
Examples of Different PSFs
PSF in spatial domain
PSF in frequency domain
Gaussian Motion Defocus
Degradation in Spatial and Frequency Domain
13
True Image Motion blur,
6 pixels
Motion blur,
10 pixels
Degradation in Spatial and Frequency Domain
14
True Image Gaussian
blur, var=2
Gaussian
blur, var=5
Atmosphere Turbulence Blur
Simulated by Gaussian Model
15
© 1992-2008 R. C. Gonzalez & R.E. Woods
“Ideal” Frequency Domain Model
• Assuming that the effect of noise is negligible
(which, in fact, is never possible for real-world
images), we may use a simpler frequency
domain model
• Respectively, to restore our image, we have to
solve this equation for
16
( , ) ( , ) ( , )G u v H u v F u v=
( , )F u v
( , )ˆ( , )
( , )
G u v
F u v
H u v
=
“Ideal” Model in Spatial Domain
• Still assuming that the effect of noise is
negligible, in spatial domain we obtain
• Respectively,
• This is equation is called “deconvolution”.
Neither in spatial, nor in frequency domain it
can be solved directly in the straightforward
way due to zeros contained in h and H.
17
( , ) ( , ) ( , )g x y h x y f x y= ∗
( )
1
( , ) ( , ) ( , )f x y g x y h x y
−
= ∗
Methods of Solving Deconvolution
Problem
• A necessary condition to restore a blurred
image is to know the exact PSF model – to
know function h(x,y) and its spectrum H(u,v).
• The alternative is to apply a blind
deconvolution technique, which is resulted in
the long iterative process whose results can be
good or not good. So it is “50/50”. Thus, it is
preferable to identify PSF
18
Methods of Solving Deconvolution
Problem – Inverse Filtering
• Inverse filtering – deconvolution equation is
going to be solved in the frequency domain.
Those frequencies where H(u,v)=0, are not
involved in the operation
• Disadvantage: just a light blur can be removed
in this way
19
( , )ˆ( , )
( , )
G u v
F u v
H u v
=
Methods for PSF identification
• To identify PSF, if an image is even slightly
corrupted by noise, it is necessary to use machine
learning tools (a neural network, a support vector
machine, etc.) and to analyze a power spectrum
• A problem is that when an image is noisy, there
are no actual zeros in its power spectrum,
because the Fourier transform of an image
contains the one of noise as an additive
component
20
Methods of Solving Deconvolution
Problem – Wiener Filtering
• Wiener filtering is a minimum Mean Square
Error Filtering. The error is
• The filter in frequency domain is determined
as follows
• Disadvantages: and are
unknown and can just be estimated
21
{ }2 2ˆ( )e E f f= −
2
2
2
2
( , )1ˆ( , ) ( , )
( , ) ( , )
( , )
( , )
H u v
F u v G u v
H u v N u v
H u v
F u v
 
 
 
=  
 +
 
 
( , )N u v ( , )F u v
Wiener Filtering for
White Noise Case
• Wiener filtering for white noise case is as
follows
• Where K is a power spectrum of noise, which
is a constant for white noise
• Disadvantage: noise is not always white
22
2
2
( , )1ˆ( , ) ( , )
( , ) ( , )
H u v
F u v G u v
H u v H u v K
 
=  
+  
Restoration: Examples
23
© 1992-2008 R. C. Gonzalez & R.E. Woods
Methods of Solving Deconvolution
Problem – Regularization Filtering
• Regularization filtering is reduced to solving
the optimization problem
in the frequency domain
• The filter in frequency domain is determined
as follows
where * stands for complex conjugation and α
is the regularization parameter
24
2 2
ˆg Hf η− =
*
2
( , )ˆ( , ) ( , )
( , )
H u v
F u v G u v
H u v α
 
=  
+  
Restoration of an image after
deconvolution is done
• After restoring an image Fourier transform
by solving a deconvolution problem, an image
can be restored by finding its inverse Fourier
transform
25
ˆ( , )F u v
( ) ( )1ˆ ˆ, ( , )f x y F u v−
= Φ
Evaluation of the quality of a
restored image
• The quality of restoration can be evaluated as
usually in terms of PSNR
• In image deblurring there are also two other
measures, which are preferable:
the blurred signal-to-noise ratio (BSNR) and
the improved signal-to-noise-ratio (ISNR)
26
BSNR and ISNR
• BSNR
where is a blurred image without noise, is a
restored image, M is the number of pixels, and is
the noise variance
• ISNR
where is an original image, is a degraded
image, and is a restored image
27
( )
2
10 2
ˆ
10 log
g f
BSNR
Mσ
−
= ⋅
g ˆf
2
σ
( )
( )
2
10 2
10 log
ˆ
f g
ISNR
f f
−
= ⋅
−
f g
ˆf

Lecture 11

  • 1.
    RESTORATION OF BLURREDIMAGES CS-467 Digital Image Processing 1
  • 2.
    Image Degradation andRestoration 2 © 1992-2008 R. C. Gonzalez & R.E. Woods
  • 3.
    Image Deblurring: Problem Statement Mathematicallya variety of image capturing principles can be described by the Fredholm integral of the first kind where is a point-spread function (PSF) of an optical system, is a function of a real object, is an additive noise, and is an observed signal. ( , )(( , () , ),) f xg x h x y dt yy xy η= +∫ ( , )h x y ( , )f x y ( , )g x y ( , )x yη
  • 4.
  • 5.
    Convolution • If thePSF h is a linear and shift-invariant function, then the degraded image is expressed in the spatial domain by its convolution with the spatial representation of the PSF h 5 ( , ) ( , ), ) , )( (fg x h x y y yx xy η= ∗ +
  • 6.
    Frequency Domain Representation •An equivalent frequency domain representation is as follows Where is the Fourier transform of , is the Fourier transform of , is the Fourier transform of , and is the Fourier transform of 6 (( , ) ,( ) ), , )(FG u Nu vH u v u vv= + ( , )G u v ( , )H u v ( , )F u v ( , )N u v ( , )g x y ( , )h x y ( , )f x y ( , )x yη
  • 7.
    Problem statement: capturing •Mathematically a variety of capturing principles can be described by the Fredholm integral of the first kind • where h(x,y) is a point-spread function (PSF) of a system, q(x,y) is a function of a real object and g(x,y) is an observed signal. 2 ( , ) ( , ) ( , ) , , R g x y h x y f x y dxdy x y R= ∈∫ Micro scopy ∈ Photo 7
  • 8.
    Degradation in Spatialand Frequency Domain • In the spatial domain, image degradation (blurring) is observed as fuzziness, small image details and edges look unsharpened and many of them become even undistinguishable • In the frequency domain, image degradation (blurring) significantly affects a power spectrum (as a result of convolution with PSF whose Fourier transform contains many zeros, some frequencies “disappear” from the Fourier transform of a blurred image) • At the same time, symmetric PSFs almost do not affect a phase spectrum (particularly its low and medium frequency area is almost not affected, while a high frequency area is just slightly affected) 8
  • 9.
    Degradation in Spatialand Frequency Domain log Z True Image Horizontal Motion blur Gaussian blur Images and log of their Power Spectra
  • 10.
    True Image Rectangular (2Dmotion) blur Optical Defocus blur Degradation in Spatial and Frequency Domain log ZImages and log of their Power Spectra
  • 11.
    Examples of DifferentPSFs The Gaussian PSF: is a parameter (variance) The uniform linear motion: t is a parameter (the length of motion) The uniform optical defocus: t is a parameter (the size of smoothing area) 2 2 2 2 1 ( , ) exp 2 x y h x y πσ σ  + = −    2 2 1 , / 2, cos sin , ( , ) otherwise,0, x y t x y h x y t φ φ   + < = =   2 1 , , , ( , ) 2 2 otherwise,0, t t x y h x y t  < < =   2 σ
  • 12.
    Examples of DifferentPSFs PSF in spatial domain PSF in frequency domain Gaussian Motion Defocus
  • 13.
    Degradation in Spatialand Frequency Domain 13 True Image Motion blur, 6 pixels Motion blur, 10 pixels
  • 14.
    Degradation in Spatialand Frequency Domain 14 True Image Gaussian blur, var=2 Gaussian blur, var=5
  • 15.
    Atmosphere Turbulence Blur Simulatedby Gaussian Model 15 © 1992-2008 R. C. Gonzalez & R.E. Woods
  • 16.
    “Ideal” Frequency DomainModel • Assuming that the effect of noise is negligible (which, in fact, is never possible for real-world images), we may use a simpler frequency domain model • Respectively, to restore our image, we have to solve this equation for 16 ( , ) ( , ) ( , )G u v H u v F u v= ( , )F u v ( , )ˆ( , ) ( , ) G u v F u v H u v =
  • 17.
    “Ideal” Model inSpatial Domain • Still assuming that the effect of noise is negligible, in spatial domain we obtain • Respectively, • This is equation is called “deconvolution”. Neither in spatial, nor in frequency domain it can be solved directly in the straightforward way due to zeros contained in h and H. 17 ( , ) ( , ) ( , )g x y h x y f x y= ∗ ( ) 1 ( , ) ( , ) ( , )f x y g x y h x y − = ∗
  • 18.
    Methods of SolvingDeconvolution Problem • A necessary condition to restore a blurred image is to know the exact PSF model – to know function h(x,y) and its spectrum H(u,v). • The alternative is to apply a blind deconvolution technique, which is resulted in the long iterative process whose results can be good or not good. So it is “50/50”. Thus, it is preferable to identify PSF 18
  • 19.
    Methods of SolvingDeconvolution Problem – Inverse Filtering • Inverse filtering – deconvolution equation is going to be solved in the frequency domain. Those frequencies where H(u,v)=0, are not involved in the operation • Disadvantage: just a light blur can be removed in this way 19 ( , )ˆ( , ) ( , ) G u v F u v H u v =
  • 20.
    Methods for PSFidentification • To identify PSF, if an image is even slightly corrupted by noise, it is necessary to use machine learning tools (a neural network, a support vector machine, etc.) and to analyze a power spectrum • A problem is that when an image is noisy, there are no actual zeros in its power spectrum, because the Fourier transform of an image contains the one of noise as an additive component 20
  • 21.
    Methods of SolvingDeconvolution Problem – Wiener Filtering • Wiener filtering is a minimum Mean Square Error Filtering. The error is • The filter in frequency domain is determined as follows • Disadvantages: and are unknown and can just be estimated 21 { }2 2ˆ( )e E f f= − 2 2 2 2 ( , )1ˆ( , ) ( , ) ( , ) ( , ) ( , ) ( , ) H u v F u v G u v H u v N u v H u v F u v       =    +     ( , )N u v ( , )F u v
  • 22.
    Wiener Filtering for WhiteNoise Case • Wiener filtering for white noise case is as follows • Where K is a power spectrum of noise, which is a constant for white noise • Disadvantage: noise is not always white 22 2 2 ( , )1ˆ( , ) ( , ) ( , ) ( , ) H u v F u v G u v H u v H u v K   =   +  
  • 23.
    Restoration: Examples 23 © 1992-2008R. C. Gonzalez & R.E. Woods
  • 24.
    Methods of SolvingDeconvolution Problem – Regularization Filtering • Regularization filtering is reduced to solving the optimization problem in the frequency domain • The filter in frequency domain is determined as follows where * stands for complex conjugation and α is the regularization parameter 24 2 2 ˆg Hf η− = * 2 ( , )ˆ( , ) ( , ) ( , ) H u v F u v G u v H u v α   =   +  
  • 25.
    Restoration of animage after deconvolution is done • After restoring an image Fourier transform by solving a deconvolution problem, an image can be restored by finding its inverse Fourier transform 25 ˆ( , )F u v ( ) ( )1ˆ ˆ, ( , )f x y F u v− = Φ
  • 26.
    Evaluation of thequality of a restored image • The quality of restoration can be evaluated as usually in terms of PSNR • In image deblurring there are also two other measures, which are preferable: the blurred signal-to-noise ratio (BSNR) and the improved signal-to-noise-ratio (ISNR) 26
  • 27.
    BSNR and ISNR •BSNR where is a blurred image without noise, is a restored image, M is the number of pixels, and is the noise variance • ISNR where is an original image, is a degraded image, and is a restored image 27 ( ) 2 10 2 ˆ 10 log g f BSNR Mσ − = ⋅ g ˆf 2 σ ( ) ( ) 2 10 2 10 log ˆ f g ISNR f f − = ⋅ − f g ˆf