Professional Documents
Culture Documents
and restoration
Image Restoration
► Enhancement is the process of manipulating
an image so that the result is more suitable
than the original for a specific-application.
4/5/2020 2
1
A Model of Image Degradation/Restoration A Model of Image Degradation/Restoration
Process Process
4/5/2020 5 4/5/2020 6
► The principal sources of noise in digital images arise during ► White noise
image acquisition and/or transmission The Fourier spectrum of noise is constant
4/5/2020 8 4/5/2020 9
2
Noise Models (2) Noise Models (3)
4/5/2020 10 4/5/2020 11
The PDF of Gaussian random variable, z, is given by The PDF of Gaussian random variable, z, is given by
1 1
p( z ) e ( z z ) /2 p( z ) e ( z z ) /2
2 2 2 2
2 2
( 2 ), ( 2 )
4/5/2020 12 4/5/2020 13
3
Rayleigh Noise Erlang (Gamma) Noise
The PDF of Rayleigh noise is given by The PDF of Erlang noise is given by
2 a b z b 1 az
( z a )e
( z a )2 / b
for z a e for z 0
p( z ) b p( z ) (b 1)!
0 for z a 0 for z a
4/5/2020 14 4/5/2020 15
The mean and variance of this density are given by The mean and variance of this density are given by
z 1/ a z (a b) / 2
2 1/ a 2 2 (b a ) 2 /12
4/5/2020 16 4/5/2020 17
4
Impulse (Salt-and-Pepper) Noise
4/5/2020 20 4/5/2020 21
5
Examples of Noise: Noisy Images(2)
Linear, Position-Invariant Degradations
g ( x, y) H f ( x, y) ( x, y)
4/5/2020 22 4/5/2020 23
H is linear
H af1 ( x, y ) bf 2 ( x, y ) aH f1 ( x, y ) bH f 2 ( x, y) Assume for a moment that ( x, y ) 0
f1 and f 2 are any two input images. if H is a linear operator and position invariant,
H ( x , y ) h( x , y )
An operator having the input-output relationship g ( x, y ) H f ( x, y )
g ( x, y ) H f ( x, y ) is said to be position invariant
f ( , ) H ( x , y ) d d
if Convolution
integral in 2-D
H f ( x , y ) g ( x , y )
f ( , )h( x , y )d d
for any f ( x, y ) and any and .
4/5/2020 24 4/5/2020 26
6
Estimation of Degradation Model
Linear, Position-Invariant Degradations Degradation model:
g ( x, y ) f ( x, y ) h ( x, y ) ( x, y )
or
In the presence of additive noise, G ( u , v ) F ( u , v ) H ( u , v ) N ( u, v )
if H is a linear operator and position invariant,
Purpose: to estimate h(x,y) or H(u,v)
h ( x, y ) f ( x , y ) ( x, y )
Methods:
1. Estimation by Image Observation
G (u, v) H (u, v) F (u, v) N (u , v)
2. Estimation by Experiment
4/5/2020 27
3. Estimation by Modeling (Images from Rafael C. Gonzalez and Richard E.
Wood, Digital Image Processing, 2nd Edition.
System
Observation
H( )
DFT Subimage
Estimated Transfer Gs (u, v) g s ( x, y )
function A ( x, y ) g ( x, y )
Gs (u, v ) Restoration
H ( u, v ) H s ( u, v ) process by DFT DFT
Fˆs (u, v ) estimation
DFT Reconstructed DFT A ( x, y) A G ( u, v )
This case is used when we Fˆs ( u , v )
know only g(x,y) and cannot Subimage G ( u, v )
H ( u, v )
repeat the experiment! fˆs ( x, y) A (Images from Rafael C. Gonzalez and Richard E.
Wood, Digital Image Processing, 2nd Edition.
7
Estimation by Modeling
3. Mathematical Modeling (1) Used when we know physical mechanism underlying the image
formation process that can be expressed mathematically.
H (u , v) e k (u v 2 )5 / 6
2
k = 0.0025
k : a constant that depends on Mild turbulence Low turbulence
the nature of the turbulence
if k is increase Turbulence also increase
if k is decrease Turbulence also decrease k = 0.001
4/5/2020 35 k = 0.00025
(Images from Rafael C. Gonzalez and Richard E.
Wood, Digital Image Processing, 2nd Edition.
g ( x, y ) f x x0 (t ), y y0 (t ) dt
T
0
T j 2 ux0 ( t ) vy0 ( t )
F (u , v)e dt
0
T j 2 ux0 ( t ) vy0 ( t )
F (u , v) e dt
0
4/5/2020 37 4/5/2020 39
8
Mathematical Modeling (4) Mathematical Modeling (5)
T j 2 ux0 ( t ) vy0 ( t )
H (u , v ) e dt Suppose that the image undergoes uniform linear motion
0
in the x-direction and y-direction, at a rate given by
Suppose that the image undergoes uniform linear motion
x0 (t ) at / T and y0 (t ) bt / T
in the x-direction only, at a rate given by x0 (t ) at / T .
T j 2 ux0 ( t ) vy0 ( t )
T H (u , v ) e dt
H (u, v) e j 2 ux0 (t ) dt 0
0
T
T e j 2 [ ua vb ]t /T dt
e j 2 uat /T dt 0
0
T
T sin (ua vb) e j (ua vb )
sin( ua)e j ua (ua vb)
ua
4/5/2020 40 4/5/2020 41
Blur
9
Linear Blur Model Linear Blur Model
• Spatial domain • Frequency (2D-DFT) domain
2020/4/5
Gaussian blur motion blur 2020/4/5
Gaussian blur motion blur
• Non-blind deblurring/deconvolution
Given: observation g(m,n) and blurring function h(m,n)
Design: g(m,n), such that the distortion between x(m,n) and ^
x(m,n)
is minimized
motion blur
^
x(m,n)
2020/4/5 2020/4/5
From [Gonzalez & Woods]
10
Inverse Filtering Inverse Filtering
An estimate of the transform of the original image
N (u, v)
G (u , v) F (u, v) F (u, v)
F (u , v) H (u, v)
H (u , v)
1. We can't exactly recover the undegraded image
because N (u, v) is not known.
F (u, v) H (u, v) N (u, v)
F (u , v) 2. If the degradation function has zero or very
H (u, v)
small values, then the ratio N (u, v) / H (u, v) could
N (u, v)
F (u , v) easily dominate the estimate F (u, v).
H (u, v)
4/5/2020 48 4/5/2020 49
► Advantage:
Inverse Filtering
1. It requires only the blur point spread function as a priori
knowledge
EXAMPLE
2. The inverse filter produces perfect reconstruction in the
absence of noise
The image in Fig. 5.25(b) was inverse filtered using the
► Disadvantage: exact inverse of the degradation function that generated
that image. That is, the degradation function is
1. It is not always possible to obtain inverse. For inverse to
exist, the matrix should be non-singular.
5/6
k u M /2 ( v N /2) 2
2
H (u, v) e
, k 0.0025
2. It will not perform well in presence of noise. If the noise is
present in the image, inverse filter tend to amplify noise
which is undesirable.
4/5/2020 50 4/5/2020 51
11
Inverse Filtering
One approach is to limit the filter frequencies to values near the origin.
EXAMPLE
The image in Fig. 5.25(b) was inverse filtered using the A Butterworth
lowpass
exact inverse of the degradation function that generated function of
order 10
that image. That is, the degradation function is
5/6
k u M /2 ( v N /2)2
2
H (u, v) e
k 0.0025, M N 480.
4/5/2020 52 4/5/2020 53
12
Inverse and Pseudo-Inverse Filtering More Realistic Distortion Model
1 additive white Gaussian noise
G(u, v) w(m,n)
H (u, v)
x(m,n) h(m,n) + y(m,n) g(m,n) ^
x(m,n)
blurring filter deblur filter
1
Radially limited u 2 v2 R Image
inverse filter: G (u , v ) H (u, v) size:
u 2 v2 R 480x480
0
2020/4/5 2020/4/5
R = 40 R = 70 R = 85
From [Gonzalez & Woods]
13
Minimum Mean Square Error (Wiener) Minimum Mean Square Error (Wiener)
Filtering Filtering
N. Wiener (1942) The minimum of the error function is given in the frequency domain
Objective by the expression
Find an estimate of the uncorrupted image such that the mean H *(u , v) S f (u , v)
square error between them is minimized F (u , v) G (u, v)
S f (u , v) | H (u , v) | S (u, v)
2
H *(u , v)
G (u , v)
e2 E ( f f )2 | H (u , v) | S (u , v ) / S f (u , v)
2
1 | H (u , v) |2
G (u, v)
H (u , v ) | H (u , v ) | 2
S (u , v ) / S f (u , v )
4/5/2020 60 4/5/2020 61
Minimum Mean Square Error (Wiener) Minimum Mean Square Error (Wiener)
Filtering Filtering
1 | H (u, v) |2
F (u , v) G (u , v)
H (u , v) | H (u, v) | S (u, v) / S f (u, v)
2
1 | H (u , v) |2
F (u , v)
(u , v) |2 K
G (u , v)
H (u , v ) | H
H (u , v) : degradation function
H *(u, v): complex conjugate of H (u , v) K is a specified constant. Generally, the value of K
| H (u, v) | H *(u, v) H (u, v)
2 is chosen interactively to yield the best visual results.
4/5/2020 62 4/5/2020 63
14
Minimum Mean Square Error (Wiener) Left:
Filtering degradated
image
Middle:
inverse
filtering
Right:
Wiener
filtering
4/5/2020 64 4/5/2020 65
H * (u, v)
Wiener filter: G(u, v) Blurred Inverse
| H (u, v) |2 K image filtering
W2 noise power
K
X2 signal power
error energy E Xˆ (u , v) X (u , v)
2
15
Inverse vs. Weiner Filtering Weiner Image Denoising
distorted inverse filtering Wiener filtering w(m,n)
motion blur
+ x(m,n) h(m,n) + y(m,n)
noise
• What if no blur, but only noise, i.e. h(m,n) is an impulse
or H(u, v) = 1 ?
less noise
H * (u, v) W2
Wiener filter: G(u, v) where K
| H (u, v) |2 K X2
for H(u,v) = 1
less noise
Wiener 1 1 X2
denoising filter: G(u, v)
1 K 1 W2 / X2 X2 W2
2020/4/5 2020/4/5
From [Gonzalez & Woods] Typically applied locally in space
1
Radially limited u 2 v2 R
G (u, v) H (u, v)
inverse filter: 0
u 2 v2 R
16
Constrained Least Squares Filtering Constrained Least Squares Filtering
H *(u, v)
F (u, v) 2
G (u, v)
| H (u, v) | | P(u, v) |
2
Examples
4/5/2020 74 4/5/2020 75
17