Image Restoration
Image Restoration
◼ Restoration is a process of reconstruction or
recovering an image that has been degraded by
using some a priori knowledge of the
degradation phenomenon.
◼ It is objective which means that restoration
techniques are oriented toward modeling the
degradation and applying the inverse process in
order to recover the original image.
2
Degradations
Degradation/Restoration Model
◼ The problem of restoration is to obtain
an estimate, f^(x,y), of the original image.
◼ The more we know about H and η, the
closer f^(x,y) will be to f(x,y).
4
Degradation/Restoration Model
◼ In the Spatial domain
g ( x, y ) = h ( x, y ) * f ( x, y ) + ( x, y )
◼ In the Frequency domain
G (u , v) = H (u , v).F (u , v) + N (u , v)
◼ IF we know the values of H and N, we could
recover F as given G (u , v) − N (u , v)
F (u , v) =
H (u , v)
◼ This may not practical. Even though we may have
some statistical information about the noise. As
well H(,u,v) may be close to, or equal to zero. 5
Noise Properties and models
◼ The principle source of noise arises during image
acquisition and/or transmission.
◼ Assuming noise is independent of spatial coordinates
and uncorrelated with respect to the image itself.
◼ Concerning with the statistical behavior of the gray-
level values in the noise component.
◼ Considering random variables characterized by a
Probability Density Function (PDF).
6
Gaussian noise
◼ It is used frequently in practice
7
Uniform noise
◼ Less practical, used for random number
generator 1
if a z b
p( z ) = b − a
0 otherwise
a+b
Mean: =
2
(b − a ) 2
Variance: 2
=
12
Impulse (salt-and-pepper) noise
• If b>a, gray-level b will appear
as a light dot. Conversely, level
a will appear like a dark dot if
either Pa or Pb is zero.
9
Periodic noise
◼ Arise from electrical or
electromechanical interference during
image acquisition
◼ Spatial dependence
◼ Observed in the frequency domain
Sinusoidal noise:
Complex conjugate
pair in frequency
domain
Estimation of noise parameters
◼ Periodic noise
◼ Observe the frequency spectrum
◼ Random noise with unknown PDFs
◼ Case 1: imaging system is available
◼ Capture images of “flat” environment
◼ Case 2: noisy images available
◼ Take a strip from constant area
◼ Draw the histogram and observe it
◼ Measure the mean and variance
Observe the histogram
Gaussian uniform
Measure the mean and variance
◼ Histogram is an estimate of PDF
= zi p ( zi )
zi S
2 = ( zi − ) 2 p ( zi )
zi S
Gaussian: ,
Uniform: a, b
Restoration in the presence of noise-
spatial filtering
◼ A method of choice in situations when
only additive noise is present
◼ Enhancement and restoration become
almost indistinguishable disciplines when
only additive noise is present
16
Additive noise only
g(x,y)=f(x,y)+(x,y)
G(u,v)=F(u,v)+N(u,v)
Spatial filters for de-noising
additive noise
◼ Skills similar to image enhancement
◼ Mean filters
◼ Order-statistics filters
◼ Adaptive filters
Mean filters
◼ Arithmetic mean: Noise is reduced as a
result of blurring
ˆf ( x, y ) = 1
g ( s, t )
mn ( s ,t )S xy Window centered at (x,y)
◼ Geometric mean: It tends to lose less
image detail compared with mean filter
1 / mn
ˆf ( x, y ) = g ( s, t )
( s ,t )S xy
Mean filters (cont.)
◼ Harmonic mean filter
mn
fˆ ( x, y ) =
1
( s ,t )S xy g ( s, t )
◼ Contra-harmonic mean filter
g ( s ,
( s ,t )S xy
t ) Q +1
fˆ ( x, y ) = Q=-1, harmonic
g ( s, t )
( s ,t )S xy
Q
Q=0, airth. mean
Q=+, ?
21
Order-statistics filters
I. Median filter: provides excellent noise
reduction capabilities with considerably less
blurring than linear smoothing filters
II. Max and Min filter: Max filter is useful for
finding the brightest points. It is effective for
pepper noise
22
Order-statistics filters
II. Max and Min filter: Min filter is useful for finding
the darkest points. It reduces salt noise
III. Midpoint filter: this filter combines order
statistics and averaging. It works well for
Gaussian and uniform noise
23
24
25
Adaptive filters
◼ The behavior changes based on statistical
characteristics of the image inside the filter
region defined by window Sxy.
◼ Its performance superior to the previous
filter
◼ Local noise reduction filter:
ML-local mean of the pixels in Sxy
26
Adaptive filters
n2 - Variance of the noise to form g(x,y)
L2 - Local variance of the pixels in Sxy
◼ If n =0 → zero-noise case
2
◼ If
L >> n → f (x,y)≈g(x,y) the variance is
2 2
^
associated with edges; no noise
◼ If L =
2
n→ noise is reduced by averaging
2
27
28
Periodic noise reduction
◼ Pure sine wave
◼ Appear as a pair of impulse (conjugate) in
the frequency domain
f ( x, y ) = A sin(u0 x + v0 y )
A u0 v0 u0 v0
F (u , v) = − j (u − , v − ) − (u + ,v + )
2 2 2 2 2
Periodic noise reduction
(cont.)
◼ Bandreject filters
◼ Bandpass filters
◼ Notch filters
Bandreject filters
* Reject an isotropic frequency
ideal Butterworth Gaussian
Bandreject filters
32
Bandreject filters (Cont.)
noisy spectrum
filtered
bandreject
Bandpass filters
◼ Hbp(u,v)=1- Hbr(u,v)
−1 G (u , v) H bp (u , v)
Notch filters
◼ Reject(or pass) frequencies in predefined
neighborhoods about a center frequency
ideal
Butterworth Gaussian
Notch filters (Cont.)
Notch filters (Cont.)
Horizontal
Notch
Scan lines DFT pass
Notch Notch
pass reject
Estimating the degradation function
◼ Estimation by Image observation
◼ Estimation by experimentation
◼ Estimation by modeling
Estimation by image observation
◼ Take a window in the image
◼ Simple structure
◼ Strong signal content
◼ Estimate the original image in the window
known
Gs (u , v)
H s (u , v) =
Fˆs (u , v)
estimate
Estimation by experimentation
◼ If the image acquisition system is ready
◼ Obtain the impulse response
impulse Impulse response
Estimation by experimentation
(Cont.)
43
Estimation by modeling
◼ A degradation model proposed by
Hufnagel and Stanley is based on the
physical characteristics of atmospheric
turbulence.This model has a familiar
form:
44
Estimation by modeling
− k ( u 2 + v 2 )5 / 6
◼ Ex. Atmospheric model H (u , v ) =e
original k=0.0025
k=0.001 k=0.00025
Estimation by modeling
Estimation by modeling
Estimation by modeling: example
original Apply motion model
Inverse filtering
◼ The simplest approach is direct inverse filtering
In the presence of noise, substituting the
following eqn. into the above Eqn.
Yields,
49
Inverse filtering
◼ With the estimated degradation function
H(u,v)
Unknown
G(u,v)=F(u,v)H(u,v)+N(u,v) noise
=> ˆ G (u , v) N (u , v)
F (u , v) = = F (u , v) +
H (u , v) H (u , v)
Estimate of Problem: 0 or small values
original image
Sol: limit the frequency
around the origin
Min. Mean Square Error (Wiener)
filtering
◼ Incorporating both the degradation fn. and
statistical characteristics of noise into the
restoration process
◼ Assume noise and image are uncorrelated
◼ Based on these conditions, the minimum of the
error function is given in the frequency domain
by the expression
51
Min. Mean Square Error (Wiener)
filtering
Min. Mean Square Error (Wiener)
filtering
Where,
• If Sη and Sf are not known, we set ratio (Sη /Sf ) with
specified constant K
• If Sη =0 (absence of noise), the filter reduces to the ideal
inverse filter 53
54
Image Restoration in Matlab
Image Restoration in Matlab (Cont.)