Introduction to Digital Image Processing

EE4328, Section 005
Introduction to Digital Image Processing
Linear Image Restoration
Zhou Wang
Dept. of Electrical Engineering
The Univ. of Texas at Arlington
Fall 2006
Blur
out-of-focus blur
motion blur
Question 1: How do you know they are blurred?
I’ve not shown you the originals!
Question 2: How do I deblur an image?
From Prof.
Xin Li
Linear Blur Model
• Spatial domain
x(m,n)
h(m,n)
y(m,n)
blurring filter
From Prof.
Xin Li
Gaussian blur
motion blur
Linear Blur Model
• Frequency (2D-DFT) domain
X(u,v)
H(u,v)
Y(u,v)
blurring filter
From Prof.
Xin Li
Gaussian blur
motion blur
Blurring Effect
Gaussian blur
motion blur
From [Gonzalez & Woods]
Image Restoration: Deblurring/Deconvolution
x(m,n)
h(m,n)
blurring filter
y(m,n)
g(m,n)
^
x(m,n)
deblurring/
deconvolution
filter
• Non-blind deblurring/deconvolution
Given: observation y(m,n) and blurring function h(m,n)
x(m,n)
Design: g(m,n), such that the distortion between x(m,n) and ^
is minimized
• Blind deblurring/deconvolution
Given: observation y(m,n)
^
Design: g(m,n), such that the distortion between x(m,n) and x(m,n)
is minimized
Deblurring: Inverse Filtering
x(m,n)
h(m,n)
y(m,n)
blurring filter
X(u,v) H(u,v) = Y(u,v)
X(u,v) =
Y(u,v)
1
=
Y(u,v)
H(u,v)
H(u,v)
g(m,n)
^
x(m,n)
inverse filter
1
G(u,v) =
H(u,v)
Exact recovery!
Deblurring: Pseudo-Inverse Filtering
x(m,n)
h(m,n)
y(m,n)
blurring filter
1
Inverse filter: G(u,v) =
H(u,v)
g(m,n)
^
x(m,n)
deblur filter
What if at some (u,v), H(u,v)
is 0 (or very close to 0) ?
 1
| H (u, v) | 

Pseudo-inverse filter: G(u, v)   H (u, v)

| H (u, v) | 
 0
small
threshold
Inverse and Pseudo-Inverse Filtering
G (u, v) 
1
H (u, v)
blurred image
 1
| H (u, v) | 

G(u, v)   H (u, v)

| H (u, v) | 
 0
Adapted from Prof. Xin Li
 = 0.1
More Realistic Distortion Model
w(m,n)
x(m,n)
h(m,n)
blurring filter
+
additive white Gaussian noise
y(m,n)
g(m,n)
^
x(m,n)
deblur filter
Y(u,v) = X(u,v) H(u,v) + W(u,v)
• What happens when an inverse filter is applied?
X (u , v) H (u , v)  W (u , v)
ˆ
X (u , v)  Y (u , v)G (u , v) 
H (u , v)
W (u , v)
close to zero at high frequencies
 X (u , v) 
H (u , v)
Radially Limited Inverse Filtering

Radially limited

G
(
u
,
v
)

 H (u, v)
inverse filter:


1
u 2  v2  R
0
u 2  v2  R
• Motivation
R
– Energy of image signals is
concentrated at low frequencies
– Energy of noise uniformly is
distributed over all frequencies
– Inverse filtering of image signal
dominated regions only
Radially Limited Inverse Filtering
Image
size:
480x480
Original
Blurred
Inverse filtered
R = 40
R = 70
R = 85
Radially
limited
inverse
filtering:
From [Gonzalez & Woods]
Wiener (Least Square) Filtering
Wiener filter: G (u, v) 
H * (u, v)
| H (u, v) |2  K
 W2
K 2
X
noise power
signal power
• Optimal in the least MSE sense, i.e.
G(u, v) is the best possible linear filter that minimizes
2

ˆ
error energy  E  X (u, v)  X (u, v) 



• Have to estimate signal and noise power
Weiner Filtering
Blurred
image
Inverse
filtering
Radially limited
inverse filtering
R = 70
Weiner
filtering
From [Gonzalez & Woods]
Inverse vs. Weiner Filtering
distorted
inverse filtering Wiener filtering
motion blur
+
noise
less noise
less noise
From [Gonzalez & Woods]
Weiner Image Denoising
w(m,n)
x(m,n)
h(m,n)
+
y(m,n)
• What if no blur, but only noise, i.e. h(m,n) is an impulse
or H(u, v) = 1 ?
Wiener filter:
H * (u, v)
G (u, v) 
| H (u, v) |2  K
where
 W2
K 2
X
for H(u,v) = 1
Wiener
denoising filter:
1
1
 X2
G (u, v) 

 2
2
2
1  K 1   W /  X  X   W2
Typically applied locally in space
Weiner Image Denoising
adding noise
noise var = 400
local Wiener
denoising
Summary of Linear Image Restoration Filters
Inverse filter:
Pseudo-inverse
filter:
Radially limited
inverse filter:
Wiener filter:
Wiener
denoising filter:
1
G(u,v) =
H(u,v)
 1
| H (u, v) | 

G(u, v)   H (u, v)

| H (u, v) | 
 0
 1

G (u, v)   H (u, v)
 0

u 2  v2  R
u 2  v2  R
 W2
H * (u, v)
where K  2
G (u, v) 
2
X
| H (u, v) |  K
 X2
G (u, v)  2
 X   W2
Examples
• A blur filter h(m,n) has a 2D-DFT given by
1
 0.3  0.3 j

 0.3  0.3 j
0.1 j

H (u, v) 

0
0

0.1
 0.3  0.3 j
0  0.3  0.3 j 

0
0.1


0
0

0
 0.1 j 
• Find the deblur filter G(u,v) using
1) The inverse filtering approach
2) The pseudo-inverse filtering approach, with  = 0.05
3) The pseudo-inverse filtering approach, with  = 0.2
2

4) Wiener filtering approach, with   625 and W  125
2
X
Examples
1) Inverse filter
1
 1.67  1.67 j

 1.67  1.67 j
 10 j
1

G (u, v) 

Inf
Inf
H (u, v) 

10
 1.67  1.67 j
Inf
Inf
Inf
Inf
 1.67  1.67 j 

10


Inf

10 j

2) Pseudo-inverse filter, with  = 0.05
1
 1.67  1.67 j


 1
 10 j
| H (u, v) |   1.67  1.67 j

G (u, v)   H (u, v)


0
0
 0
| H (u, v) |  
10
 1.67  1.67 j
0  1.67  1.67 j 

0
10


0
0

0
10 j

Examples
3) Pseudo-inverse filter, with  = 0.2
1
 1.67  1.67 j


 1
0
| H (u, v) |   1.67  1.67 j

G (u, v)   H (u, v)


0
0
 0
| H (u, v) |  
0
 1.67  1.67 j
0  1.67  1.67 j 

0
0


0
0

0
0

4) Wiener filter, with  X2  625 and  W2  125
 W2 125
K 2 
 0.2
 X 625
0.83
 0.79  0.79 j

 0.79  0.79 j
 0.48 j
H * (u, v)

G (u, v) 

0
0
| H (u, v) |2  K 

0.48
 0.79  0.79 j
0  0.79  0.79 j 

0
0.48


0
0

0
0.48 j

Advanced Image Restoration
• Adaptive Processing
– Spatial adaptive
– Frequency adaptive
• Nonlinear Processing
– Thresholding, coring …
– Iterative restoration
• Advanced Transformation / Modeling
– Advanced image transforms, e.g., wavelet …
– Statistical image modeling
• Blind Deblurring / Deconvolution