Lecture 9
Lecture 9
Spring 2020
2 / 39
Image Degradation/Restoration Model
●
Image degradation is modeled as an operator ℋ together with an additive
noise term for an input image f(x,y), to generate the degraded image g(x,y).
●
Given g(x,y), some knowledge about ℋ and some knowledge about the
additive noise term, the objective of restoration is to obtain an estimate of the
original image.
3 / 39
Noise Models
● Sources of noise in digital images arise mainly during image acquisition and/
or transmission.
● For example in CCD cameras, light levels and sensor temperature are major
factors in the amount of noise.
● During transmission, images are affected by interference in the transmission
channel.
● For example in wireless transmission, lightning or other atmospheric
disturbance cause noise.
4 / 39
Noise Probability Distribution Functions (PDF)
– Salt-and-pepper noise
● Salt-and-pepper noise is applied differently.
5 / 39
Important Noise PDFs: Examples
6 / 39
Important Noise PDFs: Examples
7 / 39
Restoration for Noise-Only Degradation – Spatial
Filtering
● Mean Filters:
– Arithmetic Mean Filter
– Geometric Mean Filter
– Harmonic Mean Filter
– Contra-Harmonic Mean Filter
● Order-Statistic Filters:
– Median Filter
– Min/Max Filter
– Midpoint Filter
– Alpha-Trimmed Mean Filter
● Adaptive Filters:
– Adaptive, Local Noise Reduction Filter
– Adaptive Median Filter
8 / 39
Periodic Noise Reduction Using Frequency Domain
Filtering
● Periodic noise can be analyzed and filtered using frequency domain filtering.
● Periodic noise appears as concentrated bursts of energy in the Fourier
domain, at locations corresponding to the frequencies of the periodic
interference.
● We saw three selective filters before:
– Bandreject
– Bandpass
– Notch
● Notch filters are more used in image restoration.
● Remember:
jMN
sin (2 π u0 x / M +2 π v 0 y / N )⇔ [ δ (u+u0, v + v 0 )−δ (u−u0, v−v 0 )]
2
1
cos (2 π u 0 x / M +2 π v 0 y / N )⇔ [ δ (u+u0 , v + v 0 )+ δ (u−u0 , v−v 0 )]
2
9 / 39
Notch Filtering
where Hk(u,v) and H-k(u,v) are highpass filters with centers at (uk,vk) and (-
uk,-vk) respectively.
● Frequency domain functions are symmetric about the center of the frequency
rectangle, so the notches are specified as symmetric pairs.
● The centered distance computations for the filter transfer functions are:
10 / 39
Notch Filtering
● Example: a Butterworth notch reject filter of order n with three notch pairs is:
3
1 1
H NR (u , v)= ∏ [ n
][ n
]
k =1 1+[ D 0 k / Dk (u , v)] 1+[ D 0k / D−k (u , v )]
● Note that D0k is the same for each pair, but can be different for different pairs.
● A notch pass filter can be constructed by:
H NP (u ,)=1−H NR (u , v )
11 / 39
Notch Filtering - Examples
12 / 39
Notch Filtering - Examples
● Using a rectangular notch reject filter, to reduce the horizontal scan lines.
13 / 39
Optimum Notch Filtering
N (u , v )=H NP (u , v)G(u , v)
n( x , y)=IDFT [ H NP (u , v)G(u , v)]
● Given the assumption of additive interference, we can estimate the
interference-free image as:
f^ (x , y)=g( x , y)−n(x , y)
14 / 39
Optimum Notch Filtering
2 1 ^ ¯f^ ]2
σ= ∑ [ f (r , c)−
mn (r , c)∈Sxy
1 2
= ∑ {[ g(r , c)−w( x , y )n(r , c)]−[ ḡ−w( x , y ) n̄]}
mn (r , c )∈ S
xy
2 1 ^ ¯f^ ]2
σ= ∑ [ f (r , c)−
mn (r , c)∈S
xy
1
= ∑ {[ g(r , c)−w( x , y )n(r , c)]−[ ḡ−w( x , y ) n̄]}2
mn (r , c )∈ S
xy
● To minimize the variance with respect to w(x,y), we take the derivative and
equal it to zero: 2
∂ σ ( x , y)
=0
∂ w ( x , y)
● The result will be:
gn− ḡ n̄
w( x , y )=
n̄2− n̄2
which means for every pixel (x,y), this weight is computed and then used in
the first equation in the previous slide.
16 / 39
Optimum Notch Filtering - Example
17 / 39
Linear, Position-Invariant (LPI) Degradations
18 / 39
Linear, Position-Invariant (LPI) Degradations
19 / 39
Degradation Function Estimation
G(u , v)=H (u , v) F (u , v)
20 / 39
Estimation By Image Observation
G s (u , v)
H s (u , v)=
F^ s (u , v)
● Based on the assumption of linear, position invariant (LPI) degradation
operators, we can construct a function H(u,v) on a larger scale, but having
the basic shape as Hs(u,v).
21 / 39
Estimation By Experimentation
● If we have access to the equipment similar to the one used to acquire the
degraded image, we can produce an accurate estimate of the degradation.
● Remember that the degradation operator was called a point spread
function (PSF) or an impulse response?
● This means if we can simulate an impulse (a bright dot of light) and then
image it using the equipment, we can estimate the degradation function as:
G(u , v)
H (u , v)=
A
with constant A as the Fourier transform of the impulse with strength A.
22 / 39
Estimation By Mathematical Modeling
23 / 39
Estimation By Mathematical Modeling
24 / 39
Estimation By Mathematical Modeling
● To see the general approach for such modeling, let’s derive the equations for
modeling blurring as a result of motion between the image and sensor during
image acquisition.
● Here, we want to model image f(x,y) going through planar motion, and x0(t)
and y0(t) are the time-varying components of motion in the x and y
directions.
● We assume that shutter opening and closing is instantaneous.
● The captured image at any point is the integral of the exposure during the
time that the shutter is open.
● If T is the duration of the exposure, the captured image can be derived as:
T
25 / 39
Estimation By Mathematical Modeling
[ ]
∞ ∞
− j 2 π (ux + vy)
= ∫∫ ∫ f [ x−x 0 (t ), y− y 0 (t )] dt e dxdy
−∞ −∞ 0
T ∞ ∞
= ∫ [−∞ ∫ f [ x−x 0 (t ), y− y 0 (t )]e− j 2 π (ux + vy ) dxdy ] dt
∫ −∞
0
T
= ∫ F (u , v )e− j 2 π [ux (t )+ vy ( t )] dt
0 0
0
T
− j 2 π [ux 0 (t )+vy 0 (t )]
= F (u , v )∫ e dt
0
● This means that H(u,v) is:
T
− j 2 π [ux 0 (t)+vy 0 (t)]
H (u , v)=∫ e dt
0
26 / 39
Estimation By Mathematical Modeling
● If the motion variables x0(t) and y0(t) are known, H(u,v) can be obtained
from the equation.
● For example let’s assume a linear motion with the rates x0(t)=at/T and
y0(t)=bt/T in the x and y directions. Then we have:
T
− j 2 π [uat / T + vbt /T ] T − j π (ua+ vb)
H (u , v)=∫ e dt = sin [ π (ua+vb)] e
0 π (ua+ vb)
● The discrete filter of size MxN is generated by sampling this function for
u=0,1,2,…,M-1 and v=0,1,2,…,N-1.
27 / 39
Inverse Filtering
● One approach to reduce the effects of zero or small values is to limit the filter
frequencies to values near the origin of the frequency domain, which usually
has the highest concentration of amplitudes.
29 / 39
Minimum Mean Square Error (Wiener) Filtering
● The inverse filtering approach does not have any explicit consideration for
noise in the process of restoration.
● The minimum mean square error (Wiener) filtering approach considers both
the image and the noise as random variables.
● It aims to find a restored image with minimum mean square error with the
uncorrupted image:
2 2
e =E {(f − f^ ) }
● The noise and image are assumed uncorrelated, with either one having a
zero mean, and that the intensity levels in the estimate are a linear function
of the levels in the degraded image.
30 / 39
Minimum Mean Square Error (Wiener) Filtering
H * (u , v)
=
[ 2
|H (u , v)| +S n (u , v)/S f (u, v)
G (u , v)
]
|H (u , v )|2
=
[ 1
2
H (u , v) |H (u , v)| + Sn (u , v)/ S f (u , v) ]
G (u , v)
● In this formulation:
H * (u , v) : complex conjugate of H (u , v)
|H (u , v )|2 = H * (u , v) H (u , v )
2
Sn (u , v) = |N (u , v)| power spectrum of the noise
2
S f (u , v ) = |F (u , v)| power spectrum of the undegraded image
|H (u , v)|2
F^ (u , v) =
[ 1
]
H (u , v ) |H (u , v )|2 +S n (u , v )/ S f (u , v )
G (u , v )
● If the noise is zero, the Wiener filter reduces to simple inverse filter.
33 / 39
Minimum Mean Square Error (Wiener) Filtering -
Examples
34 / 39
Constrained Least Squares Filtering
● The new method only requires the mean and variance of the noise.
with γ as the adjustable parameter and P(u,v) is the Fourier transform of the
function:
0 −1 0
[
p( x , y)= −1 4 −1
0 −1 0 ] 35 / 39
Constrained Least Squares Filtering - Example
● The functions P(u,v) and H(u,v) must have the same size. If H is MxN, then
p(x,y) should be embedded in the center of an MxN arrays of zeros.
36 / 39
Geometric Mean Filter
● The Wiener filter can be generalized in the form of the geometric mean filter:
* α * 1−α
H (u , v ) H (u , v )
F^ (u , v )=
[|H (u , v )|2 ][ 2
|H (u , v )| + β
S n (u , v )
] G(u , v )
S f (u , v )
with ɑ and β as non-negative real constants.
● When ɑ=0, the filter becomes a parametric Wiener filter, which reduce to
standard Wiener filter when β=1.
● When ɑ=1/2 and β=1 the filter is called a spectrum equalization filter.
38 / 39
Questions?
[email protected]
39 / 39