Image Restoration Techniques in Processing
Image Restoration Techniques in Processing
Module-5
Chapter-5:
Restoration: A model of the Image Degradation/Restoration Process, Noise models,
Restoration in the Presence of Noise Only using Spatial Filtering and Frequency
Domain Filtering, Inverse Filtering, Minimum Mean Square Error (Wiener) Filtering.
[Text 1: Chapter 5: Sections 5.1, to 5.4.3, 5.7, 5.8]
Text Books:
[Link] Image Processing - Rafel C Gonzalez and Richard E. Woods, PHI 3rd Edition
2010.
Reference Books:
[Link] Image Processing - [Link], [Link], [Link], TataMcGraw
2. Fundamentals of Digital Image Processing-A. K. Jain, Pearson 2004.
Chapter-5
RESTORATION
5.1 Introduction
Fig. 5.1 shows, the degradation process is modeled as a degradation function together with
an additive noise term, operates on an input image f(x, y) to produce a degraded image
g(x, y).
Given g(x, y), some knowledge about the degradation function H, and some knowledge about
the additive noise term η(x, y), the objective of restoration is to obtain an estimate ̂(x, y) of
the original image.
We want the estimate to be as close as possible to the original input image and, in general,
the more we know about H and η, the closer ̂(x, y) will be to f(x, y).
The degraded image in spatial domain is given by
g(x, y) = h(x, y) f(x, y) + η(x, y)……………….. (1)
where
h(x, y) is the spatial representation of the degradation function
“ ” Symbol indicates convolution.
Convolution in the spatial domain is analogous to multiplication in the frequency domain, so
Eq. (1) in an equivalent frequency domain representation is:
G(u, v) = H(u, v)F(u, v) + N(u, v)………………. (2)
5.3 Noise Models
Sources of noise in digital images arise during image acquisition and/or transmission.
During image acquisition:
Performance of imaging sensors is affected by a variety of factors, such as environmental
conditions during image acquisition, and by the quality of the sensing elements themselves.
Acquiring images with a CCD camera, light levels and sensor temperature are major factors
affecting the amount of noise in the resulting image.
During transmission:
Images are corrupted during transmission due to interference in the channel used for
transmission.
Example: Image transmitted using a wireless network might be corrupted as a result of
lightning or other atmospheric disturbance.
1) Frequency properties refer to the frequency content of noise in the Fourier sense.
Example: when the Fourier spectrum of noise is constant, the noise usually is called
white noise.
2) Noise is assumed to be independent of spatial coordinates, and that it is uncorrelated with
respect to the image itself (that is, there is no correlation between pixel values and the
values of noise components).
The following are the most common PDFs found in image processing
applications.
1. Gaussian noise
PDF of a Gaussian random variable, z, is given by
̅ ⁄
P(z)= …………………(1)
√
Where
z represents intensity,
̅ the mean (average) value of z,
σ Standard deviation,
Standard deviation squared is called the variance of z.
A plot of this function is shown in below Fig.
2. Rayleigh noise
PDF of Rayleigh noise is given by
⁄
{ ……………………….. (2)
= ……………….(4)
Displacement from the origin and the fact that the basic shape of this density is skewed
to the right.
Rayleigh density can be quite useful for approximating skewed histograms.
Rayleigh density is helpful in characterizing noise phenomena in range imaging.
{ ………………………….(5)
= ……………….(7)
Eq. (5) is referred to as the gamma density, only when the denominator is the gamma
function Г(b), When the denominator is as shown, the density is called the Erlang density.
Gamma densities find application in laser imaging.
4. Exponential noise
PDF of exponential noise is given by
{ ………………………..(8)
Where a>0.
Mean and variance of this density function are
̅ ……………………(9)
= ………………….(10)
5. Uniform noise
PDF of uniform noise is given by
P(z)={ ……………………(11)
̅ …………… (12)
………………..(13)
Plot of this function is shown in below Fig.
{ ……………….. (14)
If b a, intensity b will appear as a light dot in the image and Level a will appear
like a dark dot. This is a bipolar noise
If Pa =0 or Pb =0, the impulse noise is called unipolar noise.
If neither probability is zero, and if they are approximately equal, impulse noise
values will resemble salt-and-pepper granules randomly distributed over the image.
For this reason, bipolar impulse noise also is called salt- and-pepper noise.
FIGURE 5.3 Test pattern used to illustrate the characteristics of the noise PDFs
Figure 5.3 shows a test pattern well suited for illustrating the noise models. This is a
suitable pattern to use because it is composed of simple, constant areas that span the
gray scale from black to near white in only 3 increments.
This facilitates visual analysis of the characteristics of the various noise components
added to the image.
FIGURE 5.4 Images and histograms resulting from adding Gaussian, Rayleigh and gamma noise to the image in
Fig.5.3
FIGURE 5.4 (continued) Images and histograms resulting from adding Exponental, uniform and salt and pepper
noise to the image in Fig.5.3
Figure 5.4 shows the test pattern after addition of the 6 types of noise, each image is
the histogram computed directly from that image.
The parameters of the noise were chosen in each case so that the histogram
corresponding to the 3 intensity levels in the test pattern would start to merge. This
made the noise quite visible, without obscuring the basic structure of the underlying
image.
The histogram for the salt-and-pepper example has an extra peak at the white end of
the intensity scale because the noise components were pure black and white, and the
lightest component of the test pattern (the circle) is light gray.
With the exception of slightly different overall intensity, it is difficult to differentiate
visually between the first 5 images in Fig. 5.4, even though their histograms are
significantly different.
The salt-and- pepper appearance of the image corrupted by impulse noise is the only
one that is visually indicative of the type of noise causing the degradation.
5.3.3Periodic Noise
Periodic noise is a spatially dependent noise.
Periodic noise in an image arises from electrical or electromechanical interference during
image acquisition.
Periodic noise can be reduced significantly via frequency domain filtering.
Example:
FIGURE 5.5
(a) Image corrupted by sinusoidal noise.
(b) Spectrum (each pair of conjugate impulses corresponds to one sine wave).
Consider the image in Fig. 5.5(a). This image is severely corrupted by sinusoidal noise of
various frequencies.
The Fourier transform of a pure sinusoid is a pair of conjugate impulses located at the
conjugate frequencies of the sine wave.
Thus, if the amplitude of a sine wave in the spatial domain is strong enough, we would
expect to see in the spectrum of the image a pair of impulses for each sine wave in the image.
As shown in Fig. 5.5(b), this is indeed the case, with the impulses appearing in an
approximate circle because the frequency values in this particular case are so arranged.
5.3.4 Estimation of Noise Parameters
Parameters of periodic noise are estimated by frequency domain. Periodic noise tends to
produce frequency spikes that can be detected even by visual analysis.
Parameters of noise PDFs may be known partially from sensor specifications, but it is often
necessary to estimate them for a particular imaging arrangement.
Imaging system is available
If the imaging system is available, way to study the characteristics of system noise is to
capture a set of images of “flat” environments.
Example: in the case of an optical sensor, this is as simple as imaging a solid gray board that
is illuminated uniformly.
The resulting images are good indicators of system noise.
Imaging system not available
Images already generated by a sensor are available; it is possible to estimate the parameters
of the PDF from small patches of reasonably constant background intensity.
Example: Vertical strips (of 150 * 20 pixels) shown in Fig. 5.6 were cropped from the Gaussian,
Rayleigh, and uniform images in Fig. 5.4.
FIGURE 5.6 Histograms computed using small strips (shown as inserts) from (a) the Gaussian, (b) the Rayleigh, and
(c) the uniform noisy images in Fig. 5.4.
Histograms shown were calculated using image data from these small strips.
Middle Histograms in the Figs. 5.4(d), (e), and (k) match to the histograms in Fig. 5.6. Their
heights are different due to scaling, but the shapes are similar.
Consider a strip (subimage) denoted by S, and let pS(zi), i = 0, 1, 2, …… , L - 1, denote the
normalized histogram values of the intensities of the pixels in S, L is the number of possible
intensities in the entire image.
Mean and variance of the pixels in S as follows:
̅=∑ ………………..(1)
∑ ̅ ……………..(2)
5.4 Restoration in the Presence of Noise Only—Spatial Filtering
The degraded image in spatial domain is given by
g(x, y) = h(x, y) f(x, y) + η(x, y)……………….. (1)
Eq. (1) in an equivalent frequency domain representation is:
G(u, v) = H(u, v)F(u, v) + N(u, v)………………. (2)
When the only degradation present in an image is noise, Eqs. (1) and (2) become
g(x, y) = f(x, y) + η(x, y)……….. (3)
G(u, v) = F(u, v) + N(u, v)……….. (4)
The noise terms are unknown, f(x, y)=g(x,y)- η(x, y) is not a realistic.
In the case of periodic noise, it is possible to estimate N (u, v) from the spectrum of G (u, v).
In this case N(u, v) can be subtracted from G(u, v) to obtain an estimate of the original
image.
Spatial filtering is used when only additive random noise is present.
Types Spatial Filtering
Spatial filters
This operation can be implemented using a spatial filter of size m * n in which all
coefficients have value 1/ mn.
A mean filter smooths local variations in an image, and noise is reduced as a result of
blurring.
Problem: show the effect of 3*3 Arithmetic mean filter on a simple image shown in below
figure.
0 0 0 7 7 7 7
0 0 0 7 7 7 7
7 7 7 7 7 7 7
1 1 1 1 1 1 1
1 1 1 1 1 1 1
1 1 1 1 1 1 1
Solution:
0 0 0 7 7 7 7
0 0 0 7 7 7 7
0+0+0+0+0+0+7+7+7= =2.33
7 7 7 7 7 7 7 Replace center pixel value 0 with 2 in the filtered image
1 1 1 1 1 1 1
1 1 1 1 1 1 1
1 1 1 1 1 1 1
0 0 0 7 7 7 7
0 0 0 7 7 7 7
0+0+7+0+0+7+7+7+7= =3.8
7 7 7 7 7 7 7 Replace center pixel value 0 with 4 in the filtered image.
1 1 1 1 1 1 1
1 1 1 1 1 1 1
1 1 1 1 1 1 1
0 0 0 7 7 7 7
0 0 0 7 7 7 7
7 7 7 7 7 7 7 0+7+7+0+7+7+7+7+7= =5.4
Replace center pixel value 7 with 5 in the filtered image.
1 1 1 1 1 1 1
1 1 1 1 1 1 1
1 1 1 1 1 1 1
Continue the process till all the values in the image matrix are replaced by the new
value.
The new filtered image matrix is
* * * * * * *
* 2 4 5 7 7 *
* 3 3 4 5 5 *
* 3 3 3 3 3 *
* 1 1 1 1 1 *
* * * * * * *
2. Geometric mean filter
Image restored using a geometric mean filter is given by the expression
Each restored pixel is given by the product of the pixels in the subimage window, raised to
the power 1/mn.
Geometric mean filter achieves smoothing comparable to the arithmetic mean filter, but it
tends to lose less image detail in the process
Problem: show the effect of 3*3 Geometric mean filter on a simple image shown in below
figure.
30 10 20
10 250 25
20 25 30
Solution:
30 10 20
* * *
10 250 25 Geometric mean filter
* 1.436 *
20 25 30
* * *
=1.436
Harmonic mean filter works well for salt noise, but fails for pepper noise.
It does well also with other types of noise like Gaussian noise.
Problem: show the effect of 3*3 Harmonic mean filter on a simple image shown in below
figure. 30 10 20
10 250 25
20 25 30
Solution:
30 10 20
Harmonic mean filter * * *
10 250 25
* 4.36 *
20 25 30
* * *
=4.36
FIGURE 5.7:(a) X-ray image. (b) Image corrupted by additive Gaussian noise. (c) Result of filtering with an
arithmetic mean filter of size 3 * 3. (d) Result of filtering with a geometric mean filter of the same size.
Figure 5.7(a) shows an 8-bit X-ray image of a circuit board, and Fig. 5.7(b) shows the
same image, but corrupted with additive Gaussian noise of zero mean and variance of
400. For this type of image this is a significant level of noise.
Figures 5.7(c) and (d) shows, the result of filtering the noisy image with an arithmetic
mean filter of size 3 * 3 and a geometric mean filter of the same size. Both filters
attenuating the contribution due to noise, the geometric mean filter did not blur the image as
much as the arithmetic filters.
Connector fingers at the top of the image are sharper in fig 5.7(d) than in (c).The same is
true in other parts of the image.
Arithmetic and Geometric mean filters are well suited for random noise like Gaussian or
uniform noise.
FIGURE 5.8: (a) Image corrupted by pepper noise with a probability of 0.1. (b) Image corrupted by salt noise
with the same probability.(c)Result of filtering (a) with a 3 * 3 contraharmonic filter of order 1.5.(d)
Result of filtering (b) with Q = -1.5.
Figure 5.8(a) shows the same circuit image, but corrupted now by pepper noise with
probability of 0.1.
Fig. 5.8(b) shows the image corrupted by salt noise with the same probability.
Figure 5.8(c) shows the result of filtering Fig. 5.8(a) using a contraharmonic mean filter with
Q = 1.5, and Fig. 5.8(d) shows the result of filtering Fig. 5.8(b) with Q = -1.5. Both filters did
a good job in reducing the effect of the noise.
Positive-order filter did a better job of cleaning the background, at the expense of slightly
thinning and blurring the dark areas. Opposite was true of the negative order filter.
Contraharmonic filter is well suited for impulse noise, but it has the disadvantage that it must
be known whether the noise is dark or light in order to select the proper sign for Q.
5.4.2 Order-Statistic Filters
Response is based on ordering (ranking) the values of the pixels contained in the image area
encompassed by the filter. The ranking result determines the response of the filter.
1. Median filter
Replaces the value of a pixel by the median of the intensity levels in the neighborhood of that
pixel:
The value of the pixel at (x, y) is included in the computation of the median.
Median filters are quite popular because, for certain types of random noise, they provide
excellent noise-reduction capabilities, with considerably less blurring than linear smoothing
filters of similar size.
Median filters are particularly effective in the presence of both bipolar and unipolar impulse
noise.
Problem: show the effect of 3*3 median filter on a simple image shown in below figure.
30 10 20
10 250 25
20 25 30
Solution:
This filter is useful for finding the brightest points in an image. Also it reduces pepper noise
as a result of the max operation.
The 0th percentile filter is the min filter:
This filter is useful for finding the darkest points in an image. Also, it reduces salt noise as a
result of the min operation.
Problem: show the effect of 3*3 ma/min filter on a simple image shown in below figure.
Solution:
3. Midpoint filter
Midpoint filter computes the midpoint between the maximum and minimum values in the
area encompassed by the filter
30 10 20
10 250 25
20 25 30
Solution:
30 10 20 * * *
Mid-point filter
10 250 25 * 130 *
20 25 30 * * *
Let gr(s, t) represent the remaining mn-d pixels. A filter formed by averaging these remaining
pixels is called an alpha- trimmed mean filter:
Problem: show the effect of 3*3 alpha-trimmed filter on a simple image shown in below
figure. 30 10 20
10 250 25
20 25 30
Solution:
30 10 20 Alpha-trimmed filter * * *
10 250 25 d=2 * 23 *
* * *
20 25 30
if d=2
Remove ,remove
FIGURE 5.10
(a)Image corrupted by salt- and-pepper noise with probabilities Pa = Pb = 0.1.
(b)Result of one pass with a median filter of size 3 * 3.
(c)Result of processing (b) with this filter.
(d)Result of processing (c) with the same filter.
Figure 5.10(a) shows the circuit board image corrupted by salt-and-pepper noise with
probabilities Pa = Pb = 0.1.
Figure 5.10(b) shows the result of median filtering with a filter of size 3 * 3. The
improvement over Fig. 5.10(a) is significant, but several noise points still are visible.
A second pass [on the image in Fig. 5.10(b)] with the median filter removed most of these
points, leaving only few, barely visible noise points. These were removed with a third pass of
the filter. These results are good examples of the power of median filtering in handling
impulse-like additive noise. Keep in mind that repeated passes of a median filter will blur the
image, so it is desirable to keep the number of passes as low as possible.
FIGURE 5.11: (a) Result of filtering Fig. 5.8(a) with a max filter of size 3 * 3. (b) Result of filtering 5.8(b) with
a min filter of the same size.
Figure 5.11(a) shows the result of applying the max filter to the pepper noise image of Fig.
5.8(a).
The filter did a reasonable job of removing the pepper noise, but we note that it also
removed some dark pixels from the borders of the dark objects.
Figure 5.11(b) shows the result of applying the min filter to the image in Fig. 5.8(b). In this
case, the min filter did a better job than the max filter on noise removal, but it removed some
white points around the border of light objects.
These made the light objects smaller and some of the dark objects larger because white
points around these objects were set to a dark level.
Arithmetic mean, Geometric mean, median, and alpha-trimmed mean:
FIGURE 5.12: (a) Image corrupted by additive uniform noise. (b)Image additionally corrupted by additive
salt-and- pepper noise. Image (b) filtered with a 5 * 5.(c) arithmetic mean filter; (d)geometric mean
filter;(e) median filter; and (f) alpha- trimmed mean filter with d = 5.
Figure 5.12(a) shows the circuit board image corrupted this time by additive, uniform noise
of variance 800 and zero mean.
This is a high level of noise corruption that is made worse by further addition of salt-
and-pepper noise with Pa = Pb = 0.1, as Fig. 5.12(b) shows.
The high level of noise in this image warrants use of larger filters.
Figures 5.12(c) through (f) show the results obtained using arithmetic mean, geometric
mean, median, and alpha-trimmed mean (with d = 5) filters of size 5 * 5.
Arithmetic and geometric mean filters did not do well because of the presence of
impulse noise.
Median and alpha-trimmed filters performed much better, with the alpha-trimmed filter
giving slightly better noise reduction.
Note: fourth connector finger from the top left is slightly smoother in the alpha-trimmed
result. This is not unexpected because, for a high value of d, the alpha-trimmed filter
approaches the performance of the median filter, but still retains some smoothing
capabilities.
Where
g(x, y)= Value of the noisy image at (x, y).
= Variance of the noise corrupting f(x, y) to form g(x, y).
mL= Local mean of the pixels in Sxy.
= Local variance of the pixels in Sxy .
The behavior of the filter to be as follows:
1. If =0, ̂(x, y) = g(x, y).
2. If , ̂(x, y) g(x, y). A high local variance is associated with edges, and these
should be preserved.
3. If = , ̂(x, y)= mL. This condition occurs when the local area has the same properties as
the overall image, and local noise is to be reduced simply by averaging.
FIGURE 5.13
(a)Image corrupted by additive Gaussian noise of zero mean and variance 1000.
(b)Result of arithmetic mean filtering.
(c)Result of geometric mean filtering.
(d)Result of adaptive noise reduction filtering. All filters were of size 7 * 7.
Figure 5.13(a) shows the circuit-board image, corrupted this time by additive
Gaussian noise of zero mean and a variance of 1000.
Figure 5.13(b) is the result of processing the noisy image with an arithmetic mean
filter of size 7 * 7. The noise was smoothed out, but at the cost of significant blurring
in the image.
Fig. 5.13(c) shows the result of processing the noisy image with a geometric mean
filter, also of size 7 * 7.
Differences between these 2 filtered images are only the degree of blurring is
different.
Figure 5.13(d) shows the result of using the adaptive filter of Eq. (1) with = 1000.
The improvements in this result compared with the 2 previous filters are significant. In
terms of overall noise reduction, the adaptive filter achieved results similar to the
arithmetic and geometric mean filters. The image filtered with the adaptive filter is
much sharper.
Example: Connector fingers at the top of the image are significantly sharper in Fig.
5.13(d). Other features, such as holes and the eight legs of the dark component on the
lower left-hand side of the image are much clearer in Fig. 5.13(d).
The preceding results used a value for that matched the variance of the noise
exactly.
If this quantity is not known and an estimate is used that is too low, the algorithm will
return an image that closely resembles the original because the corrections will be
smaller than they should be.
Estimates that are too high will cause the ratio of the variances to be clipped at 1.0, and the
algorithm will subtract the mean from the image more frequently than it would normally.
If negative values are allowed and the image is rescaled at the end, the result will be a loss of
dynamic range, as mentioned previously.
2. Adaptive median filter
Median filter performs well if the spatial density of the impulse noise is not large (less than
0.2). Adaptive median filtering can handle impulse noise with probabilities larger than these.
Additional benefit of the adaptive median filter is that it seeks to preserve detail while
smoothing non impulse noise, traditional median filter does not do.
As in all the filters discussed in the preceding sections, the adaptive median filter also works
in a rectangular window area Sxy .Unlike those filter, the adaptive median filter changes
(increases) the size of Sxy during filter operation, depending on certain conditions.
Output of the filter is a single value used to replace the value of the pixel at (x, y), the point
on which the window Sxy is centered at a given time.
(c) If the condition zmin zmed zmax does not holds in stage A. The algorithm then increases the
size of the window and repeats stage A. If the maximum window size is reached the algorithm
returns the value of z med..
Every time the algorithm outputs a value, the window Sxy is moved to the next location in the
image. The algorithm then is reinitialized and applied to the pixels in the new location.
EXAMPLE: Illustration of adaptive median filtering.
FIGURE 5.14 (a) Image corrupted by salt-and-pepper noise with probabilities Pa = Pb = 0.25. (b) Result of
filtering with a 7 * 7 median filter. (c) Result of adaptive median filtering with Smax = 7.
Figure 5.14(a) shows the circuit-board image corrupted by salt-and-pepper noise with
probabilities Pa = Pb = 0.25. Here the noise level is high enough to unclear most of the detail
in the image.
The image was filtered first using the median filter required to remove most visible traces of
impulse noise. A 7 * 7 median filter was required to do this, and the result is shown in Fig.
5.14(b). Although the noise was effectively removed, the filter caused significant loss of
detail in the image.
Connector fingers at the top of the image appear distorted or broken. Other image details are
similarly distorted.
Figure 5.14(c) shows the result of using the adaptive median filter with Smax = 7. Noise
removal performance was similar to the median filter. The adaptive filter did a better job of
preserving sharpness and detail.
Connector fingers are less distorted, and some other features that were either obscured or
distorted beyond recognition by the median filter appear sharper and better defined in Fig.
5.14(c).
Two notable examples are the feed-through small white holes throughout the board, and the
dark component with eight legs in the bottom, left quadrant of the image.
Considering the high level of noise in Fig. 5.14(a), the adaptive algorithm performed
quite well.
The choice of maximum allowed window size depends on the application, but a
reasonable starting value can be estimated by experimenting with various sizes of the
standard median filter first.
This will establish a visual baseline regarding expectations on the performance of the
adaptive algorithm.
5.5 Periodic Noise Reduction by Frequency Domain Filtering
Periodic noise can be analyzed and filtered effectively using frequency domain techniques.
Basic idea is that periodic noise appears as concentrated bursts of energy in the Fourier
transform, at locations corresponding to the frequencies of the periodic interference.
Approach is to use a selective filter to isolate the noise. 3 types of selective filters
(bandreject, bandpass, and notch) are used for periodic noise reduction. We also develop an
optimum notch filtering approach.
1. Bandreject Filters
Removing periodic noise from an image involves removing a particular range of frequencies
from the image.
=[ ⁄ ⁄ ]
=
[ ]
[ ]
H(u,v)=
FIGURE 5.15 From left to right, perspective plots of ideal, Butterworth (of order 1), and Gaussian bandreject
filters.
Figure 5.16(a), shows an image heavily corrupted by sinusoidal noise of various frequencies.
Noise components are easily seen as symmetric pairs of bright dots in the Fourier spectrum
shown in Fig. 5.16(b). Components lie on an approximate circle about the origin of the
transform, so a circularly symmetric Bandreject filter is a good choice.
Figure 5.16(c) shows a Butterworth Bandreject filter of order 4, with the appropriate radius
and width to enclose completely the noise impulses. It is necessary to remove as little as
possible from the transform, sharp, narrow filters are common in Bandreject filtering.
The result of filtering Fig. 5.16(a) with this filter is shown in Fig. 5.16(d). Small details and
textures were restored effectively by this filtering approach.
2. Bandpass Filters
Bandpass filter performs the opposite operation of a Bandreject filter.
Transfer function of a bandpass filter is obtained from a corresponding Bandreject filter.
HBP(u, v) = 1 - HBR(u, v) (1)
HBP(u, v)= Transfer function of a Bandpass filter
HBR(u, v)= Transfer function of a Bandreject filter
{
Butterworth band pass filter of order’ n’ is given by.
=
[ ]
[ ]
= [ ]
FIGURE 5.17
Noise pattern of the image in Fig. 5.16(a) obtained by bandpass filtering.
3. Notch Filters
Notch filter rejects or passes frequencies in predefined neighborhoods about a center
frequency.
Due to the symmetry of the Fourier transform, notch filters must appear in symmetric pairs
about the origin in order to obtain meaningful results.
If the notch filter is located at the origin, in which case it appears by itself. Although we
show only one pair for illustrative purposes, the number of pairs of notch filters that can be
implemented is arbitrary.
The shape of the notch areas also can be arbitrary (rectangular).
Notch reject filter
H (u, v)
1
D0 D0
D (u, v)
(-u0,-v0) (u0, v0)
Transfer function of the ideal notch reject filter with centers ( ) and ( ) is
=[ ⁄ ⁄ ]
=[ ⁄ ⁄ ]
=
[ ]
Transfer function of the Gaussian notch reject filter is given by
[ ]
H(u,v)=
Figure 5.18 shows 3-D plots of ideal, Butterworth, and Gaussian notch (reject) filters.
FIGURE 5.18: Perspective plots of (a) ideal, (b)Butterworth (of order 2),(c) Gaussian notch (reject) filters.
=
[ ]
[ ]
H(u,v)= [ ]
FIGURE 5.19: (a) Satellite image of Florida and the Gulf of Mexico showing horizontal scan lines.
(b)Spectrum. (c)Notch pass filter superimposed on (b). (d) Spatial noise pattern. (e) Result of notch reject
filtering.
The notch filtering approach that reduces the noise in this image, without introducing the
appreciable blurring.
Horizontal lines of the noise pattern in Fig. 5.19(a), its contribution in the frequency domain
to be concentrated along the vertical axis. Noise is not dominant enough to have a clear
pattern along this axis, as is evident from the spectrum shown in Fig. 5.19(b).
Fig. 5.19(c) shows simple ideal notch pass filter along the vertical axis of the Fourier
transform.
Fig. 5.19(d) shows the spatial representation of the noise pattern (inverse transform of the
notch-pass–filtered result). This noise pattern corresponds closely to the pattern in Fig.
5.19(a).
Having thus constructed a suitable notch pass filter that isolates the noise to a reasonable
degree, we can obtain the corresponding notch reject filter from Eq. (1).
The result of processing the image with the notch reject filter is shown in Fig. 5.19(e). This
image contains significantly fewer visible noise scan lines than Fig. 5.19(a).
4. Optimum Notch Filtering
FIGURE 5.20: Image of the Martian terrain taken by Mariner 6. (b)Fourier spectrum showing
periodic interference.
Figure 5.20(a), another example of periodic image degradation, shows a digital image of the
Martian terrain taken by the Mariner 6 spacecraft.
Interference pattern is somewhat similar to the one in Fig. 5.16(a), but the former pattern is
considerably more delicate and, consequently, harder to detect in the frequency plane.
Figure 5.20(b) shows the Fourier spectrum of the image in question.
Starlike components were caused by the interference, and several pairs of components are
present, indicating that the pattern contains more than one sinusoidal component.
When several interference components are present, the methods discussed in the preceding
sections are not always acceptable because they may remove too much image information in
the filtering process.
In addition, the interference components generally are not single frequency bursts. Instead,
they tend to have broad skirts that carry information about the interference pattern.
These skirts are not always easily detectable from the normal transform background.
Alternative filtering methods that reduce the effect of these degradations are quite useful in
many application.
The method discussed here is optimum; it minimizes local variances of the restored estimate
̂(x, y).
Optimum
Procedure consists of first isolating the principal contributions of the interference pattern and
then subtracting a variable, weighted portion of the pattern from the corrupted image.
First step is to extract the principal frequency components of the interference [Link] can
be done by placing a notch pass filter, HNP(u, v), at the location of each spike.
If the filter is constructed to pass only components associated with the interference pattern,
then the Fourier transform of the interference noise pattern is given by the expression
N(u,v)=HNP(u,v)G(u,v)………………….(1)
where, G(u, v)= Fourier transform of the corrupted image.
HNP(u,v)=optimum notch pass filter transform function.
N(u,v)= Fourier transform of the noise .
After a particular filter has been selected, the corresponding pattern in the spatial domain is
obtained from the expression
η(x,y)= HNP(u,v)G(u,v)}……………(2)
Because the corrupted image is assumed to be formed by the addition of the uncorrupted
image f(x, y) and the interference, if η(x, y) were known completely, subtracting the pattern
from g(x, y) to obtain f(x, y) would be a simple matter.
The effect of components not present in the estimate of η(x, y) can be minimized instead by
subtracting from g(x, y) a weighted portion of η(x, y) to obtain an estimate of f(x, y):
̂ =g(x,y)-w(x,y) η(x, y)………………….. (3)
Where
̂ =Estimate of f(x,y)
w(x,y)= weighting or modulation function
The objective of the procedure is to select this function w(x,y) so that the result is optimized
in some meaningful way. One approach is to select w(x,y) so that the variance of the estimate
̂ is minimized over a specified neighborhood of every point (x, y).
Consider a neighborhood of size (2a+1) by (2b+1) about a point (x, y). “Local” variance
of ̂ at coordinates (x, y) can be estimated from the samples, as follows:
∑ ∑ ̂ ̂̅ ……………………… (4)
̂̅ = ∑ ∑ ̂ …….. (5)
Points on or near the edges of the image can be treated by considering partial neighborhoods
or by padding the border with 0s.
Substituting eq.( 3) in to Eq.( 4) yields
∑ ∑ [
̅ ̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅] ……………………… (6)
Assuming that w(x,y) remains essentially constant over the neighborhood gives the
approximation
=w(x,y) …………..(7)
̅ ] ……………………… (9)
To minimize ,we solve For w(x,y).
…………………………. (10)
The result is
̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅̅ ̅ ̅
w(x,y)= ̅̅̅̅ ̅ ……..(11)
To obtain the restored image ̂ we compute w(x,y) from eq.(11) and then use eq.(3).
As w(x,y) is assumed to be constant in a neighborhood, computing this function for every
value of x and y in the image is unnecessary. Instead w(x, y) is computed for one point in
each nonoverlapping neighborhood (center point) and then used to process all the image
points constrained in that neighborhood.
EXAMPLE: Illustration of optimum notch filtering.
FIGURE 5.21:Fourier spectrum (without shifting) of the image shown in Fig. 5.20(a).
FIGURE 5.22:(a)Fourier spectrum of N(u, v), and (b)corresponding noise interference pattern h(x, y).
Figures 5.21 through 5.23 show the result of applying the preceding technique to the
image in Fig. 5.20(a). This image is of size 512 * 512 pixels, and a neighborhood with a
= b = 15 was selected.
Figure 5.21 shows the Fourier spectrum of the corrupted image. The origin was not
shifted to the center of the frequency plane in this particular case, so u = v = 0 is at the
top left corner of the transform image in Fig. 5.21.
Figure 5.22(a) shows the spectrum of N(u, v), where only the noise spikes are present.
Figure 5.22(b) shows the interference pattern η(x, y) obtained by taking the inverse
Fourier transform of N(u, v). Note the similarity between this pattern and the structure of
the noise present in Fig. 5.20(a).
Fig. 5.23 shows the processed image obtained by using Eq. (3).The periodic interference
was removed for all practical purposes.
5.6Linear, Position-Invariant Degradations
Then, substitution of Eq. (7) into Eq. (2) results in the expression
g(x,y)=H[f(x,y)]=H[∫ ∫ ]…( 8)
If H is a linear operator and we extend the Additivity property to integrals, then
g(x,y)=∫ ∫ …………….(9)
g(x,y)=∫ ∫ ……..(10)
the term
H = h(x,α,y,β)…………( 11)
is called the impulse response of H.
Substituting Eq. (11) into Eq. (10) yields the expression
g(x,y)= ∫ ∫ ……………..(12)
If H is position invariant
H[ (x - a, y - b)] = h(x - a, y - b)………………….. (13)
g(x,y)= ∫ ∫ ……(14)
Values of the noise term η(x, y) are random, and are assumed to be independent of position.
If the image is blurred, we can look at a small rectangular section of the image containing
sample structures, like part of an object and the background. To reduce the effect of noise,
look for an area in which the signal content is strong (high contrast).
The next step would be to process the subimage to arrive at a result that is as unblurred as
possible. Ex: sharpening the subimage with a sharpening filter and even by processing small
areas by hand.
Subimage be denoted by gs(x, y), and the processed subimage be denoted by ̂s(x, y).
Degradation can be estimated for the sub image by
̂
……………….(1)
From the characteristics of this function, we then deduce the complete degradation function
H(u, v) based on our assumption of position invariance. Example: If Hs(u, v) has the
approximate shape of a Gaussian curve. We can use that information to construct a function
H(u, v) on a larger scale, but having the same basic shape.
2. Estimation by Experimentation
If equipment similar to the equipment used to acquire the degraded image is available, it is
possible to obtain an accurate estimate of the degradation.
Images similar to the degraded image can be acquired with various system settings until they
are degraded as closely as possible to the image we wish to restore.
Then the idea is to obtain the impulse response of the degradation by imaging an impulse
(small dot of light) using the same system settings.
An impulse is simulated by a bright dot of light, as bright as possible to reduce the effect of
noise to negligible values.
From the above figure the impulse response is given by
H (u, v) = …………….(2)
G(u, v)= Fourier transform of the observed image
A = Constant describing the strength of the impulse.
3. Estimation by Modeling
The Degradation modeling can even take into account environmental conditions that
cause degradations.
Example: Degradation model is based on the physical characteristics of atmospheric
turbulence. This model has a familiar form:
H(u,v)= …………………(3)
where
k= constant that depends on the nature of the turbulence.
With the exception of the 5 6 power on the exponent, this equation has the same
form as the Gaussian lowpass filter.
In fact, the Gaussian LPF is used sometimes to model mild, uniform blurring.
FIGURE 5.25:
Illustration of the atmospheric turbulence model.
(a)Negligible turbulence.
(b)Severe turbulence, k = 0.0025.
(c)Mild turbulence, k = 0.001.
(d)Low turbulence, k = 0.00025.
Figure 5.25 shows examples. Obtained by simulating blurring an image using Eq. (3) with
values k = 0.0025 (severe turbulence), k = 0.001 (mild turbulence), and k = 0.00025 (low
turbulence). All images are of size 480 * 480 pixels.
Mathematical model
Image has been blurred by uniform linear motion between the image and the sensor during
image acquisition. Image f(x, y) undergoes planar motion and that x0(t) and y0(t) are the time
varying components of motion in the x and y directions, respectively.
The total exposure at any point of the recording medium (film or digital memory) is obtained
by integrating the instantaneous exposure over the time interval during which the imaging
system shutter is open.
Assuming that shutter opening and closing takes place instantaneously, and that the optical
imaging process is perfect, isolates the effect of image motion.
Then, if T is the duration of the exposure, it follows that
g(x,y)=∫ …………………….(1)
where
g(x,y) = Blurred image.
Fourier transform of the 2-D image g(x,y) is given by
G(u,v)=∫ ∫ ……………..(2)
Substitute (1) in (2) we get
=∫ ∫ ∫ ………………(3)
Reversing the order of the integration
=∫ ∫ ∫ ………………(4)
The term inside the outer brackets is the fourier transform of the displaced function
.
G(u,v)=∫
G(u,v)= ∫ …………….(5)
F(u,v) is independent of t.
=0,
Eq.(6) yields
H(u,v)=∫
H(u,v)=∫ (8)
H(u,v)= ……………………(9)
FIGURE 5.26: (a) Original image.(b) Result of blurring using the function in Eq. (5.6-11) with a = b = 0.1 and T
= 1.
Figure 5.26(b) is an image blurred by computing the Fourier transform of the image in
Fig. 5.26(a), multiplying the transform by H(u, v) from Eq. (9), and taking the inverse
transform.
The images are of size 688 * 688 pixels, and the parameters used in Eq. (9) were a = b
= 0.1 and T = 1.
Recovery of the original image from its blurred counter part presents some interesting
challenges, particularly when noise is present in the degraded image.
5.8 Inverse Filtering
Simplest approach to restoration is direct inverse filtering, dividing the transform of the
degraded image, G(u, v), by the degradation function H(u,v):
̂ (u, v) = …………. (1)
Even if we know the degradation function we cannot recover the undegraded image
exactly because N(u,v) is not known.
If the degradation function has zero or very small values, then the ratio N(u, v)/
H(u, v) could easily dominate the estimate ̂ (u, v).
One approach to get around the zero or small-value problem is to limit the filter
frequencies to values near the origin. We know that H (0, 0) is usually the highest
value of H(u, v) in the frequency domain.
Thus, by limiting the analysis to frequencies near the origin, we reduce the probability
of encountering zero values. This approach is illustrated in the following example.
Image in Fig.5.25 (b) was inverse filtered with Eq. (1) using the exact inverse of the
degradation function that generated that image. The degradation function used was
H(u,v)=
with k = 0.0025.
M/2 and N/2 constants are offset values; they center the function so that it will
correspond with the centered Fourier transform. In this case, M = N = 480.
FIGURE 5.27: Restoring Fig. 5.25(b) with Eq. (1). (a) Result of using the full filter. (b) Result with H cut off
outside a radius of 40; (c) outside a radius of 70; and (d) outside a radius of 85.
Degradation values became so small that the result of full inverse filtering [Fig. 5.27(a)]
is useless. The reasons for this poor result are as discussed in connection with Eq. (3).
Figures 5.27(b) through (d) show the results of cutting off values of the ratio G(u, v)/
H(u, v) outside a radius of 40, 70, and 85, respectively.
Cut off was implemented by applying to the ratio a Butterworth lowpass function
of order 10. This provided a sharp (but smooth) transition at the desired radius.
Radii near 70 yielded the best visual results [Fig. 5.27(c)].
Radius values below that tended toward blurred images, as shown in Fig. 5.27(b), which was
obtained using a radius of 40.
Values above 70 started to produce degraded images, as shown in Fig. 5.27(d), which was
obtained using a radius of 85. The image content is almost visible in this image behind a
“curtain” of noise, but the noise definitely dominates the result.
Further increases in radius values produced images that looked more and more like Fig.
5.27(a).
The results in the preceding example are illustrative of the poor performance of direct inverse
filtering in general.
5.8 Minimum Mean Square Error (Wiener) Filtering
In this section, we discuss an approach that incorporates both the degradation function and
statistical characteristics of noise into the restoration process.
The objective is to find an estimate ̂ of the uncorrupted image f such that the mean square
error between them is minimized.
This error measure is given by
=E { ̂ (1)
Where E{.} is the expected value of the argument.
It is assumed that
The noise and the image are uncorrelated
One or the other has zero mean
Intensity levels in the estimate are a linear function of the levels in the degraded image.
Based on these conditions, the minimum of the error function in Eq. (1) is given in the
This ratio gives a measure of the level of information bearing signal power (original) to the
level of noise power.
Images with low noise have a high SNR and, same image with a higher level of noise has a
lower SNR.
This ratio by itself is of limited value, but it is an important metric used in characterizing the
performance of restoration algorithms.
Square root of SNR is called root-mean-square-signal-to-noise ratio.
Mean square error
Mean square error given in statistical form in Eq. (1) can be approximated also in terms
a summation involving the original and restored images:
The closer f and ̂ are, the larger this ratio will be.
FIGURE 5.28 Comparison of inverse and Wiener filtering. (a) Result of full inverse filtering of Fig. 5.25(b).
Radially limited inverse filter result. (c) Wiener filter result.
Figure 5.28 illustrates the advantage of Wiener filtering over direct inverse filtering.
Figure 5.28(a) is the full inverse-filtered result from Fig. 5.27(a).
Fig. 5.28(b) is the radially limited inverse filter result of Fig, 5.27(c). These images are
duplicated here for convenience in making comparisons.
Figure 5.28(c) shows the result obtained using Eq. (3) with the degradation function
H(u,v)=
The value of K was chosen interactively to yield the best visual results.
The advantage of Wiener filtering over the direct inverse approach is evident in this example.
By comparing Figs. 5.25(a) and 5.28(c), we see that the Wiener filter yielded a result very
close in appearance to the original image.
g(x,y)=h(x,y) f(x,y)+η(x,y)………………….(1)
Using the definition of convolution we can express Eq. (1) in vector-matrix form:
g=Hf+η …………… (2)
Example: If g(x, y) is of size M * N.
Then we can form the first N elements of the vector g by using the image elements in first
row of g(x, y), the next N elements from the second row, and so on. The resulting vector will
have dimensions MN * 1.
The dimensions of f and η are formed in the same manner. The matrix H then has
dimensions MN * MN.
If H is highly sensitive to noise. To improve the noise sensitivity problem is to
use optimality of restoration on a measure of smoothness, such as the second
derivative of an image (Laplacian).
The objective is to minimize the criterion function, C, defined as
C=∑ ∑ ……………….. (3)
Where
‖ ‖ = Euclidean vector norm,
̂ = estimate of the undergraded image.
̂ [| ]G(u,v) ………….(5)
| | |
Where
γ = parameter that must be adjusted so that the constraint in Eq. (4) is satisfied,
P(u, v)=Fourier transform of the function p(x,y), which is a 3*3 Laplacian mask.
P(x,y)=[ ]………………….(6)
Iterative algorithm for constrained least square filter(A procedure for computing by
iteration is as follows):
Step1:
Define a “residual” vector r as
r=g-H ̂……………..(7)
̂ (u, v) is a function of γ, then r also is a function of this parameter.
=‖ ‖ ………….. (8)
‖ ‖ ∑∑
First, consider the variance of the noise over the entire image, which we estimate by the
sample-average method, is given below.
∑ ∑
Where ∑ ∑
This is a most useful result. It tells us that we can implement an optimum restoration
algorithm by having knowledge of only the mean and variance of the noise. These quantities
are not difficult to estimate, assuming that the noise and image intensity values are not
correlated. This is a basic assumption of all the methods discussed in this chapter.
In general, automatically determined restoration filters yield lesser results to manual
adjustment of filter parameters. This is particularly true of the constrained least squares filter,
which is completely specified by a single, scalar parameter.
FIGURE 5.30 Results of constrained least squares filtering. Compare (a), (b), and (c) with the Wiener
filtering results in Figs. 5.29(c), (f), and (i), respectively.
Figure 5.30 shows the result of processing Figs. 5.29(a), (d), and (g) with constrained least
squares filters, in which the values of γ were selected manually to yield the best visual
results. This is the same procedure we used to generate the Wiener filtered results in Fig.
5.29(c), (f), and (i).
By comparing the constrained least squares and Wiener results, it is noted that the former
yielded slightly better results for the high and medium noise cases, with both filters
generating equal results for the low-noise case.
It is not unexpected that the constrained least squares filter would outperform the Wiener
filter when selecting the parameters manually for better visual results.
The parameter γ in Eq. (5) is a scalar, while the value of K in Eq. ̂
| |
[ | |
]G(u,v) is an approximation to the ratio of two unknown frequency domain
FIGURE 5.31:(a)Iteratively determined constrained least squares restoration of Fig. 5.16(b), using correct noise
parameters. (b)Result obtained with wrong noise parameters.
Figure 5.31(a) shows the result obtained by using the algorithm just described to estimate the
optimum filter for restoring Fig. 5.25(b).
The initial value used for γ was 10-5, the correction factor for adjusting γ was 10-6, and the
value for a was 0.25. The noise parameters specified were the same used to generate Fig.
5.25(a): a noise variance of 10-5, and zero mean. The restored result is almost as good as Fig.
5.28(c), which was obtained by Wiener filtering with K manually specified for best visual
results.
Figure 5.31(b) shows what can happen if the wrong estimate of noise parameters are used. In
this case, the noise variance specified was 10-2 and the mean was left at a value of 0. The
result in this case is considerably more blurred.
Recommended Questions:
1. Explain the model of image degradation/restoration. List all noise probability density
functions and explain any three with necessary equations and graph.
2. Explain inverse filtering and weiner filtering in image processing.
3. Define the process of image restoration. Explain the order statistics filter for restoring images
in the presence of noise.
4. Explain the following methods to estimate the degradation function, used in image restoration:
i) Estimation by image observation;ii)Estimation by experiment
iii)Mathematic modeling.
5. Write short notes on:
i)Noise models ii)Wiener filtering iii)inverse filtering
6. with the relevant p.d.f plots. Explain: i) Gaussian noise, ii) Impulse noise.
7. What are the applications of the second order derivative in image processing?
[Link] in brief the inverse filtering approach and its limitation in image restoration.
[Link] is order-statistics filter?Explain any [Link] their relative merits and demerits.
[Link] the help of a block diagram,explain the imge degradation and restoration model and
mention the reasons for degradation.
[Link] the minimum mean square error (Wiener) filtering that incorporates both degradation
function and the statistical characteristics of noise into the restoration process.
[Link] the following order statistics filter for image restoration: i)Median filter ii)max and
min filter iii)Adaptive local noise reduction filter.
13. Bring out the use of geometric transformation for image restoration?
14. Explain the importance of image restoration process in image processing. Explain any four
important noise probability density functions.
15. Discuss the importance of adaptive filter in image restoration system. Highlight the working
of adaptive median filters.
16. Explain the following order-statistics filters, indicating their uses.
i) Median Filter ii) max filter iii) min filter
17. Explain the notch reject filters. How can we obtain the notch filter that pass rather than
suppressing the frequency in the notch area?
18. Explain in brief, the properties of a Linear, position Invariant Operator.