Transcript Chapter 4

Chapter 5
Image Restoration
Preview
Goal: improve an image in some predefined sense.
Image enhancement: subjective process
Image restoration: objective process
Restoration attempts to reconstruct an image that
has been degraded by using a priori knowledge of
the degradation process.
Modeling the degradation and applying the inverse
process to recover the original image.
When degradation model is unknown  blind
deconvolution (ICA)
A Model of Degradation
g ( x , y )  h ( x , y ) * f ( x , y )   ( x, y )
or G(u, v)  H (u, v) F (u, v)  N (u, v)
Given g(x,y), some knowledge about H, and
some knowledge about the noise term,
obtain an estimate of the original image.
Noise Models
Gaussian noise: electronic circuit sensor noise
Rayleigh noise: range imaging
Erlang (Gamma noise): laser imaging
Exponential noise: laser imaging
Uniform noise
Impulse (salt-and-pepper noise): faulty
switching
Periodic noise
Gaussian Noise
The PDF of a Gaussian random variable,
z, is given by:
1
( z   ) 2 / 2 2
p( z ) 
e
2 
Rayleigh Noise
•
•
The PDF of Rayleigh noise is given by:
2
2

 ( z  a ) e ( z  a ) / b
p( z )   b
for z  a

for z  a
0
Mean and variance are given by:
  a  b / 4
•
2 
b( 4   )
4
Useful for approximating skewed histograms.
Erlang (Gamma) Noise
• The PDF of Erlang noise is given by:
 a b z b1 az

e
for z  0
p( z )   (b  1)!

0 for z  0
• Mean and variance:
b

a
2 
b
a2
Exponential Noise
The PDF of exponential noise is given by:
ae az for z  0
p( z )  
 0 for z  0
where a >0
Mean and variance:
1
1
2

  2
a
a
Uniform Noise
The PDF of uniform noise is given by:
1


if a  z  b
p( z )   b  a

otherwise
 0
Mean and variance:
ab

2
(b  a ) 2
 
12
2
Impulse (Salt-and-Pepper) Noise
The PDF of (bipolar) impulse noise is given
by:
 Pa for z  a

p ( z )   Pb for z  b
0 ot herwise

Periodic Noise
Arises typically from
electrical or
electromechanical
interference during image
acquisition.
The only type of spatially
dependent noise
considered in this chapter.
Illustration (I)
Illustration (II)
Estimation of Noise Parameters
Periodic noises: from Fourier spectrum
Others: try to compute the mean and
variance of a subimage S (containing only
constant gray levels).
Restoration in the Presence of
Noise Only – Spatial Filtering
Mean filters:
Arithmetic mean filters
Geometric mean filter
Harmonic mean filter:
Contraharmonic mean filter:
fˆ ( x, y ) 
 g ( s, t )
fˆ ( x, y ) 
mn

( s ,t )S xy
1
g ( s, t )
Q 1
( s ,t )S xy
 g ( s, t )
Q
( s ,t )S xy
Q: the order of the filter. Q>0 eliminates pepper noise, Q <0
eliminates salt noise.
Illustration (I)
Illustration (II)
Illustration (III)
Order-Statistics Filters
Median filters
Max and min filters
ˆ ( x, y )  1  max {g ( s, t )}  min {g ( s, t )}
f
Midpoint filter:

2 
Alpha-trimmed mean filter: delete the d/2
lowest and d/2 highest gray-level values of
g(s,t) in the neighborhood of Sxy , the
average
1
( s ,t )S xy
fˆ ( x, y ) 
 g (s, t )
mn  d ( s ,t )Sxy
r
( s ,t )S xy
Illustration (I)
Illustration (II)
Illustration (III)
Adaptive Filters
Filter’s behavior changes based on
statistical characteristics of the image
inside the filter region defined by the
mxn window.
Adaptive, local noise reduction filter
Adaptive median filter
Adaptive, local noise reduction
filter
(a) g(x,y): the value of the noisy image at (x,y)
(b) The variance of the noise
(c) The mean of the pixels in Sxy
(d) Local variance of the pixels in Sxy
If (b) is zero, return g(x,y)
If (d) is high relative to (b), the filter should return a
value close to g(x,y)
If the two variances are equal, return the arithmetic
mean of the pixels in Sxy
2

fˆ ( x, y )  g ( x, y )  2 [ g ( x, y )  mL ]
L
Illustration
Adaptive Median Filter
Notation:
zmin: minimum gray level value in Sxy
zmax: maximum gray level value in Sxy
zmed: median of gray levels in Sxy
zxy: gray level value at (x,y)
Smax: maximum allowed size of Sxy
Level A: A1= zmed – zmin, A2= zmed – zmax
if A1> 0 and A2 <0, go to level B
Else increase the window size
If window size <= Smax repeat level A
else output zxy
Level B: B1= zxy – zmin, B2= zxy – zmax
if B1> 0 and B2 <0, output zxy
Else output zmed
Illustration
Periodic Noise Reduction
By Fourier domain filtering:
Bandreject filters
Bandpass filters
Notch filters
Illustration
Ideal Notch Reject Filter
Ideal notch reject filter:
0
H(u, v)  
1
if D1 (u, v)  D0 or D2 (u, v)  D0
otherwise
where
D1 (u, v)  [(u  M / 2  u0 ) 2  (v  M / 2  v0 ) 2 ]1/ 2
D 2 (u, v)  [(u  M / 2  u0 ) 2  (v  M / 2  v0 ) 2 ]1/ 2
Butterworth Notch Reject Filter
H(u, v) 
1


D
1 

 D1 (u, v) D2 (u, v) 
2
0
n
Gaussian Notch Reject Filter
 1  D1 (u , v) D2 (u, v)  

H(u, v)  1  exp  

2
D0

 2
Notch Filters
Linear, Position-Invariant Degradations
Estimating the degradation function
By image observation
By experimentation
By modeling
Estimation by Image Observation
In the strong signal area, using sample gray
levels of the object and background to
construct an unblurred image fˆs ( x, y)
Then,
Gs (u, v)
H s (u, v) 
Fˆs (u, v)
Use Hs(u,v) to estimate H(u,v)
Estimation by Experimentation
Simulate an impulse by a (very) bright dot
of light, the response G(u,v) is related to
H(u,v) by:
G (u , v)
H(u , v) 
A
Figure 5.24
Estimation by Modeling
Modeling atmospheric turbulence
H(u, v)  exp[k (u 2  v2 )5 / 6 ]
Atmospheric Turbulence
Estimation by Modeling (cont’d)
Modeling effect of planar motion x0(t),y0(t):
If T is the duration of the exposure, then
T
g(x,y)  f [ x  x0 (t ), y  y0 (t )]dt
0
It can be shown that:
G(u, v)  F (u, v) exp j 2 [ux0 (t )  vy0 (t )]dt
T
0
Motion Blur
If x0(t)=at/T and y0(t)=0, then
T
H (u, v)   exp[ j 2ux0 (t )]dt
0
T

sin(ua) exp[ jua]
ua
Motion Blur Example
Deconvolution
Inverse filtering
Minimum mean square error (Wiener)
filtering
Constrained least squares filtering
Geometric mean filter
http://vision.cs.nccu.edu.tw/publication
s/CVPRIP2003_A.pdf
Results (Inverse Filter)
Results (Inverse and Wiener)
Results (Motion Blurs)
Results (Constrained LS Filter)
Geometric Transformations
Image warping
Spatial
transformations
Gray-level
interpolation