Professional Documents
Culture Documents
Image Restoration PDF
Image Restoration PDF
UNIT-VI
IMAGE RESTORATION
Restoration attempts to reconstruct or recover an image that has been degraded by using a
priori knowledge of the degradation phenomenon. Thus restoration techniques are oriented
towards modeling the degradation and applying the inverse process in order to recover the
original image.
We consider the restoration problem only from the point where degraded, digital image is
given; thus we consider topics dealing with sensor, digitizer and display degradations only.
If H is linear, position invariant process then the degraded image is given in the spatial
domain by
…(1)
where h(x,y) is the spatial representation of the degradation function and the symbol * indicates
the spatial resolution. The convolution in the spatial domain is equal to multiplication in the
frequency domain, so we may write the model in above equation in an equivalent frequency
domain representation.
where the terms in the capital letters are the fourier transforms of the corresponding terms in
equation (1).
NOISE MODELS
The principal sources of noise in digital images arise during image acquisition
(digitization) and/or transmission.
The 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
VRS & YRN College of Engg. & Tech. 1 Shaik Basheera HOD Department of ECE
IV B.Tech I Semester ECE Digital Image Processing
elements themselves. For instance, in acquiring image with a camera, light levels and
sensor temperature are major factors affecting the amount of noise in the resulting image.
Images are corrupted during transmission principally due to interference in the channel
used for transmission. For example, an image transmitted using a wireless network might
be corrupted as a result of lightening or other atmospheric disturbance.
Spatial characteristics of a noise refer to whether the noise is correlated with an image.
Frequency properties refer to the frequency content of noise in the Fourier sense. For example,
when the Fourier spectrum of noise is constant, the noise is usually is called white noise. This
terminology is a carry over from the physical properties of white light, which contains nearly all
frequencies in the visible spectrum in equal proportions.
With the exception of periodic noise, we assume here that noise is 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). Because it is difficult to
deal with noises that are spatially dependent and correlated.
Gaussian Noise
Because of its mathematical tractability in both spatial and frequency domains, Gaussian (also
called normal) noise models are used frequently practice. In fact, this tractability is so convenient
that it often results in Gaussian models being used in situations in which they are marginally
applicable at best.
VRS & YRN College of Engg. & Tech. 2 Shaik Basheera HOD Department of ECE
IV B.Tech I Semester ECE Digital Image Processing
Where z represents the gray level, is the mean average value of z, and is its standard
deviation. The standard deviation squared, 2 is called the variance of z. when z is described by
the above equation, 70% of its values will be in the range [(),()], and about 95% will be
in the range [(),()].
Rayleigh Noise
The PDF of Rayleigh noise is given by
Note the displacement from the origin and the fact that the basic shape of this density is skewed
to the right. The Rayleigh density can be quite useful for approximating skewed histograms.
Where the parameters are such that a>0, b is a positive integer and ! indicates factorial. The
mean and variance of this density are given by
VRS & YRN College of Engg. & Tech. 3 Shaik Basheera HOD Department of ECE
IV B.Tech I Semester ECE Digital Image Processing
Although the above equation is often referred to as the gamma density, strictly speaking this
correct only when the denominator is the gamma function, (b). When the denominator is as
shown, the density is more appropriately called the Erlang density.
Exponential Noise
The PDF of exponential noise is given by
where a>0. The mean and variance of this density function given by
The PDF of exponential noise is a special case of the Erlang PDF, with b=1
Uniform Noise
The PDF of uniform noise is given by
VRS & YRN College of Engg. & Tech. 4 Shaik Basheera HOD Department of ECE
IV B.Tech I Semester ECE Digital Image Processing
If b>a, gray level b will appear as a light dot in the image and level ‘a’ will appear like a dark
dot. If either Pa or Pb is zero, the impulse noise is called unipolar. If neither probability is zero,
and especially if they are approximately equal, impulse noise values will resemble salt-and –
pepper granules randomly distributed over the image. This noise is called shot noise or spike
noise.
DEGRADATION MODEL
The degradation process can be modeled as an operator or system H, which together with
an additive noise term η(x,y) operates on an input image f(x,y) to produce a degraded image
g(x,y). Image restoration may be viewed as the process of obtaining an approximation to f(x,y),
given g(x,y) and a knowledge of the degradation in the form of the operator H.
η(x,y)
f(x,y)
g(x,y)
H +
VRS & YRN College of Engg. & Tech. 5 Shaik Basheera HOD Department of ECE
IV B.Tech I Semester ECE Digital Image Processing
H[k1f1(x,y)] = k1h[f1(x,y)]…(4)
The above equation is called the property of homogeneity. It says that the response to a constant
multiple of any input is equal to the response to that input multiplied by the same constant. Thus
the linear property possesses both the property of additivity and the property of homogeneity.
An operator having the input-output relation g(x,y) = H[f(x,y)] is said to be position (or space)
invariant if
H[f(x-,y-)] = g(x-,y-)…(5)
This definition indicates that the response at any point in the image depends only on the value of
the input at that point and not on the position of the point.
VRS & YRN College of Engg. & Tech. 6 Shaik Basheera HOD Department of ECE
IV B.Tech I Semester ECE Digital Image Processing
g ( x, y ) f ( , )h( x , y )d d
…(13)
This is nothing but the convolution integral.
In the presence of additive noise the above expression describing the linear degradation model
becomes
g ( x, y ) f ( , )h( x , y )d d ( x, y )
…(15)
Many types of degradations can be approximated by linear, position invariant processes. The
advantage of this approach is that the extensive tools of linear system theory then become
available for the solution of image restoration problems.
The discrete convolution is based in the assumption that the sampled functions are periodic, with
a period M. Overlap in the individual periods of the resulting convolution is avoided by choosing
M ≥ A+B-1 and extending the functions with zeroes so that their length is equal to M.
Let fe(x) and he(x) represent the extended functions. Their convolution is given by
M 1
g e ( x) f e (m) he ( x m)
m 0 …(1)
for x=0,1,2,…, M-1. As both fe(x) and he(x) are assumed to have period equal to M, ge(x) also
has the same period.
f e (0)
f (1)
e
.
f
.
.
f e ( M 1)
…(3)
VRS & YRN College of Engg. & Tech. 7 Shaik Basheera HOD Department of ECE
IV B.Tech I Semester ECE Digital Image Processing
g e (0)
g (1)
e
.
g
.
.
g e ( M 1)
…(4)
and H is an MxM matrix
Because of the periodicity assumption on he(x), it follows that he(x) = he (M+x). Using this
property the above matrix can be changed as
In the above matrix, the rows are related by a circular shift to the right; that is the right-most
element in one row is equal to the left-most element in the row immediately below. The shift is
called circular because an element shifted off the right end of row reappears at the left end of the
next row. Moreover, the circularity of the H is complete in the sense that it extends from the last
row back the first row. A square matrix in which each row is a circular shift of the preceding
row, and the first row is a circular shift of the last row, is called a circulant matrix.
Extension of the discussion to a 2D, discrete degradation model is straightforward. For two
digitized images f(x,y) and h(x,y) of sizes AxB and CxD respectively, extended sizes of MxN
may be formed by padding the above functions with zeroes. That is
VRS & YRN College of Engg. & Tech. 8 Shaik Basheera HOD Department of ECE
IV B.Tech I Semester ECE Digital Image Processing
Treating the extended functions fe(x,y) and he(x,y) as periodic in two dimension, with periods M
and N in the x and y directions, respectively
M 1 N 1
g e ( x, y ) f e ( m, n) he ( x m, y n)
m0 n0
Now, the complete discrete degradation model can be given by adding an MxN extended discrete
noise term ηe(x,y) to the above equation
M 1 N 1
g e ( x, y ) f e ( m, n)he ( x m, y n) e x, y
m 0 n 0
H0 H M 1 H M 2 ... H1
H H0 H M 1 ... H 2
1
H2 H1 H 0 ... H 3
H . . . . .
. . . . .
. . . . .
H H M 2 H M 3 ... H 0
M 1
Each partition Hj is constructed from the jth row of the extended function he(x,y) as follows
he ( j , 0) he ( j , N 1) he ( j , N 2) ... he ( j ,1)
h ( j ,1) he ( j , 0) he ( j , N 1) ... he ( j , 2)
e
he ( j , 2) he ( j ,1) he ( j , 0) ... he ( j ,3)
Hj . . . . .
. . . . .
. . . . .
h ( j , N 1) h ( j , N 2) h ( j , N 3) ... he ( j , 0)
e e e
Here, Hj is a circulant matrix, and the blocks of H are subscripted in a circular manner. For these
reasons, the matrix H is called a Block-Circulant Matrix.
VRS & YRN College of Engg. & Tech. 9 Shaik Basheera HOD Department of ECE
IV B.Tech I Semester ECE Digital Image Processing
Unconstrained Restoration
From g=Hf+n, the noise term in the degradation model is
n=g-Hf … (1)
In the absence of any knowledge of n, a meaningful criterion function is to seek an f̂ such that
Hfˆ approximates g in a least squares sense by assuming that the norm of the noise term is as
Equation (2) allows the equivalent view of this problem as one of minimizing the criterion
Aside from the requirement that it should minimize equation (3) f̂ is not constrained in any other
way.
that, simply differentiate J with respect to f̂ and set the result equal to zero vector.
J (fˆ ) ˆ
0 2H T (g-Hf)
f̂
Solving the above equation for f
ˆ
2H T g+2H T Hf=0
=>
=>
H T g=H T Hfˆ
=>
f̂=(H T H)-1H T g
Letting M=N so that H is a square matrix and assuming that H-1 exists, the above equation
reduces to
VRS & YRN College of Engg. & Tech. 10 Shaik Basheera HOD Department of ECE
IV B.Tech I Semester ECE Digital Image Processing
f̂=H -1 (H T )-1H T g
f̂=H -1g
Constrained Restoration
In this section, we consider the least squares restoration problem as one of minimizing
2
Qfˆ
functions of the form , where Q is a linear operator on f, subject to the constraint
2 2
g-Hfˆ n
.This approach introduces considerable flexibility in the restoration process
because it yields different solutions for different choices of Q.
The addition of an equality constraint in the minimization problem can be handled without
difficulty by using the method of Lagrange Multipliers. The procedure calls for expressing the
2 2 2
( g-Hfˆ n ) Qfˆ
constraint in the form and then appending it to the function . In other
Differentiating above equation with respect to f̂ and setting the result equal to zero vector yields
J (fˆ )
0 2Q T Qfˆ - 2αH T (g-Hfˆ)
f̂
INVERSE FILTERING
The simplest approach to restoration is direct inverse filtering, where we compute an estimate,
F̂(u,v) , of the transform of the original image simply by dividing the transform of the degraded
VRS & YRN College of Engg. & Tech. 11 Shaik Basheera HOD Department of ECE
IV B.Tech I Semester ECE Digital Image Processing
The image restoration approach in above equations is commonly referred to as the inverse
filtering method. This terminology arises from considering H(u,v) as filter function that
multiplies F(u,v) to produce the transform of the degraded image g(x,y).
The above equation tells us that even if we know the degradation function we cannot
recover the undegraded image exactly because N(u,v) is a random function whose fourier
transform is not known.
If the degradation has zero or very small values, then the ratio N(u,v)/H(u,v) could easily
noise as random process, and the objective is to find an estimate f̂ of the uncorrupted image f
such that the mean square error between them is minimized. This error measure is given by
…(1)
where E{.} is the expected value of the argument. It is assumed that the noise and the image are
uncorrelated; that one or the other has zero mean; and that the gray 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 above equation is given in the frequency domain by the expression
…(2)
The terms in the above equations are as follows:
The result in equation (2) is known as the Weiner filter. It is also referred to as the
minimum mean square error filter or the least square error filter. It does not have the same
problem as the inverse filter with zeroes in the degradation function, unless both H(u,v) and
Sη(u,v) are zero for the same values of u and v.
VRS & YRN College of Engg. & Tech. 12 Shaik Basheera HOD Department of ECE
IV B.Tech I Semester ECE Digital Image Processing
If the noise is zero, then the noise power spectrum vanishes and the wiener filter reduces to the
inverse filter. When we are dealing with spectrally white noise, the spectrum |N(u,v)|2 is a
constant, which simplifies things considerably. Now, the above equation can be written as
Generally, Wiener filter works better than inverse filtering in the presence of noise and
degradation function.
…(1)
The problem here is H is highly sensitive to noise. One way to lighten the noise sensitivity
problem is to base optimality of restoration on a measure of smoothness, such as second
derivative of an image. To be meaningful, the restoration must be constrained by the parameters
of the problems. Thus, what is desired is to find the minimum of a criterion function, defined by
…(2)
subject to the constraint
…(3)
VRS & YRN College of Engg. & Tech. 13 Shaik Basheera HOD Department of ECE
IV B.Tech I Semester ECE Digital Image Processing
where γ is a parameter that must be adjusted so that the constraint in equation (3) is satisfied, and
P(u,v) is the fourier transform of the function p(x,y)
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. 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 γ is a scalar, while the value of K in Wiener
filtering is an approximation to the ratio of two unknown frequency domain functions, whose
ratio seldom is constant. Thus, it stands to reason that a result based on manually selecting γ
would be more accurate estimate of the undegraded image. The difference between Wiener
filtering and constrained least square restoration method is
1. The Wiener filter is designed to optimize the restoration in an average statistical sense over a
large ensemble of similar images. The constrained matrix inversion deals with one image only
and imposes constraints on the solution sought.
2. The Wiener filter is based on the assumption that the random fields involved are homogeneous
with known spectral densities. In the constrained matrix inversion it is assumed that we know
only some statistical property of the noise.
In the constraint matrix restoration approach, various filters may be constructed using the same
formulation by simply changing the smoothing criterion.
When the only degradation present in an image is only noise, the above equations become
The noise terms are unknown, so subtracting them from g(x,y) or G(u,v) is not a realistic option.
Spatial filtering is the method of choice in situations when only additive noise is present.
MEAN FILTERS
VRS & YRN College of Engg. & Tech. 14 Shaik Basheera HOD Department of ECE
IV B.Tech I Semester ECE Digital Image Processing
of the restored image f̂ at any point (x,y) is simply the arithmetic mean computed using the
pixels in the region defined by Sxy.
This operation can be implemented using a convolution mask in which all coefficients have
value 1/mn. A mean filter simply smoothes local variations in the image. Noise is reduced as
result of blurring.
Here, each restored pixel is given by the product of the pixels in the subimage window, raised to
the power 1/mn.
A geometric mean filter achieves smoothing comparable to the arithmetic mean filter, nut it
tends to lose less image detail in the process.
The 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.
VRS & YRN College of Engg. & Tech. 15 Shaik Basheera HOD Department of ECE
IV B.Tech I Semester ECE Digital Image Processing
In general, the arithmetic mean and geometric mean filters are well suited for random
noise like Gaussian or uniform noise. The 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. The results of choosing the wrong sign for Q can be disastrous.
ORDER-STATISTICS FILTERS
Order-statistics filters are spatial filters whose response is based on ordering the pixels
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 replaces the value of a pixel by the median of the gray levels in the neighborhood of that pixel:
For certain types of noises, median filters 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 noise.
Max filter is useful for finding the brightest points in an image. It can be used to reduce the
pepper noise from the image. But it removes (sets to a light gray level) some dark pixel from the
borders of the dark objects
Min filter is useful for finding the darkest points in an image. It can be used to reduce the salt
noise from the image. But it removes white points around the border of light objects.
VRS & YRN College of Engg. & Tech. 16 Shaik Basheera HOD Department of ECE
IV B.Tech I Semester ECE Digital Image Processing
This filter combines order statistics ad averaging. This filter works best for randomly distributed
noise like Gaussian noise.
For other values of d, the alpha-trimmed filter is useful in situations involving multiple types of
noise, such as combination of salt and pepper and Gaussian noise.
ADAPTIVE FILTERS
Once selected, the mean filters and order-statistics filters are applied to an image without
regard for how image characteristics vary from one point to another. Adaptive filters are those,
whose behavior changes based on statistical characteristics of the image inside the filter region
defined by the mxn rectangular window Sxy. Adaptive filters are capable of performance superior
to that of the other filters, but with increase in filter complexity.
Our filter is to operate in a local region S xy. The response of the filter at any point (x,y) on which
the region is centered is to be based on four quantities :
i) g(x,y), the value of the noisy image at (x,y)
ii) η2, the variance of the noise corrupting f(x,y) to form g(x,y)
iii) mL, the local mean of the pixels in S xy and
iv) L2, the local variance of the pixels in S xy.
The behavior of the filter is to be as follows:
VRS & YRN College of Engg. & Tech. 17 Shaik Basheera HOD Department of ECE
IV B.Tech I Semester ECE Digital Image Processing
An adaptive expression for obtaining f̂(x,y) based on the above assumptions may be written as
The only quantity that needs to be known or estimated is the variance of the overall noise η2.
The other parameters are computed from the pixels in Sxy at each location (x,y) on which the
filter window is centered. An implicit assumption in above expression is that η2 ≤ L2, because
the noise in our model is additive and position independent.
The adaptive median filtering algorithm works in two levels, denoted level A and level B, as
follows:
VRS & YRN College of Engg. & Tech. 18 Shaik Basheera HOD Department of ECE
IV B.Tech I Semester ECE Digital Image Processing
When several interference components are present, the methods like band pass and band
reject are not always acceptable because they may remove too much image information in the
filtering process. The method discussed here is optimum, in the sense that it minimizes local
The 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.
VRS & YRN College of Engg. & Tech. 19 Shaik Basheera HOD Department of ECE
IV B.Tech I Semester ECE Digital Image Processing
Image restoration is the improvement of an image using objective criteria and prior knowledge
as to what the image should look like.
Geometric restoration is also called image registration because it helps in finding corresponding
points between two images of the same region taken from different viewing angles. Image
registration is very important in remote sensing when aerial photographs have to be registered
against the map, or two aerial photographs of the same region have to be registered with each
other.
6. The white bars in the test pattern shown in figure are 7 pixels wide and 210 pixels high.
The separation between bars is 17 pixels. What would this image look like after application
of different filters of different sizes?
Solution:
The matrix representation of a portion of the given image at any end of a vertical bar is
VRS & YRN College of Engg. & Tech. 20 Shaik Basheera HOD Department of ECE
IV B.Tech I Semester ECE Digital Image Processing
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 255 255 255 255 255 255 255 0 0 0 0 0
0 0 0 0 0 255 255 255 255 255 255 255 0 0 0 0 0
0 0 0 0 0 255 255 255 255 255 255 255 0 0 0 0 0
0 0 0 0 0 255 255 255 255 255 255 255 0 0 0 0 0
0 0 0 0 0 255 255 255 255 255 255 255 0 0 0 0 0
0 0 0 0 0 255 255 255 255 255 255 255 0 0 0 0 0
Explanation:
The 0th percentile result is represented by the Min filter, given by
Min filter is useful for finding the darkest points in an image. It can be used to reduce the salt
noise from the image. But it removes white points around the border of light objects. But for the
given image, the effect of Min filter is decrease in the width and height of the white vertical bars.
As the size of the filter increase, the width and height of the vertical bars decrease.
VRS & YRN College of Engg. & Tech. 21 Shaik Basheera HOD Department of ECE
IV B.Tech I Semester ECE Digital Image Processing
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
b) The resulting image consists of vertical bars of 3 pixels wide and 206 pixels height. There will
be no deformation of the corners. The matrix after the application of 5x5 Min filter is shown
below:
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
c) The resulting image consists of vertical bars of 1 pixels wide and 204 pixels height. There will
be no deformation of the corners. The matrix after the application of 7x7 Min filter is shown
below:
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 255 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 255 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 255 0 0 0 0 0 0 0 0
VRS & YRN College of Engg. & Tech. 22 Shaik Basheera HOD Department of ECE
IV B.Tech I Semester ECE Digital Image Processing
d) The resulting image consists of vertical bars of 0 pixels wide and 202 pixels height. There will
be no deformation of the corners. The white bars completely disappear from the image. The
matrix after the application of 9x9 Min filter is shown below:
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
Explanation
Max filter is useful for finding the brightest points in an image. It can be used to reduce the
pepper noise from the image. But it removes (sets to a light gray level) some dark pixel from the
borders of the dark objects. But for the given image, the effect of Max filter is increase in the
width and height of the white vertical bars. As the size of the filter increase, the width and height
of the vertical bars also increases.
VRS & YRN College of Engg. & Tech. 23 Shaik Basheera HOD Department of ECE
IV B.Tech I Semester ECE Digital Image Processing
f) The resulting image consists of vertical bars of 11 pixels wide and 214 pixels height. There
will be no deformation of the corners. The matrix after the application of 5x5 Max filter is shown
below:
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 255 255 255 255 255 255 255 255 255 255 255 0 0 0
0 0 0 255 255 255 255 255 255 255 255 255 255 255 0 0 0
0 0 0 255 255 255 255 255 255 255 255 255 255 255 0 0 0
0 0 0 255 255 255 255 255 255 255 255 255 255 255 0 0 0
0 0 0 255 255 255 255 255 255 255 255 255 255 255 0 0 0
0 0 0 255 255 255 255 255 255 255 255 255 255 255 0 0 0
0 0 0 255 255 255 255 255 255 255 255 255 255 255 0 0 0
0 0 0 255 255 255 255 255 255 255 255 255 255 255 0 0 0
g) The resulting image consists of vertical bars of 13 pixels wide and 216 pixels height. There
will be no deformation of the corners. The matrix after the application of 7x7 Max filter is shown
below:
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 255 255 255 255 255 255 255 255 255 255 255 255 255 0 0
0 0 255 255 255 255 255 255 255 255 255 255 255 255 255 0 0
0 0 255 255 255 255 255 255 255 255 255 255 255 255 255 0 0
0 0 255 255 255 255 255 255 255 255 255 255 255 255 255 0 0
0 0 255 255 255 255 255 255 255 255 255 255 255 255 255 0 0
0 0 255 255 255 255 255 255 255 255 255 255 255 255 255 0 0
0 0 255 255 255 255 255 255 255 255 255 255 255 255 255 0 0
0 0 255 255 255 255 255 255 255 255 255 255 255 255 255 0 0
0 0 255 255 255 255 255 255 255 255 255 255 255 255 255 0 0
VRS & YRN College of Engg. & Tech. 24 Shaik Basheera HOD Department of ECE
IV B.Tech I Semester ECE Digital Image Processing
h) The resulting image consists of vertical bars of 15 pixels wide and 218pixels height. There
will be no deformation of the corners. The matrix after the application of 9x9 Max filter is shown
below:
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 0
0 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 0
0 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 0
0 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 0
0 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 0
0 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 0
0 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 0
0 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 0
0 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 0
0 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 0
i) Since the width of each vertical bar is 7 pixels wide, a 3x3 arithmetic mean filter slightly
distorts the edges of the vertical bars. As a result, the edges of the vertical bars become a bit
darker. There will be some deformation at the corners of the bars, they become rounded.
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 28 113 170 170 170 170 113 28 0 0 0 0 0
0 0 0 0 85 170 255 255 255 255 255 85 0 0 0 0 0
0 0 0 0 85 170 255 255 255 255 255 85 0 0 0 0 0
VRS & YRN College of Engg. & Tech. 25 Shaik Basheera HOD Department of ECE
IV B.Tech I Semester ECE Digital Image Processing
j) As the size of the mask or filter increases, the vertical bars will distort more, and blurring
increases. Since the size of the mask here is 5x5, after the application of the filter, only the 3
centre lines of the vertical bars remains white. As move we move from the center of the vertical
bar to the either of the edge, the pixels become darker. There will be some deformation at the
corners of the bars, they become rounded.
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 255 255 255 255 255 255 255 0 0 0 0 0
0 0 0 0 0 122 163 163 163 163 163 122 0 0 0 0 0
0 0 0 0 0 191 204 255 255 255 204 191 0 0 0 0 0
0 0 0 0 0 191 204 255 255 255 204 191 0 0 0 0 0
0 0 0 0 0 191 204 255 255 255 204 191 0 0 0 0 0
0 0 0 0 0 191 204 255 255 255 204 191 0 0 0 0 0
k) As the size of the mask or filter increases, the vertical bars will distort more, and blurring
increases. Since the size of the mask here is 7x7, after the application of the filter, only the centre
line of the vertical bars remains white. As move we move from the center of the vertical bar to
the either of the edge, the pixels become darker. There will be some deformation at the corners
of the bars, they become rounded.
l) As the size of the mask is larger than the width of the bars, the vertical bars are completely
distorted. The burring also increases compared to the previous case. The corners also become
more rounded and deformed.
Here, each restored pixel is given by the product of the pixels in the subimage window, raised to
the power 1/mn. A geometric mean filter achieves smoothing comparable to the arithmetic mean
VRS & YRN College of Engg. & Tech. 26 Shaik Basheera HOD Department of ECE
IV B.Tech I Semester ECE Digital Image Processing
filter, nut it tends to lose less image detail in the process. But for the given image, the effect of
Min filter is decrease in the width and height of the white vertical bars. As the size of the filter
increase, the width and height of the vertical bars decrease.
m) The resulting image consists of vertical bars of 5 pixels wide and 208 pixels height. There
will be no deformation of the corners. The matrix after the application of 3x3 Geometric Mean
filter is shown below:
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
n) The resulting image consists of vertical bars of 3 pixels wide and 206 pixels height. There will
be no deformation of the corners. The matrix after the application of 5x5 Geometric Mean filter
is shown below:
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
o) The resulting image consists of vertical bars of 1 pixels wide and 204 pixels height. There will
be no deformation of the corners. The matrix after the application of 7x7 Geometric Mean Filter
is shown below:
VRS & YRN College of Engg. & Tech. 27 Shaik Basheera HOD Department of ECE
IV B.Tech I Semester ECE Digital Image Processing
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 255 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 255 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 255 0 0 0 0 0 0 0 0
p) The resulting image consists of vertical bars of 0 pixels wide and 202 pixels height. There will
be no deformation of the corners. The white bars completely disappear from the image. The
matrix after the application of 9x9 Geometric Mean filter is shown below:
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
VRS & YRN College of Engg. & Tech. 28 Shaik Basheera HOD Department of ECE