Professional Documents
Culture Documents
Image Restoration
EE 604
Govind Sharma
11/4/2019
G. Sharma Restoration
Restoration Model
Restoration in presence of noise only
Restoration in presence of blur and noise
Outline
Restoration Model
G. Sharma Restoration
Restoration Model
Restoration in presence of noise only
Restoration in presence of blur and noise
Image Restoration
G. Sharma Restoration
Restoration Model
Restoration in presence of noise only
Restoration in presence of blur and noise
Restoration Model
G. Sharma Restoration
Restoration Model
Restoration in presence of noise only
Restoration in presence of blur and noise
Potential degradations
G. Sharma Restoration
Restoration Model
Restoration in presence of noise only
Restoration in presence of blur and noise
Restoration Goal
Usually, it will not be possible to restore perfectly the observed
image. We try to minimize an error criterion. Minimum mean
squared error criterion
h i
E = E |fI (x , y ) − fˆ(x , y )|2
G. Sharma Restoration
Restoration Model
Restoration in presence of noise only
Restoration in presence of blur and noise
G. Sharma Restoration
Restoration Model
Restoration in presence of noise only
Restoration in presence of blur and noise
Test Pattern
G. Sharma Restoration
Restoration Model
Restoration in presence of noise only
Restoration in presence of blur and noise
Effect of noise
G. Sharma Restoration
Restoration Model
Restoration in presence of noise only
Restoration in presence of blur and noise
Effect of noise
G. Sharma Restoration
Restoration Model
Restoration in presence of noise only
Restoration in presence of blur and noise
Spatial filtering
1 X
fˆ[k, l] = g[i, j]
MN [i,j]∈S
kl
G. Sharma Restoration
Restoration Model
Restoration in presence of noise only
Restoration in presence of blur and noise
Spatial filtering
fˆ[k, l] =
Y
g[i, j]
[i,j]∈Skl
MN
fˆ[k, l] = P
1/g[i, j]
[i,j]∈Skl
It works well for salt noise, but fails for pepper noise.
G. Sharma Restoration
Restoration Model
Restoration in presence of noise only
Restoration in presence of blur and noise
G. Sharma Restoration
Restoration Model
Restoration in presence of noise only
Restoration in presence of blur and noise
Spatial filtering
g[i, j]Q+1
P
[i,j]∈Skl
fˆ[k, l] =
g[i, j]Q
P
[i,j]∈Skl
where Q is called the order of the filter. It works well for salt
noise if Q < 0, and for pepper noise if Q > 0. It reduces to
arithmetic mean if Q = 0 and harmonic mean if Q = −1.
G. Sharma Restoration
Restoration Model
Restoration in presence of noise only
Restoration in presence of blur and noise
Restoration example
G. Sharma Restoration
Restoration Model
Restoration in presence of noise only
Restoration in presence of blur and noise
Spatial filtering
G. Sharma Restoration
Restoration Model
Restoration in presence of noise only
Restoration in presence of blur and noise
Restoration example
G. Sharma Restoration
Restoration Model
Restoration in presence of noise only
Restoration in presence of blur and noise
σ 2
fˆ[k, l] = g[k, l] − n2 (g[k, l] − mL )
σL
where ML = local mean of the pixel values in Skl , σL2 = local
variance of the pixel values in Skl and σn2 = noise variance. If noise
variance is much smaller than local variance this filter returns the
estimated value close to observed value.
G. Sharma Restoration
Restoration Model
Restoration in presence of noise only
Restoration in presence of blur and noise
Restoration example
G. Sharma Restoration
Restoration Model
Restoration in presence of noise only
Restoration in presence of blur and noise
G. Sharma Restoration
Restoration Model
Restoration in presence of noise only
Restoration in presence of blur and noise
G. Sharma Restoration
Restoration Model
Restoration in presence of noise only
Restoration in presence of blur and noise
Restoration example
G. Sharma Restoration
Restoration Model
Restoration in presence of noise only
Restoration in presence of blur and noise
G. Sharma Restoration
Restoration Model
Restoration in presence of noise only
Restoration in presence of blur and noise
G. Sharma Restoration
Restoration Model
Restoration in presence of noise only
Restoration in presence of blur and noise
G. Sharma Restoration
Restoration Model
Restoration in presence of noise only
Restoration in presence of blur and noise
ZT
g(x , y ) = f (x − x0 (t), y − y0 (t))dt
0
Z∞ Z∞
G(u, v ) = g(x , y )e −j2π(ux +vy ) dxdy
−∞ −∞
Z∞ Z∞ ZT
= f (x − x0 (t), y − y0 (t))dte −j2π(ux +vy ) dxdy
−∞ −∞ 0
G. Sharma Restoration
Restoration Model
Restoration in presence of noise only
Restoration in presence of blur and noise
ZT Z∞ Z∞
G(u, v ) = f (x − x0 (t), y − y0 (t))e −j2π(ux +vy ) dxdydt
0 −∞ −∞
ZT
= F (u, v )e −j2π(ux0 (t)+vy0 (t)) dt
0
ZT
= F (u, v ) e −j2π(ux0 (t)+vy0 (t)) dt
0
ZT
H(u, v ) = e −j2π(ux0 (t)+vy0 (t)) dt
0
G. Sharma Restoration
Restoration Model
Restoration in presence of noise only
Restoration in presence of blur and noise
ZT
H(u, v ) = e −j2π(uat/T +vbt/T ) dt
0
T
= sin(π(ua + vb))e −jπ(ua+vb)
π(ua + vb)
G. Sharma Restoration
Restoration Model
Restoration in presence of noise only
Restoration in presence of blur and noise
G. Sharma Restoration
Restoration Model
Restoration in presence of noise only
Restoration in presence of blur and noise
Restoration methods
G. Sharma Restoration
Restoration Model
Restoration in presence of noise only
Restoration in presence of blur and noise
Inverse filtering
1
Q(u, v ) = H(u,v )
F̂ (u, v ) = Q(u, v )G(u, v )
N(u,v )
= F (u, v ) + H(u,v )
G. Sharma Restoration
Restoration Model
Restoration in presence of noise only
Restoration in presence of blur and noise
Wiener Filter
Let us first consider 1-D case. Let y [k] be observed sequence and
s[k] is a sequence we want to estimate. We assume that these two
processes are zero mean jointly wide sense stationery sequences
with known auto and cross correlation functions. Estimation
method is linear minimum mean squared error criterion. Let w [k]
represent the impulse response and W (u) its Fourier transform
then we want to minimize
E = E [|s[k] − ŝ[k]|2 ]
G. Sharma Restoration
Restoration Model
Restoration in presence of noise only
Restoration in presence of blur and noise
Wiener filter
∞
X
E [(s[k] − w [l]y [k − l])y [m]] = 0, −∞ < m < ∞
l=−∞
Taking expectation inside summation sign we get
∞
X
E [s[k]y [m]] = w [l]E [y [k − l]y [m]]
l=−∞
X∞
Rsy [k − m] = w [l]Ryy [k − m − l]
l=−∞
X∞
Rsy [n] = w [l]Ryy [n − l] (k-m=n)
l=−∞
Rsy [n] = w [n] ∗ Ryy [n]
Ssy (u) = W (u)Syy (u)
G. Sharma Restoration
Restoration Model
Restoration in presence of noise only
Restoration in presence of blur and noise
Wiener filter
Let
g[k] = h[k] ∗ f [k] + n[k]
Since noise n[k] is uncorrelated to f [k], we get Rgg [m] as sum of
two terms and so
G. Sharma Restoration
Restoration Model
Restoration in presence of noise only
Restoration in presence of blur and noise
Wiener filter
Wiener filter is
H ∗ (u)Sff (u)
W (u) =
|H(u)|2 Sff (u) + Snn (u)
G. Sharma Restoration
Restoration Model
Restoration in presence of noise only
Restoration in presence of blur and noise
G. Sharma Restoration
Restoration Model
Restoration in presence of noise only
Restoration in presence of blur and noise
G. Sharma Restoration
Restoration Model
Restoration in presence of noise only
Restoration in presence of blur and noise
Least squares
Recall that linear shift invariant model
g[k, l] = h[k, l] ∗ f [k, l] + n[k, l]
Suppose image has size M × N and filter has size J × K then
blurred image will have size (M + J − 1) × (N + K − 1). We can
write this relation ship in vector space form
g = Bf + n
We want to find a matrix C so that fˆ = C g and
k g − B fˆk2
is minimized. The minimum norm least square solution is given by
fˆ = B − g
where pseudo inverse B − is obtained via singular value
decomposition.
G. Sharma Restoration
Restoration Model
Restoration in presence of noise only
Restoration in presence of blur and noise
G. Sharma Restoration
Restoration Model
Restoration in presence of noise only
Restoration in presence of blur and noise
G. Sharma Restoration
Restoration Model
Restoration in presence of noise only
Restoration in presence of blur and noise
subject to constraint
k g − B fˆk2 = knk2
G. Sharma Restoration
Restoration Model
Restoration in presence of noise only
Restoration in presence of blur and noise
G. Sharma Restoration
Restoration Model
Restoration in presence of noise only
Restoration in presence of blur and noise
H ∗ (u, v )
F̂ (u, v ) = G(u, v )
|H(u, v )|2 + λ|P(u, v )|2
where λ is chosen to satisfy the constraint. If noise has variance σ 2
then knk2 = (M + J − 1) × (N + K − 1)σ 2 . For λ = 0 then we get
inverse filter. Problem is solved iteratively by trying various values
of λ.
G. Sharma Restoration
Restoration Model
Restoration in presence of noise only
Restoration in presence of blur and noise
G. Sharma Restoration
Restoration Model
Restoration in presence of noise only
Restoration in presence of blur and noise
References
G. Sharma Restoration