Aug 12, 2020
ECE 468: Digital Image Processing
Lecture 13
Prof. Sinisa Todorovic
Outline
• Image Restoration by Filtering (Textbook 5.3)
Image Restoration in the Frequency Domain
G(u, v) = H(u, v)F (u, v) + N(u, v)
F̂ (u, v) = G(u, v)HR(u, v)
Review
Var[cX] = c2Var[X]
Var[c + X] = Var[X]
E[c + X] = c + E[X]
E[cX] = cE[X]
Expected value
Variance
X random variable c deterministic constant
Review
Expected value
Variance
E[g(x, y)] = f(x, y) ⇤ h(x, y) + E[⌘(x, y)]
g(x, y) = f(x, y) ⇤ h(x, y) + ⌘(x, y)
Var[g(x, y)] = E[g(x, y)2]� E
2[g(x, y)]
corruptedimage
Var[g(x, y)] = Var[⌘(x, y)]
Gaussian Noise + Arithmetic vs. Geometric Mean Filter
g(x, y) = f(x, y) + �(x, y)
Sxy
filterwindow
inputoutput
arithmetic mean filtering
geometric mean filtering
f̂(x, y) =
�
⇤⇧
(s,t)�Sxy
g(s, t)
⇥
⌅
1mn
f̂(x, y) =1
mn
�
(s,t)�Sxy
g(s, t)
arithmetic mean geometric mean
Gaussian Noise + Arithmetic vs. Geometric Mean Filter
g(x, y) = f(x, y) + �(x, y)
Sxy
filterwindow
inputoutput
arithmetic mean filtering
geometric mean filtering
f̂(x, y) =
�
⇤⇧
(s,t)�Sxy
g(s, t)
⇥
⌅
1mn
f̂(x, y) =1
mn
�
(s,t)�Sxy
g(s, t)
arithmetic mean geometric mean
Salt-and-Pepper Noise + Median Filter
g(x, y) = f(x, y) + �(x, y)
Sxy
filterwindow
inputoutput
median filtering
f̂(x, y) = median(s,t)�Sxyg(s, t)
repeated application of median filter
Adaptive Filter
mSxy =1
mn
�
(s,t)�Sxy
g(s, t)
f̂(x, y) = g(x, y)��2
�
�2Sxy
�g(x, y)�mSxy
⇥
arithmetic mean
arithmetic variance �2
Sxy=
1mn
�
(s,t)�Sxy
(g(s, t)�mSxy )2
output of the filter
Gaussian Noise + Adaptive Filter
Properties:
• Zero-noise
• On edges
f̂(x, y) = g(x, y)��2
�
�2Sxy
�g(x, y)�mSxy
⇥
�2� = 0 � f̂(x, y) = g(x, y)
�2� � �2
Sxy� f̂(x, y) = g(x, y)
Adaptive Filter
f̂(x, y) = g(x, y)��2
�
�2Sxy
�g(x, y)�mSxy
⇥
= g(x, y) ⇤
0
@
2
40 0 00 1 00 0 0
3
5��
2⌘
�
2S
xy
2
40 0 00 1 00 0 0
3
5� 1mn
2
41 1 11 1 11 1 1
3
5
1
A
Gaussian Noise + Adaptive Filter
Degradation Modeling
Degradation Modeling
g(x, y) = h(x, y) ⇤ f(x, y) + �(x, y)
G(u, v) = H(u, v)F (u, v) + N(u, v)
Modeling Degradation Due to Atmospheric Turbulence
H(u, v) = e�k(u2+v2)5/6
Modeling Uniform Linear Motion Blur
Modeling Uniform Linear Motion Blur
g(x, y) =� T
0f(x� x0(t), y � y0(t))dt
T - duration of the exposure
blurred output:
Modeling Uniform Linear Motion Blur
g(x, y) =� T
0f(x� x0(t), y � y0(t))dt
T - duration of the exposure
blurred output:
G(u, v) = F (u, v)� T
0e�2j�[ux0(t)+vy0(t)]dt
Modeling Uniform Linear Motion Blur
g(x, y) =� T
0f(x� x0(t), y � y0(t))dt
T - duration of the exposure
blurred output:
G(u, v) = F (u, v)� T
0e�2j�[ux0(t)+vy0(t)]dt
� H(u, v) =� T
0e�2j�[ux0(t)+vy0(t)]dt
Modeling Uniform Linear Motion Blur
x0(t) =at
Ty0(t) =
bt
T
H(u, v) =� T
0e�2j�[ux0(t)+vy0(t)]dt
=T
�(ua + vb)sin[�(ua + vb)]e�j�(ua+ub)
Image Restoration
Image Restoration by Inverse Filtering
G(u, v) = H(u, v)F (u, v) + N(u, v)
F̂ (u, v) =G(u, v)H(u, v)
Image Restoration by Inverse Filtering
G(u, v) = H(u, v)F (u, v) + N(u, v)
Image Restoration by Inverse Filtering
F̂ (u, v) = F (u, v) +N(u, v)H(u, v)
G(u, v) = H(u, v)F (u, v) + N(u, v)
Inverse Filtering
Bad news:
• Even when H(u,v) is known, there is always unknown noise
• Often H(u,v) has values close to zero
F̂ (u, v) = F (u, v) +N(u, v)H(u, v)
Example: Inverse Filtering
H(u, v) = exp⇤�k
�(u�M/2)2 + (v �N/2)2
⇥5/6⌅
Atmospheric turbulence effect
Example: Inverse Filtering
G(u, v)H(u, v)
Wiener Filtering = Mean Squared Error Filtering
• Incorporates both:
• Degradation function
• Statistical characteristics of noise
• Assumption: noise and the image are uncorrelated
• Optimizes the filter so that MSE is minimized
Wiener Filter — Derivation
Parseval’s Theorem
Unknown original
Corruptedoriginal
Wienerfilter
unknown original after Wiener filtering
Wiener Filter — Derivation
Parseval’s Theorem
Unknown original
Corruptedoriginal
Wienerfilter
unknown original after Wiener filtering
Wiener Filter — Derivation
Unknown original
Corruptedoriginal
Wienerfilter
Wiener Filter — Derivation
independent signals
Wiener Filter — Derivation
Wiener Filter — Derivation
Wiener Filter — Derivation
Wiener Filter — Derivation
inverse filter
Wiener Filter -- Approximation
Signal-to-noise ratio
Example: Wiener Filtering
Example: Wiener Filtering
Next Class
• Image reconstruction from projections (Textbook 5.11)
• Radon Transform (Textbook 5.11.3)