Image Restoration
Image Restoration
=
=   
(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
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