Unit III CC
Unit III CC
Dr.V.Angayarkanni
Image degradation
Dr.V.Angayarkanni
Image degradation model
• The objective of restoration is to get an estimate f^(x,y) of the original image from g(x,y),
the noise term η(x,y) and the degradation function H
• The closeness of the restored image to the original image mainly depends on H & η
Dr.V.Angayarkanni
Dr.V.Angayarkanni
• If H is a linear and position invariant process, then the degraded image in the
spatial domain is given by
Dr.V.Angayarkanni
Restoration Model
• original image
• Noise
• Eventhough we may not know the original image, some information such as
power spectral density (PSD) and autocorreletion function (ACF) are easy to
model.
Dr.V.Angayarkanni
Discrete degradation model
• Let f(x) & h(x) be arrays of dimension A & B respectively for a digital image,
sampled uniformly
f e ( 0) g e (0)
f (1) g (1)
e e
f e ( x)
. .
and g e ( x)
. .
. .
f e ( M 1) g e ( M 1)
Dr.V.Angayarkanni
• And H is the M x M matrix given by
he (0) he (1) he (2) .....he ( M 1)
h (1) h ( 0) h ( 1) .....h ( M 2)
e e e e
H
he (2) he (1) he (0) .....he ( M 3)
. .
he ( M 1) he ( M 2) he ( M 3) .....he (0)
H
he (2) he (1) he (0) .....he (3)
. .
he ( M 1) he ( M 2) he ( M 3) .....he (0)
Dr.V.Angayarkanni
• Here the rows are related by a circular shift to the right
• i.e. the ith row element can be obtained from the i-1th row by shifting the
Dr.V.Angayarkanni
Enhancement vs Restoration
Image Enhancement
Image Restoration
Subjective Objective
Dr.V.Angayarkanni
An Impulse of light Degraded impulse
Dr.V.Angayarkanni
Noise Models
• The main sources of noise in digital images arise during
image acquisition (digitization) and / or transmission
Dr.V.Angayarkanni
• When the Fourier spectrum noise is constant, it is called
White noise
Dr.V.Angayarkanni
Dr.V.Angayarkanni
Blurred Image Blurred Image + Additive Noise
Dr.V.Angayarkanni
Gaussian White Noise
Dr.V.Angayarkanni
Noise Probability Density
Functions
Dr.V.Angayarkanni
• Gaussian Noise
2
σ2 is the variance
2
b ( z a )e b
for z > a
p(z )
0 for z < a
b4
a b / 4 & 2
4
The Raleigh density is useful for approximating skewed
histograms
Dr.V.Angayarkanni
Gaussian Rayleigh
Dr.V.Angayarkanni
• Erlang (Gamma) Noise
b b 1
a z
e az
(b 1)! for z > 0
p(z )
0 for z < 0
b b
& 2
2
a a
Dr.V.Angayarkanni
• Exponential Noise
ae az for z > 0
p(z )
0 for z < 0
1 1
& 2
2
a a
Dr.V.Angayarkanni
• Uniform Noise
1
If a < z < b
p(z ) ba
0 for z < 0
ab (b a ) 2
& 2
2 12
Dr.V.Angayarkanni
• Impulse (Salt & pepper) Noise
Pa for z = a
p(z ) Pb for z = b
0 otherwise
Dr.V.Angayarkanni
Dr.V.Angayarkanni
• If either Pa or Pb is zero, the impulse noise is called Unipolar
• If they are not zero, but nearly equal, the impulse noise
will appear as “salt & pepper”
Dr.V.Angayarkanni
• The negative impulses appear as black points (pepper) and
positive impulses appear as white points (salt), in an image
Dr.V.Angayarkanni
• The Rayleigh density is helpful in characterizing noise
phenomena in range imaging
Dr.V.Angayarkanni
Periodic Noise
Dr.V.Angayarkanni
Estimation of Noise parameters
Dr.V.Angayarkanni
Gaussian Rayleigh Gamma
Dr.V.Angayarkanni
Images & Histograms resulting from different noise to the image
Exponential Uniform Salt & Pepper
Dr.V.Angayarkanni
Consider a strip or subimage denoted by S
zi p ( zi )
z i S
& 2 i
( z
z i S
) 2
p ( zi )
Dr.V.Angayarkanni
• The shape of the histogram identifies the closest PDF match
• These two factors, mean & variance completely specify the PDF
• The heights of the peaks that corresponds to black and white pixels are the
estimates of Pa & Pb
Dr.V.Angayarkanni
Restoration with only noise
spatial parameters
• In the case of periodic noise, we can estimate N(u,v) from the spectrum G(u,v)
• In that case N(u,v) can be subtracted from G(u,v), but it is not easily achieved
Dr.V.Angayarkanni
Mean Filters
Arithmetic Mean Filter
Dr.V.Angayarkanni
Harmonic Mean Filter
^ mn
f ( x, y )
1
( s , t )S xy g ( s, t )
The Harmonic mean filter works well for salt noise & Gaussian noise but
fails for the pepper noise
Dr.V.Angayarkanni
Contra Harmonic Mean Filter
f ( x, y )
g ( s ,
( s , t )S xy
t ) Q
The Contra Harmonic Mean filter is very effective for salt &
pepper noise
Dr.V.Angayarkanni
Order-Statistics Filters
• The response is based on ordering or the ranking of the pixels contained in the
• The response of the filter at any point is determined by the ranking result
Dr.V.Angayarkanni
Median Filter
f ( x, y ) mediang ( s, t )
^
( s , t )S xy
• It replaces the value of a pixel by the maximum value of the gray levels
in the neighbourhood of the pixel
f ( x, y ) max g ( s, t )
^
( s , t )S xy
• It replaces the value of a pixel by the minimum value of the gray levels
in the neighbourhood of the pixel
f ( x, y ) min g ( s, t )
^
( s , t )S xy
1
f ( x, y) max g ( s, t ) min g ( s, t )
^
2 ( s , t )S xy ( s , t )S xy
Dr.V.Angayarkanni
Alpha trimmed mean filter
• This filter deletes the d/2 lowest & the d/2 highest gray level values in the
neighborhood Sxy
^ 1
f ( x, y )
mn d
g ( s, t )
( s , t )S xy
r
Dr.V.Angayarkanni
Adaptive Filters
Dr.V.Angayarkanni
Adaptive local noise reduction filter
• The Mean & Variance are two simple statistical measures of a random variable
• The mean gives a measure of average gray level in the region over which the
mean is computed
Dr.V.Angayarkanni
• Let the selected local region be Sxy
• The response of the filter at any point (x,y) on which the region is
Dr.V.Angayarkanni
• The expected behavior of the filter is
1.If ση2 is zero, the filter should return the value of g(x,y)
2. If the local variance is high relative to ση2, the filter should return a value close to g(x,y).
High local variance indicate the edges & they should be preserved
3. if the two variances are equal, it must return the mean value of the pixels in Sxy
Dr.V.Angayarkanni
2
• The adaptive expression for obtaining g ( x, y) mL
^
f ( x, y) based
g ( x, y ) on2 the
L
above assumptions is
2
f ( x, y) g ( x, y ) 2 g ( x, y ) mL
^
L
H(u,v) =
1 otherwise
1
H (u, v) 2n
D(u, v)W
1 2 2
D (u, v) D0
Gaussian Band Reject Filters
Dr.V.Angayarkanni
• Even small details & textures are restored effectively
Corrupted Spectrum of
Image Image
Butterworth Filtered
Band Reject Image
Filter
Dr.V.Angayarkanni
Dr.V.Angayarkanni
Band Pass Filters
Dr.V.Angayarkanni
Notch filter
Purpose
Image restoration : Image having added with noise and degraded is to be restored with its original shape
Dr.V.Angayarkanni
Dr.V.Angayarkanni
Dr.V.Angayarkanni
Dr.V.Angayarkanni
Optimum notch filter
o The interference patterns have been simple to identify and characterize in the frequency domain, leading to the
specification of notch filter transfer functions that also are simple to define heuristically.
o When several interference components are present, heuristic specifications of filter transfer functions are not
always acceptable because they may remove too much image information in the filtering process (a highly
undesirable feature when images are unique and/or expensive to acquire).
o In addition, the interference components generally are not single-frequency bursts and It tend to have broad skirts
that carry information about the interference pattern. which are not always easily detectable from the normal
transform background.
o Alternative filtering methods that reduce the effect of these degradations are quite useful in practice.
o Hence the requirement of is optimum notch filter, in the sense that it minimizes local variances of the restored
estimate.
Dr.V.Angayarkanni
Dr.V.Angayarkanni
Dr.V.Angayarkanni
Dr.V.Angayarkanni
Dr.V.Angayarkanni
Degradation Model
n(x,y)
Dr.V.Angayarkanni
Restoration Model
Degradation Restoration
f(x,y) f(x,y)
Model Filter
Unconstrained Constrained
Dr.V.Angayarkanni
f(x,y)
Approach
Build
g = h*f + n
degradation model
Analyze using g = Hf + n
algebraic techniques
W -1 g = DW -1 f + W -1 n
Formulate
restoration algorithms f = H -1 g
Implement using
Fourier transforms F(u,v) = G(u,v)/H(u,v)
f(x,y)
Dr.V.Angayarkanni
Estimating the degradation function
• There are three ways to estimate the degradation function, for use in image restoration
• Observation
• Experimentation
• Mathematical modeling
Dr.V.Angayarkanni
Inverse Filtering
• The simple method to restoration is direct inverse filtering
Dr.V.Angayarkanni
• since G(u, v) H (u, v) F (u, v) N (u, v)
N (u, v)
F (u, v)
H (u, v)
i.e. even if we know the degradation function, we cannot recover the un-degraded
image exactly as N(u,v) is a random function whose Fourier transform is not known
Dr.V.Angayarkanni
• At (u,v), H(u,v) ≈ 0
Dr.V.Angayarkanni
• One method to find the zero or small value problem is to limit the filter frequencies
to values near the origin
• Thus by limiting the analysis to frequencies near the origin, there is less possibility of
facing zero values
Dr.V.Angayarkanni
Inverse Filtering
Examples
• The Inverse Filter works fine if there is no noise
0.2x
Dr.V.Angayarkanni
Inverse Filtering
Dr.V.Angayarkanni
Wiener Filtering
x(t)
s(t) h(t) y(t)
n(t)
e 2 (t ) (t )dt
2 2
Mean Square Error = e
Dr.V.Angayarkanni
Derivation of Wiener Filter
• Given the degraded image g, the Wiener filter is an optimal filter hwin such
that E{|| f – hwing||2} is minimized.
E S (u, v)
F (u , v)
2
f
E N (u , v) S (u , v)
2
n
E F (u , v) N * (u , v)
E F * (u , v) N (u , v) 0
Dr.V.Angayarkanni
C E f hwin g
2
C E F (u, v) H win (u, v)G(u, v)
2
E F (u, v)
2
H win
(u , v ).E F *
(u, v)G (u, v)
H * win (u, v).EF (u, v)G (u, v)*
H win (u, v) .E
2
G(u, v) 2
Dr.V.Angayarkanni
S f (u, v) H win (u, v) . H (u, v) .S f (u, v) S (u, v)
2 2
H win (u, v) H (u, v).S f (u, v) H * win (u, v).H * (u, v).S f (u, v)
H * (u , v ) S (u , v )
H win (u, v)
f
S (u, v) H (u, v) 2 S (u, v)
f
Dr.V.Angayarkanni
• It is assumed that the noise & the image are uncorrelated
and that they have zero mean
H * ( u , v )
G (u, v)
H (u, v) 2 S (u, v)
S f (u, v)
Dr.V.Angayarkanni
1 H (u, v)
2
G (u, v)
H (u, v) H (u, v) S (u, v) / S f (u, v)
2
• where
S (u, v) N (u, v)
2
the power spectrum of the noise
S f (u, v) F (u, v)
2 the power spectrum of the
Un-degraded image
Dr.V.Angayarkanni
• This result is known as Weiner Filter
• The Weiner Filter does not have the same problem as the inverse filter with zeroes in the
degradation function, unless both H(u,v) & S(u,v) are zero for the same values of u & v
• The restored image in the spatial domain is given by the Inverse Fourier transform of the
frequency domain estimate F^(u,v)
Dr.V.Angayarkanni
Weiner Generalization
η(x,y)
Degradation Restoration
Dr.V.Angayarkanni
Weiner Filter Characteristics
Dr.V.Angayarkanni
• If the noise is zero, then the noise power spectrum
vanishes & it becomes the Inverse Filter
^ 1 H (u, v)
2
G (u, v)
F (u, v) H (u, v) H (u, v) K
2
20 20
40 40
60 60
20 40 60 20 40 60
inverse filter
Inverse Filter Wiener
Wienerfilter,
Filter, KK=0.2
=2
20 20
40 40
60 60
20 40 60 20 40 60
Dr.V.Angayarkanni
Wiener Filter Results
Dr.V.Angayarkanni
Wiener Filtering vs. Inverse Filtering
Dr.V.Angayarkanni
Corrupted by Image Inverse Filtering WinerFiltering
Filtering - comparison
Dr.V.Angayarkanni