You are on page 1of 18

2002-2003 by Yu Hen Hu

1
ECE533 Digital Image Processing
Image Restoration
2002-2003 by Yu Hen Hu
2
ECE533 Digital Image Processing
What is Image Restoration
q
The purpose of image restoration is to restore a
degraded/distorted image to its original content and
quality.
q
Distinctions to Image Enhancement
Image restoration assumes a degradation model that is known
or can be estimated.

Original content and quality Good looking


2002-2003 by Yu Hen Hu
3
ECE533 Digital Image Processing
Image Degradation Model
q
Spatial variant degradation model
q
Spatial-invariant degradation model

Frequency domain representation


( , ) ( , , , ) ( , ) ( , ) g x y h x y m n f m n x y +

( , ) ( , ) ( , ) ( , ) g x y h x m y n f m n x y +

( , ) ( , ) ( , ) ( , ) G u v H u v F u v N u v +
2002-2003 by Yu Hen Hu
4
ECE533 Digital Image Processing
Noise Models
q
Most types of noise are
modeled as known probability
density functions
q
Noise model is decided based
on understanding of the
physics of the sources of noise.
Gaussian: poor illumination
Rayleigh: range image
Gamma, exp: laser imaging
Impulse: faulty switch during
imaging,
Uniform is least used.
q
Parameters can be estimated
based on histogram on small
flat area of an image
2002-2003 by Yu Hen Hu
5
ECE533 Digital Image Processing
Noise Removal Restoration
Method
q
Mean filters

Arithmetic mean filter

Geometric mean filter

Harmonic mean filter


Contra-harmonic mean
filter
q
Order statistics filters
Median filter
Max and min filters
Mid-point filter
alpha-trimmed filters
q
Adaptive filters

Adaptive local noise


reduction filter

Adaptive median filter


2002-2003 by Yu Hen Hu
6
ECE533 Digital Image Processing
Mean Filters
,
( , )
1

( , ) ( , )
x y
s t S
f x y g s t
mn


,
1
( , )

( , ) ( , )
x y
mn
s t S
f x y g s t

]
]
]

2002-2003 by Yu Hen Hu
7
ECE533 Digital Image Processing
Contra-Harmonic Filters
[ ]
[ ]
,
,
1
( , )
( , )
( , )

( , )
( , )
x y
x y
Q
s t S
Q
s t S
g s t
f x y
g s t
+

2002-2003 by Yu Hen Hu
8
ECE533 Digital Image Processing
Median Filter
{
,
( , )

( , ) ( , )
x y
s t S
f x y median g s t

Effective for
removing salt-and-
paper (impulsive)
noise.
2002-2003 by Yu Hen Hu
9
ECE533 Digital Image Processing
LSI Degradation Models
q
Motion Blur
Due to camera panning or fast
motion
q
Atmospheric turbulence blur
Due to long exposure time
through atmosphere
Hufnagel and Stanley
q
Uniform out-of-focus blur:
q
Uniform 2D Blur
min max
1 0,
( , )
0 .
ai bj i i i
h i j
otherwise
+

'

2 2
2
( , ) exp
2
i j
h i j K

| ` +


. ,
2 2 2
2
1
( , )
0 .
i j R
h i j
R
otherwise

'

2
1
/ 2 , / 2
( , )
0 .
L i j L
h i j
L
otherwise

'

( )
( )
5/ 6
2 2
( , ) exp h i j k i j +
2002-2003 by Yu Hen Hu
10
ECE533 Digital Image Processing
Turbulence Blur Examples
( )
( )
5/ 6
2 2
( , ) exp h i j k i j +
2002-2003 by Yu Hen Hu
11
ECE533 Digital Image Processing
Motion Blur
q
Often due to camera
panning or fast object
motion.
q
Linear along a specific
direction.
b l u r r i n g f i l t e r
2 0 4 0 6 0
2 0
4 0
6 0
b l u r r i n g f i l t e r m a s k
2 4 6 8
2
4
6
8
original image
20 40 60
10
20
30
40
50
60
blurredimage
20 40 60
10
20
30
40
50
60
Blurdemo.m
2002-2003 by Yu Hen Hu
12
ECE533 Digital Image Processing
Inverse Filter
q
Recall the degradation
model:
Given H(u,v), one may
directly estimate the original
image by
At (u,v) where H(u,v) 0, the
noise N(u,v) term will be
amplified!
( , ) ( , ) ( , ) ( , ) G u v H u v F u v N u v +

( , ) ( , ) / ( , )
( , )
( , )
( , )
F u v G u v H u v
N u v
F u v
H u v

+
o r i g i n a l , f
2 0 4 0 6 0
2 0
4 0
6 0
d e g r a d e d : g
2 0 4 0 6 0
2 0
4 0
6 0
i n ve r s e fi l t e r
2 0 4 0 6 0
2 0
4 0
6 0
Invfildemo.m
2002-2003 by Yu Hen Hu
13
ECE533 Digital Image Processing
Wiener Filtering
q
Minimum mean-square error
filter
Assume f and are both 2D
random sequences,
uncorrelated to each other.
Goal: to minimize
Solution: Frequency selective
scaling of inverse filter solution!
White noise, unknown S
f
(u,v):
{
2

E f f
2
2
( , )
( , )

( , )
( , )
( , ) ( , ) / ( , )
f
H u v
G u v
F u v
H u v
H u v S u v S u v


+
2
2
( , )
( , )

( , )
( , )
( , )
H u v
G u v
F u v
H u v
H u v K

+
o r i g i n a l , f
2 0 4 0 6 0
2 0
4 0
6 0
d e g r a d e d : g
2 0 4 0 6 0
2 0
4 0
6 0
W i e n e r f i l t e r , K = 0 . 2
2 0 4 0 6 0
2 0
4 0
6 0
i n ve r s e fi l t e r
2 0 4 0 6 0
2 0
4 0
6 0
2002-2003 by Yu Hen Hu
14
ECE533 Digital Image Processing
Derivation of Wiener Filters
q
Given the degraded
image g, the Wiener filter
is an optimal filter h
win
such
that E{|| f h
win
g||
2
} is
minimized.
q
Assume that f and are
uncorrelated zero mean
stationary 2D random
sequences with known
power spectrum S
f
and S
n
.
Thus,
{ {
{ {
{ {
( )
2 2
2
2 2
2 2
( , ) ( , ) ( , )
( , ) ( , ) ( , ) ( , )
( , ) ( , ) ( , ) ( , ) ( , )
( , ) ( , ) ( , ) ( , ) ( , )
( , ) ( , ) ( , ) ( , ) (
win win
H
win
H H
win win
f win f n
H H
win f win
C E f h g E F u v H u v G u v
E F u v H u v E F u v G u v
H u v E F u v G u v H u v E G u v
S u v H u v H u v S u v S u v
H u v H u v S u v H u v H u


+
+ +
, ) ( , )
f
v S u v
{
{
{
{
2
2
( , ) ( , )
( , ) ( , )
( , ) ( , )
( , ) ( , ) 0
f
n
H
H
E F u v S u v
E N u v S u v
E F u v N u v
E F u v N u v


*
2
( , ) 0
( , ) ( , )
( , )
( , ) ( , ) ( , )
Set C/
win
f
win
f n
H u v
H u v S u v
H u v
H u v S u v S u v

+
2002-2003 by Yu Hen Hu
15
ECE533 Digital Image Processing
Constrained Least Square (CLS) Filter
q
For each pixel, assume the
noise has a Gaussian
distribution. This leads to a
likelihood function:
q
A constraint representing prior
distribution of f will be imposed:
the exponential form of pdf of f
is known as the Gibbs
distribution.
q
Since L(f) p(g|f), use
Bayes rule,
since g is given, to maximize
the posterior probability, one
should minimize
q
q is an operator based on
prior knowledge about f. For
example, it may be the
Laplacian operator!
2
2
1
( ) exp **
2
L f g h f



' '

{
2
( ) exp ** p f q f
( | ) ( | ) ( ) / ( ) p f g p g f p f p g
2 2
** ** g h f q f +
2002-2003 by Yu Hen Hu
16
ECE533 Digital Image Processing
Intuitive Interpretation of CLS
q
Prior knowledge: Most
images are smooth ||
q**f|| should be
minimized
q
However, the restored
image , after
going through the same
degradation process h,
should be close to the
given degraded image
g.
q
The difference between
g and is
bounded by the amount
of the additive noise:
q
In practice, || || is
unknown and needs to
be estimated with the
variance of the noise

( , ) f x y

( , ) ** ( , ) h x y f x y
2 2
** g h f
2002-2003 by Yu Hen Hu
17
ECE533 Digital Image Processing
Solution and Iterative Algorithm
To minimize C
CLS
, Set
C
CLS
/ F = 0. This yields
The value of however, has
to be determined iteratively! It
should be chosen such that
Iterative algorithm (Hunt)
1. Set initial value of ,
2. Find , and compute
R(u,v).
3. If ||R||
2
- ||N||
2
< - a, set =
B
L
, increase , else if
||R||
2
- ||N||
2
> a, set = B
u
,
decrease , else stop
iteration.
4.
new
= (B
u
+B
L
)/2, go to step 2.
2
2 2
( , ) ( , ) ( , )
( , ) ( , ) ( , )
CLS
C G u v H u v F u v
N u v Q u v F u v

+
*
2 2
( , )

( , ) ( , )
( , ) ( , )
H u v
F u v G u v
H u v Q u v

+
2
2
2 2

( , ) ( , ) ( , ) ( , )
( , ) ( , )
G u v H u v F u v N u v
R u v N u v a

<

( , ) F u v
2002-2003 by Yu Hen Hu
18
ECE533 Digital Image Processing
CLS Demonstration
iteration1, gamma=5.0005
20 40 60
20
40
60
iteration4, gamma=0.62594
20 40 60
20
40
60
iteration7, gamma=0.079117
20 40 60
20
40
60
iteration10, gamma=0.010765
20 40 60
20
40
60
iteration13, gamma=0.0022206
20 40 60
20
40
60
iteration15, gamma=0.0028309
20 40 60
20
40
60

You might also like