Transcript Document

Digital Image Processing
Chapter 5: Image Restoration
A Model of the Image
Degradation/Restoration Process

Degradation



Degradation function H
Additive noise  ( x, y )
Spatial domain
g ( x, y)  h( x, y) * f ( x, y)   ( x, y)

Frequency domain
G(u, v)  H (u, v) F (u, v)  N (u, v)

Restoration
g ( x, y)  Restoration Filter  fˆ ( x, y)
Noise Models

Sources of noise


White noise


Image acquisition, digitization,
transmission
The Fourier spectrum of noise is
constant
Assuming


Noise is independent of spatial
coordinates
Noise is uncorrelated with respect to
the image itself

Gaussian noise

The PDF of a Gaussian random variable,
z,
1
 ( z   ) 2 / 2 2
p( z ) 
e
2 



Mean: 
Standard deviation:
Variance:  2


70% of its values will be in the range
(   ), (   )

95% of its values will be in the range
(  2 ), (  2 )

Rayleigh noise

The PDF of Rayleigh noise,
2
( z  a ) 2 / b
 ( z  a )e
p( z )   b

0



Mean:
  a  b/4
Variance:
b( 4   )
 
4
2
for z  a
for z  a

Erlang (Gamma) noise

The PDF of Erlang noise,
is a positive integer,
 a b z b1 a z

e
p( z )   (b  1)!

0

b

 Mean:
a
b
2
 Variance:
  2
a
a0
,
for z  0
for z  0
b

Exponential noise

The PDF of exponential noise,
ae a z
p( z )  
 0


Mean:
1

a
Variance:
1
  2
a
2
a0
for z  0
for z  0
,

Uniform noise

The PDF of uniform noise,
 1

if a  z  b
p( z )   b  a

otherwise
 0
ab
 Mean:

2
2
(
b

a
)
2
 Variance: 

12

Impulse (salt-and-pepper) noise

The PDF of (bipolar) impulse noise,
 Pa

p ( z )   Pb
0



for z  a
for z  b
ot herwise
b  a : gray-level b
will appear as a
light dot, while level a will appear like
a dark dot
Unipolar: either Pa or Pb is zero

Usually, for an 8-bit image,
(black) and b =0 (white)
a =0

Modeling

Gaussian


Rayleigh


Electronic circuit noise, sensor noise due
to poor illumination and/or high
temperature
Range imaging
Exponential and gamma

Laser imaging

Impulse


Quick transients, such as faulty switching
Uniform
Least descriptive
 Basis for numerous random number
generators


Periodic noise


Arises typically from electrical or
electromechanical interference
Reduced significantly via frequency
domain filtering

Estimation of noise parameters


Inspection of the Fourier spectrum
Small patches of reasonably constant
gray level
For example, 150*20 vertical strips
 Calculate  ,
, a , b from


   zi p( zi )
zi S
   ( zi   ) p( zi )
2
2
zi S
Restoration in the Presence of Noise
Only-Spatial Filtering

Degradation

Spatial domain
g ( x, y)  f ( x, y)   ( x, y)

Frequency domain
G(u, v)  F (u, v)  N (u, v)

Mean filters

Arithmetic mean filter
ˆf ( x, y)  1
g ( s, t )

m n ( s ,t )S xy

Geometric mean filter


fˆ ( x, y )    g ( s, t )
( s ,t )S xy

1
mn

Harmonic mean filter

Works well for salt noise, but fails fpr
pepper noise
fˆ ( x, y ) 
mn

( s ,t )S xy
1
g ( s, t )

Contraharmonic mean filter


Q0
Q0
: eliminates pepper noise
: eliminates salt noise
fˆ ( x, y ) 
Q 1
g
(
s
,
t
)

( s ,t )S xy
 g ( s, t )
( s ,t )S xy
Q

Usage


Arithmetic and geometric mean filters:
suited for Gaussian or uniform noise
Contraharmonic filters: suited for
impulse noise

Order-statistics filters

Median filter

Effective in the presence of both bipolar
and unipolar impulse noise
fˆ ( x, y)  median{g (s, t )}
( s ,t )S xy

Max and min filters

max filters reduce pepper noise
fˆ ( x, y)  max {g (s, t )}
( s ,t )S xy

min filters salt noise
fˆ ( x, y)  min {g (s, t )}
( s ,t )S xy

Midpoint filter

Works best for randomly distributed noise,
like Gaussian or uniform noise
ˆf ( x, y)  1  max {g ( s, t )}  min {g ( s, t )}

( s ,t )S xy
2 ( s ,t )S xy

Alpha-trimmed mean filter
Delete the d/2 lowest and the d/2 highest
gray-level values
 Useful in situations involving multiple
types of noise, such as a combination of
salt-and-pepper and Gaussian noise

fˆ ( x, y) 
1
g r (s, t )

mn d ( s ,t )S xy

Adaptive, local noise reduction filter

If
of
If

2
is zero, return simply the value
g ( x, y )

2   L2 , return a value close to
g ( x, y )
2
2
 If    , return the arithmetic

L
mean value mL
ˆf ( x, y)  g ( x, y)   g ( x, y)  m 
L
2
2
L

Adaptive median filter





zmin
S xy
zmax
S xy
zmed
z xy
Smax
= minimum gray level value in
= maximum gray level value in
= median of gray levels in S xy
= gray level at coordinates ( x, y )
= maximum allowed size of S xy









Algorithm:
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 zmed




Level B: B1= z xy  zmin
B2= z xy  zmax
If B1>0 AND B2<0, output
Else output zmed
z xy

Purposes of the algorithm
Remove salt-and-pepper (impulse) noise
 Provide smoothing
 Reduce distortion, such as excessive
thinning or thickening of object
boundaries

Periodic Noise Reduction by Frequency
Domain Filtering

Bandreject filters

Ideal bandreject filter
W

1
if
D(u,
v)

D

0

2

W
W

H (u , v)  0 if D 0   D(u, v)  D 0 
2
2

W
1
if D(u, v)  D 0 

2

2
2 1/ 2
D(u, v)  (u  M / 2)  (v  N / 2)



Butterworth bandreject filter of order n
H (u, v) 

1
 D(u, v)W 
1  2
2
 D (u, v)  D0 
Gaussian bandreject filter
H (u, v)  1  e
1  D 2 ( u ,v )  D02 
 

2  D ( u ,v )W 
2
2n

Bandpass filters
Hbp (u, v)  1  Hbr (u, v)

Notch filters

Ideal notch reject filter
0 if D1 (u, v)  D0 or D2 (u, v)  D0
H (u, v)  
otherwise
1

D (u , v)  (u  M / 2  u )

 (v  N / 2  v ) 
D1 (u , v)  (u  M / 2  u0 )  (v  N / 2  v0 )
2
0
2
2
2 1/ 2
2 1/ 2
0

Butterworth notch reject filter of
order n
H (u, v) 
1


D
1 

 D1 (u, v) D2 (u, v) 
2
0
n

Gaussian notch reject filter
H (u, v)  1  e
1  D1 ( u ,v ) D2 ( u ,v ) 
 

2
2 
D0


Notch pass filter
Hnp (u, v)  1  Hnr (u, v)

Optimum notch filtering

Interference noise pattern
N (u, v)  H (u, v)G(u, v)

Interference noise pattern in the spatial
domain
 ( x, y)   {H (u, v)G(u, v)}
1

Subtract from g ( x, y ) a weighted
portion of  ( x, y ) to obtain an
estimate of f ( x, y)
fˆ ( x, y)  g ( x, y)  w( x, y) ( x, y)



Minimize the local variance of fˆ ( x, y)
The detailed steps are listed in Page
251
Result
w( x, y ) 
g ( x, y ) ( x, y )  g ( x, y) ( x, y)
 ( x, y )   ( x, y)
2
2