Module - 4: Image Restoration
Module - 4: Image Restoration
Module - 4: Image Restoration
MODULE -4
Image Restoration
Restoration: Noise models, Restoration in the Presence of Noise Only using Spatial
Filtering and Frequency Domain Filtering, Linear, Position-Invariant Degradations,
Estimating the Degradation Function, Inverse Filtering, Minimum Mean Square Error
(Wiener) Filtering, Constrained Least Squares Filtering.
[Text: Chapter 5: Sections 5.2, to 5.9]
WR-1 https://nptel.ac.in/courses/117/105/117105135/
WR-2 https://www.youtube.com/watch?v=DSGHkvQBMbs
Channel https://www.youtube.com/channel/UCD0mXLuJqtvPxBqRI1r66cg/videos
where
𝑔(𝑥, 𝑦) the degraded image
𝑓(𝑥, 𝑦) the original image
H an operator that represents the degradation process
𝜂(𝑥, 𝑦) the external noise which is assumed to be image-independent
Noise Models:
The principle sources of noise in digital images arise during image acquisition
and/or transmission. The performance of imaging sensors are affected by a variety
of factors during acquisition, such as
• Environmental conditions during the acquisition
• Light levels (low light conditions require high gain amplification)
• Sensor temperature (higher temp implies more amplification noise)
Images can also be corrupted during transmission due to interference in the channel
for example
• Lightning
• Atmospheric disturbances
Depending on the specific noise source, a different model must be selected that
accurately reproduces the spatial characteristics of the noise.
Its shape
is similar
to Rayleigh disruption. This equation is referred
to as gamma density it is correct only when the
denominator is the gamma function.
Where 𝑎 > 0 𝑎𝑛𝑑 𝑏 is a positive integer. The mean
and variance are then given by
by
The mean and variance of this noise is
If b>a, gray level b will appear as a light dot in image. Level a will appear like a dark
dot. Because impulse corruption is generally large compared to the signal strength, the
assumption is usually that a and b are digitised as saturated values thus black (pepper)
and white (salt).
Periodic Noise: Periodic noise typically arises from electrical or electromechanical
interference during image acquisition and is spatial dependent.
A Mean Filter:
Arithmetic Mean filter: It is the simplest mean filter. A mean filter smoothes local
variations in image Noise is reduced as a result of blurring. For
every pixel in the image, the pixel value is replaced by the
mean value of its neighboring pixels with a weight .
This will resulted in a smoothing effect in the image. This
operation can be using a convolution mask in which all coefficients have value 1/mn
Geometric Mean filter: An image restored using a geometric
mean filter is given by the expression
Here, each restored pixel is given by the product of the
pixel in the sub image window, raised to the power 1/mn. A
geometric mean filters but it to loose image details in the
process.
Harmonic Mean filter: The harmonic mean filtering
operation is given by the expression.
The harmonic mean filter works well for salt noise but
fails for pepper noise. It does well with Gaussian noise also.
Contraharmonic mean filter Contraharnomic mean filter
reduces salt and pepper noise, Positive Q is suitable for
eliminating pepper noise. Negative Q is suitable for
eliminating salt noise. Cannot do both simultaneously.
For Q = 0, the filter reduces to an arithmetic mean filter.
For Q = -1, the filter reduces to a harmonic mean filter.
Where, Q = the filter order.
B Order statistics filter: Order statistics filters are spatial filters whose response
is based on ordering the pixel contained in the image area encompassed by the filter.
The response of the filter at any point is determined by the ranking result.
Median filter: It is the best order statistic filter; it replaces the
value of a pixel by the median of gray levels in the
Neighborhood of the pixel. The original of the pixel is
included in the computation of the median of the filter are
quite possible because for certain types of random noise, the provide excellent noise
reduction capabilities with considerably less blurring then smoothing filters of similar
size. These are effective for bipolar and unipolor impulse noise.
Max and Min filter: Using the l00th percentile of ranked set of
numbers is called the max filter and is given by the equation
It is used for finding the brightest point in an image. Pepper
noise in the image has very low values, it is reduced by max
filter using the max selection process in the sublimated area
sky. The 0th percentile filter is min filter. This filter is useful
for flinging the darkest point in image. Also, it reduces salt
noise of the min operation.
Alpha-Trimmed Mean Filter: The alpha-timmed mean filter is based on order statistics
and varies between a median and a mean filter.
It is used when an image contains both short
and long tailed types of noise (e.g. both
Gaussian and salt and pepper noise).
Suppose that we delete the d/2 lowest and the
d/2 highest intensity values of g(r, c) in the neighborhood 𝑆𝑥𝑦 . Let 𝑔𝑅 (𝑟. 𝑐) represent the
remaining 𝑚𝑛 − 𝑑 pixels in 𝑆𝑥𝑦 A filter formed by averaging these remaining pixels is
called an alpha-trimmed mean filter. The form of this filter is
Below table shows Bandreject filter transfer functions with C0 as the center of the band
with W as the width of the band, and D(u,v) is the distance from the center of
the transfer function to a point (u,v) in the frequency rectangle.
Adding lowpass and highpass transfer functions to form Gaussian and Butterworth
bandreject functions presents some difficulties: we have no direct control over W, and
the value of H(u,v) is not 0 at C0.
Fortunately, instead of adding lowpass and highpass transfer function, an alternative is
to modify the expressions for the Gaussian and Butterworth highpass transfer
functions so that they will satisfy the three requirements
stated earlier
To illustrate the procedure for a Gaussian function, we
begin by changing the
point at which
To get
Notch Filters
Notch filters are the most useful of the selective filters. A notch filter rejects (or passes)
frequencies in a predefined neighborhood of the frequency rectangle. Zero-phase-shift
filters must be symmetric about the origin (center of the frequency rectangle), so a
notch filter transfer function with center at (u0,v0) must have a corresponding notch at
location (-u0,-v0)
Notch reject filter transfer functions are constructed as products of highpass filter
transfer functions whose centers have been translated to the centers of the notches.
The general form is:
Where Hk(u,v) and H-k(u,v) are highpass filter transfer functions whose centers are at
(u0,v0) and (-u0,-v0) respectively. These centers are specified with respect to the center
of the frequency rectangle, (M/2,N/2), where, as usual, M and N are the number of
rows and columns in the input image. Thus, the distance computations for each filter
transfer function are given by
and
For example, the following is a Butterworth notch reject filter transfer function of order
n, containing three notch pairs is give as :
Where and Dk(u,v) and D-k(u,v) are given by above two Eqs. The constant D0k is the same
for each pair of notches, but it can be different for different pairs. The general equations
for Ideal, Butterworth, Gaussian notch filters are as given below
In this course we will be dealing with linear, space invariant type of degradations, as in
a real life problem many types of degradations can be approximated by linear, position
invariant processes.
where fˆ ( x, y ) is the restored image. Both BSNR and ISNR can only be used for
simulation with artificial data.
0 − −
Inverse Filtering
The objective is to minimize
J (f ) = n(f ) = g − Hf
2 2
subject to
2
Cf
where Cf is a high pass filtered version of the image. The idea behind the above
constraint is that the high pass version of the image contains a considerably large
amount of noise! Algorithms of the above type can be handled using optimization
techniques. Constrained least squares (CLS) restoration can be formulated by choosing
an f to minimize the Lagrangian
(
min g − Hf + Cf
2 2
)
Typical choice for C is the 2-D Laplacian operator given by
0.00 − 0.25 0.00
C = − 0.25 1.00 − 0.25
0.00 − 0.25 0.00
represents either a Lagrange multiplier or a fixed parameter known as regularisation
parameter and it controls the relative contribution between the term g − Hf
2
and the
2
term Cf . The minimization of the above leads to the following estimate for the original
image
( )
−1
f = HT H + CTC H Tg
amplified noise effects. The variance and bias of the error image in frequency domain
are
2
M N
H (u , v)
Var ( ) = 2
( H (u, v) )
n
2 2
+ C (u , v )
2
u =0 v =0
F ( u, v ) 2 C (u, v )
2 4
M −1 N −1
Bias( ) = 2
n
u =0 v =0
( H ( u, v ) 2
+ C ( u, v )
2 2
)
The minimum MSE is encountered close to the intersection of the above functions. A
good choice of is one that gives the best compromise between the variance and bias
of the error image.
( f ( x. y ) − fˆ ( x. y ) dxdy )
2
=
− −
= f ( x. y ) − fˆ ( x. y )
− −
dxdy
2
= F ( x. y ) − Fˆ ( x. y )
− −
dudv
=
− −
(1 − WH ) F − WN dudv
(1 − WH ) F dudv ;
= − WN f ( x, y ) and ( x, y ) are uncorrelated
2 2
sin ce
− −
Minimize the above equation by differentiating it and evaluate it to zero w.r.t the filter
coefficients we get (Note that the above equation is integrated sum of two squares i.e
z
( zz ) = 2z )
* *
z
⎯⎯ ((
→ 2 − 1 − W *H * H F + W * N ) 2 2
)=0
2
H F H*
W = *
=
F +N H +N
2 2 2 2 2 2
H F
H * ( u, v ) S ff ( u , v ) H * ( u, v ) H * ( u, v )
W* = = =
H ( u, v ) S ff ( u, v ) + S ( u , v ) H ( u , v ) + S ( u , v ) S ff ( u , v ) H (u , v ) + K
2 2 2
1
Relation with inverse filtering: If Snn (u, v) = 0 W (u, v) = which is the inverse filter
H (u, v)
1
H (u, v) H (u, v) 0
If S nn (u, v) → 0 lim W (u, v) =
Snn →0
0 H (u, v) = 0
which is the pseudoinverse filter.
2. Discuss various mean filters and order statistics filters in image restoration system
3. Explain the Weiner filtering method of restoring images
4. Justify the statements “median filter is an effective tool to minimize salt and pepper
noise” with an example.
9.
10.
FURTHER READING