Unit 3 DIP
Unit 3 DIP
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 sh2 is zero, No noise
the filter should return g(x,y) because g(x,y) = f(x,y)
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
sh2=325
Note: K is
chosen
manually