Image Restoration - Filters
Image Restoration - Filters
Image Restoration
1 ( z ) 2 / 2 2
p( z ) e
2
• Exponential noise
ae az for z 0
p ( z )
0 for z 0
The mean and variance of
this density are given by
Special case 1
pf Erlang
1 / a and 2 2
PDF with b=1 a
Other Noise Models
• Uniform noise
1
if a z b
p ( z ) b a
0 otherwise
The mean and
variance of this
density are given by
2
(b a )
(a b) / 2 and 2
12
Other Noise Models
• Impulse (salt-and-
pepper) noise
Pa for z a
p ( z ) Pb for z b
0 otherwise
If either Pa or Pb is
zero, the impulse noise
is called unipolar
a and b usually are
extreme values
because impulse
corruption is usually
large compared with
the strength of the
image signal
It is the only type of
noise that can be
Periodic Noise
• Arises typically from
electrical or
electromechanical
interference during image
acquisition
• It can be observed by
visual inspection both in
the spatial domain and
frequency domain
• The only spatially
dependent noise will be
considered
Estimation of Noise Parameters
• Periodic noise
Parameters can be estimated by inspection of
the spectrum
• Noise PDFs
From sensor specifications
If imaging sensors are available, capture a set of
images of plain environments
If only noisy images are available, parameters of
the PDF involved can be estimated from small
patches of constant regions of the noisy images
Estimation of Noise Parameters
2 1
2 i i
N S 1 ( xi , yi )S
( z ( x , y ) ˆ ) 2
Restoration in the Presence of Noise
Only (De-Noising)
• Mean filters
1
Arithmetic mean filter fˆ ( x, y ) g ( s, t )
g(x,y) is the corrupted image mn ( s ,t )S x , y
S is the mask 1
x,y
mn
ˆ
Geometric mean filtersf ( x, y ) g ( s, t )
Tends to preserve more details ( s ,t )S x , y
Harmonic mean filter fˆ ( x, y )
mn
1
( s ,t )S x , y g ( s, t )
Works well for salt noise but fails for pepper noise
Contraharmonic mean filter
Q: order of the filter
Positive Q works for pepper noise
g ( s, t ) Q 1
ˆ ( x, y ) ( s ,t )S x , y
f
Negative Q works for salt noise
Q=0arithmetic mean filter
g ( s, t ) Q
( s ,t )S x , y
Q=-1harmonic mean filter
Filters Based on Order Statistics
(De-Noising)
fˆ ( x, y ) median{g ( s, t )}
• Median filter (s,t)S x,y
L
2
L
If , the output takes the mean value
2 2
L
That is:
2
is set to be 1
L 2
2
At edges, it is assumes thatL 2
Adaptive Median Filter
(De-Noising)
n =1
Bandreject Filters
• Gaussian bandreject filter
1 D 2 ( u ,v ) D02
2 D ( u ,v )W
H (u , v) 1 e
Bandbass Filters
Bandpass filter performs the opposite of a
bandpass filter
H bp (u , v) 1 H br (u , v)
Notch Filters
D1 (u , v) u M / 2 u0 v N / 2 v0
2 2 1/ 2
D (u , v) u M / 2 u v N / 2 v
2 2 1/ 2
2 0 0
Notch Filters
H np (u , v) 1 H nr (u , v)
w( x s, y t )ˆ ( x s, y t )]
[ g ( x, y ) w( x, y )ˆ ( x, y ]}2
w( x s, y t )ˆ ( x s, y t )]
[ g ( x, y ) w( x, y )ˆ ( x, y )}2
To minimize 2 ( x, y )
2 ( x, y )
0
w( x, y )
g ( x, y )ˆ ( x, y ) g ( x, y )ˆ ( x, y )
w( x, y )
ˆ 2 ( x, y ) ˆ 2 ( x, y )
Linear, Position-Invariant
Degradation
• Degradation Model
g ( x, y ) H [ f ( x, y )] ( x, y )
In the absence of additive noise:
For scalar values of a and b, H is
linear
H [if:
a f ( x, y ) b f ( x, y )] a H [ f ( x, y )] b H [ f 2 ( x, y )]
1 2 1
H is Position-Invariant if:
g ( x, y ) H [ f ( x, y )] H [ f ( x , y )] g ( x , y )
Linear, Position-Invariant
Degradation
In the presence of additive noise:
g ( x, y ) f ( , )h( x , y )d d ( x, y )
g ( x, y ) h( x, y ) * f ( x, y ) ( x, y )
G (u , v) H (u , v) F (u , v) N (u , v)
H (u , v)
Now, we construct a function on a large
scale, but having the same shape.
Estimating by Experimentation
• We try to obtain impulse response of the
degradation by imaging an impulse (small
dot of light) using the system. Therefore
G (u , v)
H (u , v)
A
Estimating by Modeling
k ( u 2 v 2 ) 5 / 6
H (u , v) e
Atmospheric turbulence model:
High
turbulence
k=0.0025
Negligible
turbulence
Low
Mid turbulence
turbulence k=0.00025
k=0.001
H.R. Pourreza
Estimating by Modeling
Blurring by linear motion:
T
g ( x, y ) f [ x x0 (t ), y y0 (t )]dt
0
T
G (u , v) F (u , v) e j 2 [ux0 ( t ) vy0 (t )]dt
0
T
H (u , v) e j 2 [ux0 (t ) vy0 (t )]dt
0 T
T
sin( ua )e j ua
ua
Estimating by Modeling
if x 0 ( t ) at / T and y 0 ( t ) bt / T
T
H (u, v) sin[ (ua vb)]e j ( ua vb )
(ua vb)
H.R. Pourreza
Inverse Filtering
The simplest approach to restoration is direct
inverse filtering:
ˆ G (u , v) Even if we know the
F (u , v) degradation function,
H (u , v)
we cannot recover
N (u , v) the un-degraded
Fˆ (u , v) F (u, v) image
H (u, v)
e 2 E[( f fˆ ) 2 ]
2
S ( u , v ) N ( u , v ) power spectrum of the noise
2
S f (u , v ) F ( u , v ) power spectrum of the undegraded im age
Minimum Mean Square Error Filtering
(Wiener Filtering)
1 H (u , v )
2
Fˆ (u, v) 2
G (u, v)
H (u, v) H (u, v) S (u, v) / S f (u , v)
Constan Unknow
t n
1 H ( u , v )
2
Fˆ (u , v) 2
G (u, v)
H (u, v) H (u , v) K
Geometric Transformations
• Unlike the techniques discussed so far,
geometric transformations modify the
spatial relationships between pixels in an
image.
x r ( x, y )
y s ( x , y )
x r ( x, y ) c1 x c2 y c3 xy c4
y s ( x, y ) c5 x c6 y c7 xy c8
Gray-level Interpolation