Professional Documents
Culture Documents
Chapter 05
Chapter 05
Chapter 5:
Image Restoration
Concept of Image Restoration
Degradation model:
g ( x, y ) f ( x, y ) h( x, y ) ( x, y )
Exponential noise
p( z ) ae az
Uniform noise
1
for a z b
p( z ) b - a
0 otherwise
Pa for z a
p( z ) Pb for z b
0 otherwise
PDF: Statistical Way to Describe Noise
g ( x, y ) f ( x, y ) ( x, y )
Degraded images
Original image
Histogram
g ( x, y ) f ( x, y ) ( x, y )
Degraded images
Original image
Histogram
Periodic noise
looks like dots
In the frequency
domain
(Images from Rafael C. Gonzalez and Richard E.
Wood, Digital Image Processing, 2nd Edition.
Estimation of Noise
DFT
(no shift)
g ( x, y ) f ( x, y ) h( x, y ) ( x, y )
ˆf ( x, y ) 1
g ( s, t )
mn ( s ,t )S xy
Geometric mean filter mn = size of moving window
1
mn
fˆ ( x, y ) g ( s, t )
( s ,t )S
xy
Geometric Mean Filter: Example
Original Image
image corrupted
by AWGN
Image Image
obtained obtained
using a 3x3 using a 3x3
arithmetic geometric
mean filter mean filter
AWGN: Additive White Gaussian Noise (Images from Rafael C. Gonzalez and Richard E.
Wood, Digital Image Processing, 2nd Edition.
Harmonic and Contraharmonic Filters
Harmonic mean filter
mn
fˆ ( x, y ) Works well for salt noise
1
( s ,t )S xy g ( s, t )
but fails for pepper noise
g ( s , t ) Q 1
Positive Q is suitable for
fˆ ( x, y )
( s ,t )S xy eliminating pepper noise.
g ( s, t )
( s ,t )S xy
Q Negative Q is suitable for
eliminating salt noise.
Image Image
corrupted corrupted
by pepper by salt
noise with noise with
prob. = 0.1 prob. = 0.1
Image Image
obtained obtained
using a 3x3 using a 3x3
contra- contra-
harmonic harmonic
mean filter mean filter
With Q = 1.5 With Q=-1.5
Image Image
corrupted corrupted
by pepper by salt
noise with noise with
prob. = 0.1 prob. = 0.1
Image Image
obtained obtained
using a 3x3 using a 3x3
contra- contra-
harmonic harmonic
mean filter mean filter
With Q=-1.5 With Q=1.5
Statistic parameters
Mean, Median, Mode,
Min, Max, Etc.
Moving
window
Output image
Order-Statistics Filters
Median filter
fˆ ( x, y ) median g ( s, t )
( s ,t )S xy
Max filter
Midpoint filter
Salt noise
Pepper noise
Median
Sorted
Degraded image Moving array
window
Salt noise Filter output
Pepper noise
Normally, impulse noise has high magnitude
and is isolated. When we sort pixels in the
moving window, noise pixels are usually
at the ends of the array.
Therefore, it’s rare that the noise pixel will be a median value.
Median Filter : Example
1 2
Image
corrupted
by salt-
and-pepper
noise with
pa=pb= 0.1
3 4
Image Image
corrupted corrupted
by pepper by salt
noise with noise with
prob. = 0.1 prob. = 0.1
Image Image
obtained obtained
using a 3x3 using a 3x3
max filter min filter
Formula:
1
fˆ ( x, y )
mn d
g ( s, t )
( s ,t )S xy
r
Image 2 Image 2
obtained obtained
using a 5x5 using a 5x5
arithmetic geometric
mean filter mean filter
Image 2
Image 2 obtained
obtained using a 5x5
using a 5x5 alpha-
median filter trimmed
mean filter
with d = 5
Alpha-trimmed Mean Filter: Example (cont.)
Image Image
obtained obtained
using a 5x5 using a 5x5
arithmetic geometric
mean filter mean filter
Image
Image obtained
obtained using a 5x5
using a 5x5 alpha-
median filter trimmed
mean filter
with d = 5
Adaptive Filter
General concept:
-Filter behavior depends on statistical characteristics of local areas
inside mxn moving window
- More complex but superior performance compared with “fixed”
filters
Statistical characteristics:
Local mean: Noise variance:
1
2
mL g ( s, t )
mn ( s ,t )S xy
Local variance:
1
2
L (
mn ( s ,t )S xy
g ( s , t ) m L ) 2
Adaptive, Local Noise Reduction Filter
Purpose: want to preserve edges
Concept:
1. If 2 is zero, No noise
the filter should return g(x,y) because g(x,y) = f(x,y)
Methods:
1. Estimation by Image Observation
2. Estimation by Experiment
Observation
DFT Subimage
Estimated Transfer Gs (u, v ) g s ( x, y )
function
G ( u, v ) Restoration
H ( u, v ) H s ( u, v ) s process by
Fˆs (u, v ) estimation
DFT Reconstructed
This case is used when we Fˆs (u, v )
know only g(x,y) and cannot Subimage
repeat the experiment! fˆs ( x, y )
Estimation by Experiment
Used when we have the same equipment set up and can repeat the
experiment.
Response image from
Input impulse image the system
System
H( )
A ( x , y ) g ( x, y )
DFT DFT
DFT A ( x, y ) A G ( u, v )
G ( u, v )
H ( u, v )
A (Images from Rafael C. Gonzalez and Richard E.
Wood, Digital Image Processing, 2nd Edition.
Estimation by Modeling
Used when we know physical mechanism underlying the image
formation process that can be expressed mathematically.
Original image Severe turbulence Example:
Atmospheric
Turbulence model
k ( u 2 v 2 )5 / 6
H ( u, v ) e
k = 0.0025
Mild turbulence Low turbulence
k = 0.001 k = 0.00025
(Images from Rafael C. Gonzalez and Richard E.
Wood, Digital Image Processing, 2nd Edition.
Estimation by Modeling: Motion Blurring
Assume that camera velocity is ( x0 (t ), y0 (t ))
The blurred image is obtained by
T
g ( x, y ) f ( x x0 (t ), y y0 (t ))dt
0
j 2 ( ux vy )
G ( u, v ) g ( x , y ) e dxdy
T
j 2 ( ux vy )
f ( x x0 (t ), y y0 (t ))dt e dxdy
0
T
f ( x x0 (t ), y y0 (t ))e j 2 ( ux vy )
dxdy dt
0
Estimation by Modeling: Motion Blurring (cont.)
T
G (u, v ) f ( x x0 (t ), y y0 (t ))e j 2 ( ux vy )
dxdy dt
0
T
F (u, v )e j 2 ( ux0 ( t ) vy0 ( t )) dt
0
T
F (u, v ) e j 2 ( ux0 ( t ) vy0 ( t )) dt
0
Noise is enhanced
when H(u,v) is small.
To avoid the side effect of enhancing
noise, we can apply this formulation
to freq. component (u,v) with in a
radius D0 from the center of H(u,v).
In practical, the inverse filter is not
Popularly used. (Images from Rafael C. Gonzalez and Richard E.
Wood, Digital Image Processing, 2nd Edition.
Inverse Filter: Example
Difficult to estimate
Approximated Formula:
1 H ( u , v )
2
Fˆ (u, v ) 2 G ( u , v )
H (u, v ) H (u, v ) K
Practically, K is chosen manually to obtained the best visual result!
Wiener Filter: Example
2=325
Note: K is
chosen
manually
M 1 N 1
2
C 2
f ( x, y )
x 0 y 0
2=325
2=130
Constrained Least Squares Filter:Adjusting
2
Define r g Hfˆ It can be shown that ( ) r r r
T
2 2
We want to adjust gamma so that r η a 1
Stop if is satisfied
1 2 2
Otherwise return step 2 after increasing if r η a
2 2
or decreasing if r η a
Use the new value of to recompute
H *
( u , v )
Fˆ (u, v ) 2 2
G ( u, v )
H (u, v ) P(u, v )
Constrained Least Squares Filter:Adjusting (cont.)
H *
( u , v )
Fˆ (u, v ) 2 2
G ( u, v )
H (u, v ) P(u, v )
2
R (u, v ) G (u, v ) H (u, v ) Fˆ (u, v ) For computing r
M 1 N 1
1
( x, y )
2
r r 2
MN x 0 y 0
M 1 N 1
1
m
MN
( x, y )
x 0 y 0
M 1 N 1
( x, y ) m
2
1 For computing η
2
2
MN x 0 y 0
2
η MN 2 m
Constrained Least Squares Filter: Example
Original image Use correct noise
parameters Correct parameters:
Initial = 10-5
Correction factor = 10-6
a = 0.25
2 = 10-5
y s( x, y ) c5 x c6 y c7 xy c8 ( x, y ) ( x, y )
Use nearest
neighbor
intepolation
(Images from Rafael C.
Gonzalez and Richard E.
Wood, Digital Image
Processing, 2nd Edition.
Geometric Distortion and Restoration Example (cont.)
Original image and Tiepoints of distorted
tiepoints image
Use bilinear
intepolation
(Images from Rafael C.
Gonzalez and Richard E.
Wood, Digital Image
Processing, 2nd Edition.
Example: Geometric Restoration
Original image Geometrically distorted
image
Use the same
Spatial Trans.
as in the previous
example
Restored image