You are on page 1of 28

IV B.

Tech I Semester ECE Digital Image Processing


VRS & YRN College of Engg. & Tech. 1 Shaik Basheera HOD Department of ECE

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.
A MODEL OF THE IMAGE DEGRADATION/RESTORATION PROCESS
A degradation function that, 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 of the original image. We want to estimate to be
as close as possible to the original image and, in general, the more we know about the H and ,
the closer will be to f(x,y).

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
IV B.Tech I Semester ECE Digital Image Processing
VRS & YRN College of Engg. & Tech. 2 Shaik Basheera HOD Department of ECE

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.

The noise we are going to consider here are 1. Gaussian Noise
2. Rayleigh Noise
3. Erlang Noise
4. Exponential Noise
5. Uniform Noise
6. Impulse (salt-and-pepper) Noise
7. Periodic Noise

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.

The PDF of a Gaussian random variable, z, is given by


IV B.Tech I Semester ECE Digital Image Processing
VRS & YRN College of Engg. & Tech. 3 Shaik Basheera HOD Department of ECE

Where z represents the gray level, is the mean average value of z, and o is its standard
deviation. The standard deviation squared, o
2

is called the variance of z. when z is described by
the above equation, 70% of its values will be in the range [(o),(+o)], and about 95% will be
in the range [(2o),(+2o)].

Rayleigh Noise
The PDF of Rayleigh noise is given by

The mean and variance of this density are 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.

Erlang (Gamma) Noise
The PDF of Erlang Noise given by

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


IV B.Tech I Semester ECE Digital Image Processing
VRS & YRN College of Engg. & Tech. 4 Shaik Basheera HOD Department of ECE

Although the above equation is often referred to as the gamma density, strictly speaking this
correct only when the denominator is the gamma function, I(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

The mean and variance of this density function is given by




IV B.Tech I Semester ECE Digital Image Processing
VRS & YRN College of Engg. & Tech. 5 Shaik Basheera HOD Department of ECE

Impulse (Salt-and-Pepper) Noise
The PDF of (bipolar) impulse noise is given by


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 P
a
or P
b
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.





The input output relation in above figure is expressed as
g(x,y) =H[f(x,y)]+(x,y)(1)
For a moment, let us assume that (x,y)=0, so that g(x,y) = H[f(x,y)]
The operator H is said to be linear if
H[k
1
f
1
(x,y) +k
2
f
2
(x,y)] =k
1
h[f
1
(x,y)] +k
2
H[f
2
(x,y)](2)
where k
1
and k
2
are constants and f
1
(x,y) and f
2
(x,y) are two input images.
If k
1
=k
2
=1,then equation (2) becomes
H[f
1
(x,y) +f
2
(x,y)] =h[f
1
(x,y)] +H[f
2
(x,y)](3)
The above equation is called the property of additivity; this property simply says that, if H is a
linear operator, the response to a sum of two points is equal to the sum of the two responses.
When f
2
(x,y) =0, equation (2) becomes
H +
f(x,y)
g(x,y)
(x,y)
IV B.Tech I Semester ECE Digital Image Processing
VRS & YRN College of Engg. & Tech. 6 Shaik Basheera HOD Department of ECE

H[k
1
f
1
(x,y)] =k
1
h[f
1
(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-o,y-|)] =g(x-o,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.

Degradation model for Continuous case
f(x,y) can be expressed in impulse form as
( , ) ( , ) ( , ) f x y f x y d d


=
} }
(6)
Then, if (x,y) = 0, substituting equation (6) in (1)
( , ) [ ( , )] ( , ) ( , ) [ ] g x y H f x y H f x y d d


= =
} }
(7)
If H is a linear operator, above equation changes as
( , ) ( , ) ( , ) [ ] g x y H f x y d d


=
} }
(8)
Since f(o,|) is independent of x,y and from the homogeneity property
( , ) ( , ) ( , ) [ ] g x y f H x y d d


=
} }
(9)
The term H[(x-o,y-|)] is called the impulse response of H and is denoted as
h(x,o,y,|)=H[(x-o,y-|)](10)
from equations (9) and (10), we can write
( , ) ( , ) ( , , , ) g x y f h x y d d


=
} }
(11)
The above equation is called the superposition (or Fredholm) integral of the first kind. This
expression states that of the response of H to a impulse is known, the response to any inpout
f(o,|) can be calculated by means of equation (11)

If H is position invariant from equation (5)
H[(x-o,y-|)] =h(x-o,y-|)(12)
Now from equations (12), (11) and (10)

IV B.Tech I Semester ECE Digital Image Processing
VRS & YRN College of Engg. & Tech. 7 Shaik Basheera HOD Department of ECE

( , ) ( , ) ( , ) 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.

Degradation model for Discrete case
Suppose that f(x) and h(x) are sampled uniformly to from arrays of dimensions A and B
respectively. In this case x is a discrete variable in the ranges 0,1,2,A-1 for f(x) and 0,1,2,
B-1 for h(x).

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 f
e
(x) and h
e
(x) represent the extended functions. Their convolution is given by
1
0
( ) ( ) ( )
M
e e e
m
g x f m h x m

=
=

(1)
for x=0,1,2,, M-1. As both f
e
(x) and h
e
(x) are assumed to have period equal to M, g
e
(x) also
has the same period.

The above equation can be represented in matrix form as
g = Hf (2)
where f and g are M-dimensional column vectors
(0)
(1)
.
.
.
( 1)
e
e
e
f
f
f
f M
(
(
(
(
=
(
(
(
(

(

(3)
IV B.Tech I Semester ECE Digital Image Processing
VRS & YRN College of Engg. & Tech. 8 Shaik Basheera HOD Department of ECE

(0)
(1)
.
.
.
( 1)
e
e
e
g
g
g
g M
(
(
(
(
=
(
(
(
(

(

(4)
and H is an MxM matrix
(0) ( 1) ( 2) ... ( 1)
(1) (0) ( 1) ... ( 2)
(2) (1) (0) ... ( 3)
. . . . .
. . . . .
. . . . .
( 1) ( 2) ( 3) ... (0)
e e e e
e e e e
e e e e
e e e e
h h h h M
h h h h M
h h h h M
H
h M h M h M h
+
(
(
+
(
( +
(
=
(
(
(
(
(



Because of the periodicity assumption on h
e
(x), it follows that h
e
(x) =h
e
(M+x). Using this
property the above matrix can be changed as
(0) ( 1) ( 2) ... (1)
(1) (0) ( 1) ... (2)
(2) (1) (0) ... (3)
. . . . .
. . . . .
. . . . .
( 1) ( 2) ( 3) ... (0)
e e e e
e e e e
e e e e
e e e e
h h M h M h
h h h M h
h h h h
H
h M h M h M h

(
(

(
(
(
=
(
(
(
(
(



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

f
e
(x,y) = f(x,y) 0 x A-1 and 0 y B-1
= 0 A x M-1 or B y N-1
and
h
e
(x,y) = h(x,y) 0 x C-1 and 0 y D-1
= 0 C x M-1 or D y N-1
IV B.Tech I Semester ECE Digital Image Processing
VRS & YRN College of Engg. & Tech. 9 Shaik Basheera HOD Department of ECE

Treating the extended functions f
e
(x,y) and h
e
(x,y) as periodic in two dimension, with periods M
and N in the x and y directions, respectively
1 1
0 0
( , ) ( , ) ( , )
M N
e e e
m n
g x y f m n h x m y n

= =
=


For x=0,1,2,,M-1 and y=0,1,2,,N-1
The convolution function g
e
(x,y) is periodic with the same period of f
e
(x,y) and h
e
(x,y). Overlap
of the individual convolution periods is avoided by chosing M A+C-1 and N B+D-1.

Now, the complete discrete degradation model can be given by adding an MxN extended discrete
noise term
e
(x,y) to the above equation
( )
1 1
e
0 0
( , ) ( , ) ( , ) x, y
M N
e e e
m n
g x y f m n h x m y n

= =
= +


For x=0,1,2,,M-1 and y=0,1,2,,N-1
The above equation can be represented in matrix from as
g=Hf+n
where f,g,n are MN-dimensional column vectors formed by stacking the rows of the MxN
functions f
e
(x,y), g
e
(x,y) and
e
(x,y). The first N elements of f, foe example are the elements in
the first row of f
e
(x,y), the next N elements are form the second row, and so on for all the M
rows of fe(x,y). So, f,g and n of dimension MNx1and H is of dimension MnxMN. This matrix
consists of M
2
partitions, each partition being of size NxN and ordered according to
0 1 2 1
1 0 1 2
2 1 0 3
1 2 3 0
...
...
...
. . . . .
. . . . .
. . . . .
...
M M
M
M M M
H H H H
H H H H
H H H H
H
H H H H


(
(
(
(
(
=
(
(
(
(
(


Each partition H
j
is constructed from the jth row of the extended function h
e
(x,y) as follows
( ,0) ( , 1) ( , 2) ... ( ,1)
( ,1) ( ,0) ( , 1) ... ( ,2)
( ,2) ( ,1) ( ,0) ... ( ,3)
. . . . .
. . . . .
. . . . .
( , 1) ( , 2) ( , 3) ... ( ,0)
e e e e
e e e e
e e e e
j
e e e e
h j h j N h j N h j
h j h j h j N h j
h j h j h j h j
H
h j N h j N h j N h j

(
(

(
(
(
=
(
(
(
(
(



Here, H
j
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.


IV B.Tech I Semester ECE Digital Image Processing
VRS & YRN College of Engg. & Tech. 10 Shaik Basheera HOD Department of ECE

ALGEBRAIC APPROACH TO RESTORATION
The objective of image restoration is to estimate an original image f from a degraded image g
and some knowledge or assumption about H and n. Central to the algebraic approach is the
concept of seeking an estimate of f, denoted

f
, that minimizes a predefined criterion of
performance. Because of their simplicity, least squares method is used here.

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
small as possible. In other words, we want to find an

f
such that
2
2

n =g-Hf
(2)
is minimum, where
2
T
n n n =
and
2
T

g-Hf (g-Hf ) (g-Hf ) =
are the squared norms of n and

(g-Hf )
respectively.

Equation (2) allows the equivalent view of this problem as one of minimizing the criterion
function with respect to

f
.
2

(f ) g-Hf J =
(3)
Aside from the requirement that it should minimize equation (3)

f
is not constrained in any other
way.
Now, we want to know, for what value of

f
, the function

(f ) J
minimizes to least value. For
that, simply differentiate J with respect to

f
and set the result equal to zero vector.
T

(f )

0 2H (g-Hf)

f
J c
= =
c

Solving the above equation for f
=>
T T

2H g+2H Hf=0

=>
T T

H g=H Hf

=>
T -1 T

f=(H H) H g

Letting M=N so that H is a square matrix and assuming that H
-1
exists, the above equation
reduces to
IV B.Tech I Semester ECE Digital Image Processing
VRS & YRN College of Engg. & Tech. 11 Shaik Basheera HOD Department of ECE

-1 T -1 T

f=H (H ) H g

-1

f=H g


Constrained Restoration
In this section, we consider the least squares restoration problem as one of minimizing
functions of the form
2

Qf
, 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
constraint in the form
2
2

g-Hf n ( )
and then appending it to the function
2

Qf
. In other
words, we seek an

f
that minimizes the criterion function
2 2
2

(f ) Qf g-Hf n ( ) J = +

Where is a constant called the Lagrange multiplier. After the constraint has been appended,
minimization is carried out in the usual way.

Differentiating above equation with respect to

f
and setting the result equal to zero vector yields
T T

(f )

0 2Q Qf - 2 g-Hf

f
H ( )
J c
= =
c

Now, solving for

f
,
T T
1

f = H H+ H (g-Hf) ( )


The quantity 1/ must be adjusted so that the constraint is satisfied.

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
image , G(u,v) by the degradation function:

But we know, G(u,v)=F(u,v)H(u,v)+N(u,v) Substituting this in above equation gives


IV B.Tech I Semester ECE Digital Image Processing
VRS & YRN College of Engg. & Tech. 12 Shaik Basheera HOD Department of ECE

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
dominate the estimate

F(u,v)
.
One approach to get around the zero or small-value problem is to limit the filter frequencies to
values neat the origin. By limiting the analysis to frequencies near the origin, we reduce the
probability of encountering zero values.

LEAST MEAN SQUARE FILTER/
MINIMUM MEAN SQUARE ERROR (WIENER) FILTERING
The inverse filtering makes no explicit provision for handling noise. This Wiener filtering
method incorporates both the degradation function and statistical characteristics images and
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.


IV B.Tech I Semester ECE Digital Image Processing
VRS & YRN College of Engg. & Tech. 13 Shaik Basheera HOD Department of ECE

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

where K is a specified constant.

Generally, Wiener filter works better than inverse filtering in the presence of noise and
degradation function.

CONSTRIAINED LEAST SQUARES FILTERING
The difficulty in Wiener filtering is, the power spectra of the undegraded image and noise
must be known. But this constrained least squares filtering method requires knowledge of only
the mean and variance of the noise. These parameters can be calculated from a given degraded
image, so this is an important advantage. Another difference is that the Wiener filter is based on
minimizing a statistical criterion and, as such, it is optimal in an average sense. But this method
has a notable feature that it yields an optimal result for each image to which it is applied.

The degraded image can be represented in matrix form as
(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)
is the vector norm and

f
is the estimate of the undegraded image.
The frequency domain solution to this optimization problem is given by the following expression

IV B.Tech I Semester ECE Digital Image Processing
VRS & YRN College of Engg. & Tech. 14 Shaik Basheera HOD Department of ECE

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)

We can recognize the above function as the Laplacian operator.

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.

RESTORATION IN THE PRESENCE OF NOISE ONLY-
SPATIAL FILTERING:
We know that the general equations for degradation process in spatial and frequency domain are
given by


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
IV B.Tech I Semester ECE Digital Image Processing
VRS & YRN College of Engg. & Tech. 15 Shaik Basheera HOD Department of ECE

Arithmetic Mean Filter
This is the simplest of the mean filters. Let S
xy
represent the set of coordinates in a rectangular
subimage window of size mxn, centered at point (x,y). The arithmetic mean filtering process
computes the average value of the corrupted image g(x,y) in the area defined by S
xy
. The value
of the restored image

f
at any point (x,y) is simply the arithmetic mean computed using the
pixels in the region defined by S
xy
.

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.

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 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.

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 also
with other types of noise like Gaussian noise.

Contraharmonic Mean Filter
The Contraharmonic mean filtering operation yields a restored image based in the expression.

where Q is called the order of the filter.
This filter is well suited for reducing or virtually eliminating the effects of salt and pepper noise.
For positive values of Q, the filter eliminates pepper noise.
For negative values of Q, the filter eliminates salt noise
IV B.Tech I Semester ECE Digital Image Processing
VRS & YRN College of Engg. & Tech. 16 Shaik Basheera HOD Department of ECE

For Q=0, this filter reduces to arithmetic mean filter
For Q=-1, this filter reduces to harmonic mean filter.

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 and Min Filters
The median filter represents the 50
th
percentile of a ranked set of numbers. The 100
th

percentile result is represented by the Max filter, given by

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

The 0
th
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.

Mid point Filter
The midpoint filter simply computes the midpoint between the maximum and minimum
values in the area encompassed by the filter

IV B.Tech I Semester ECE Digital Image Processing
VRS & YRN College of Engg. & Tech. 17 Shaik Basheera HOD Department of ECE

This filter combines order statistics ad averaging. This filter works best for randomly distributed
noise like Gaussian noise.

Alpha-Trimmed mean Filter
Suppose that we delete the d/2 lowest and d/2 highest gray-level values of g(s,t) in the
neighborhood S
xy
. Let g
r
(s,t) represent the remaining mn-d pixels. A filter formed by averaging
these remaining pixels is called the alpha-trimmed mean filter.

Where the value of d can range from 0 to mn-1
When d=0, this filter reduces to the arithmetic mean filter
When d=(mn-1)/2 this filter becomes to median filter.

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 S
xy
. Adaptive filters are capable of performance superior
to that of the other filters, but with increase in filter complexity.

Adaptive Local Noise Reduction Filter
The simplest statistical measures of a random variable are its mean and variance. These
are reasonable parameters on which to base an adaptive filter because they are quantities closely
related to the appearance of an image. The mean gives a measure of average gray level in the
region over which the mean is computed, and the variance gives a measure of average contrast in
that region.

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) o

2
, the variance of the noise corrupting f(x,y) to form g(x,y)
iii) m
L
, the local mean of the pixels in S
xy
and
iv) o
L
2
, the local variance of the pixels in S
xy
.
The behavior of the filter is to be as follows:
IV B.Tech I Semester ECE Digital Image Processing
VRS & YRN College of Engg. & Tech. 18 Shaik Basheera HOD Department of ECE


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 o

2
.
The other parameters are computed from the pixels in S
xy
at each location (x,y) on which the
filter window is centered. An implicit assumption in above expression is that o

2
o
L
2
, because
the noise in our model is additive and position independent.

Adaptive Median Filter
The median filter performs well as long as the spatial density of the impulse noise is not
large. Adaptive median filtering can handle impulse noise even with large probabilities. An
additional advantage of the adaptive median filter is that it seeks to preserve detail while
smoothing non-impulse noise, something that the traditional median filter does not do. The
adaptive filter also works in a rectangular window area S
xy
. Unlike the other filters, the adaptive
median filter changes (increases) the size of S
xy
during filter operation, depending on certain
conditions.

Consider the following notation:

The adaptive median filtering algorithm works in two levels, denoted level A and level B, as
follows:


IV B.Tech I Semester ECE Digital Image Processing
VRS & YRN College of Engg. & Tech. 19 Shaik Basheera HOD Department of ECE

The adaptive median filtering has three main purposes:
1. To remove salt-and-pepper (or impulse) noise,
2. To provide smoothing of other noise that may not be impulsive and
3. To reduce distortion, such as excessive thinning or thickening of object boundaries.
Every time the algorithm outputs a value, the window S
xy
is moved to the net location in the
image. The algorithm is then reinitialized and applied to the pixels in the new location.

PERIODIC NOISE REDUTION BY FREQUENCY DOMAIN FITLERING
Periodic Noise
Periodic noise in an image arises typically form electrical and electromechanical
interference during image acquisition. This is the only type of spatially dependent noise.
Periodic noise can be reduced significantly with frequency domain filtering.

Band Reject Filters





Band Pass Filters
Notch Filters


Optimum Notch Filtering/ Interactive Restoration
Clearly defined interference patterns are not common. Images derived from electro-optical
scanners, such as those used in space and aerial imaging, sometimes are corrupted by coupling
and amplification of low-level signals in the scanners electronics circuitry. The resulting images
tend to contain pronounced, 2D periodic structures superimposed on the scene data with more
complex patterns.

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
variances of the restored image

f(x,y)
.

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.

QUESTION AND ANSWERS
1. What is image restoration?
IV B.Tech I Semester ECE Digital Image Processing
VRS & YRN College of Engg. & Tech. 20 Shaik Basheera HOD Department of ECE

Image restoration is the improvement of an image using objective criteria and prior knowledge
as to what the image should look like.

2. What is the difference between image enhancement and image restoration?
In image enhancement we try to improve the image using subjective criteria, while in image
restoration we are trying to reverse a specific damage suffered by the image,using objective
criteria.

3. Why may an image require restoration?
An image may be degraded because the grey values of individual pixels may be altered, or it may
be distorted because the position of individual pixels may be shifted away from their correct
position. The second case is the subject of geometric restoration.

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.

4. What is the problem of image restoration?
The problem of image restoration is: given the degraded image g, recover the original
undegraded image f .

5. How can the problem of image restoration be solved?
The problem of image restoration can be solved if we have prior knowledge of the point spread
function or its Fourier transform (the transfer function) of the degradation process.

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





IV B.Tech I Semester ECE Digital Image Processing
VRS & YRN College of Engg. & Tech. 21 Shaik Basheera HOD Department of ECE

0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 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

a) A 3x3 Min Filter:
b) A 5x5 Min Filter:
c) A 7x7 Min Filter:
d) A 9x9 Min Filter:

Explanation:
The 0
th
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.

(a) (c) (d)
a) 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 Min filter is shown
below:










IV B.Tech I Semester ECE Digital Image Processing
VRS & YRN College of Engg. & Tech. 22 Shaik Basheera HOD Department of ECE

0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 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 0 0 0 0 0 0
0 0 0 0 0 0 255 255 255 255 255 0 0 0 0 0 0
0 0 0 0 0 0 255 255 255 255 255 0 0 0 0 0 0
0 0 0 0 0 0 255 255 255 255 255 0 0 0 0 0 0
0 0 0 0 0 0 255 255 255 255 255 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
0 0 0 0 0 0 0 255 255 255 0 0 0 0 0 0 0
0 0 0 0 0 0 0 255 255 255 0 0 0 0 0 0 0
0 0 0 0 0 0 0 255 255 255 0 0 0 0 0 0 0
0 0 0 0 0 0 0 255 255 255 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

IV B.Tech I Semester ECE Digital Image Processing
VRS & YRN College of Engg. & Tech. 23 Shaik Basheera HOD Department of ECE

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

e) A 3x3 Max Filter:
f) A 5x5 Max Filter:
g) A 7x7 Max Filter:
h) A 9x9 Max Filter:

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.

(e) (f) (g)
e) The resulting image consists of vertical bars of 9 pixels wide and 212 pixels height. There will
be no deformation of the corners. The matrix after the application of 3x3 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 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 0 0 0 0
0 0 0 0 255 255 255 255 255 255 255 255 255 0 0 0 0
0 0 0 0 255 255 255 255 255 255 255 255 255 0 0 0 0
0 0 0 0 255 255 255 255 255 255 255 255 255 0 0 0 0
IV B.Tech I Semester ECE Digital Image Processing
VRS & YRN College of Engg. & Tech. 24 Shaik Basheera HOD Department of ECE

0 0 0 0 255 255 255 255 255 255 255 255 255 0 0 0 0
0 0 0 0 255 255 255 255 255 255 255 255 255 0 0 0 0
0 0 0 0 255 255 255 255 255 255 255 255 255 0 0 0 0

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
IV B.Tech I Semester ECE Digital Image Processing
VRS & YRN College of Engg. & Tech. 25 Shaik Basheera HOD Department of ECE


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) A 3x3 Arithmetic Mean Filter:
j) A 5x5 Arithmetic Mean Filter:
k) A 7x7 Arithmetic Mean Filter:
k) A 9x9 Arithmetic Mean Filter:


(i) (j) (k)
Explanation:
Arithmetic mean filter causes blurring. Burring increases with the size of the mask.

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
IV B.Tech I Semester ECE Digital Image Processing
VRS & YRN College of Engg. & Tech. 26 Shaik Basheera HOD Department of ECE

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
0 0 0 0 85 170 255 255 255 255 255 85 0 0 0 0 0

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.

m) A 3x3 Geometric Mean Filter
n) A 5x5 Geometric Mean Filter
o) A 7x7 Geometric Mean Filter
p) A 9x9 Geometric Mean Filter
Explanation
An image restored using a geometric mean filter is given by the expression

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
IV B.Tech I Semester ECE Digital Image Processing
VRS & YRN College of Engg. & Tech. 27 Shaik Basheera HOD Department of ECE

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.

(n) (o) (p)

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
0 0 0 0 0 0 255 255 255 255 255 0 0 0 0 0 0
0 0 0 0 0 0 255 255 255 255 255 0 0 0 0 0 0
0 0 0 0 0 0 255 255 255 255 255 0 0 0 0 0 0
0 0 0 0 0 0 255 255 255 255 255 0 0 0 0 0 0
0 0 0 0 0 0 255 255 255 255 255 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
0 0 0 0 0 0 0 255 255 255 0 0 0 0 0 0 0
0 0 0 0 0 0 0 255 255 255 0 0 0 0 0 0 0
0 0 0 0 0 0 0 255 255 255 0 0 0 0 0 0 0
0 0 0 0 0 0 0 255 255 255 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:
IV B.Tech I Semester ECE Digital Image Processing
VRS & YRN College of Engg. & Tech. 28 Shaik Basheera HOD Department of ECE


0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 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

You might also like