HW 5, Problems 1-9
EECS 203A, UCI, Fall 2004
by Nasser Abbasi
Question
TextBook: Digital Iage Processing, 2nd edition. By Gonzalez and Woods.
The white bars in the test pattern shown below are 7 pixels wide and 210 pixels high. The separation between bars is 17 pixels. What would this image look like after application of
(a) 3x3 Arithmetic mean filter?
(b) 7x7 AMF?
(c) 9x9 AMF?
Answer
Load the original Image and display it first. I downloaded the image from the text book website, and used InfranView to get the image information to find how many pixels the whole image is, then read in into Mathematica to display it.
In[2]:=
Now construct each ARM filter, and apply them to the above image
In[8]:=
Out[10]//MatrixForm=
Filter the image with ARM3 and display
In[11]:=
Now do the same with 7x7 ARM
In[13]:=
Out[14]//MatrixForm=
Now do the same with 9x9 ARM
In[17]:=
Out[18]//MatrixForm=
Analysis
In the original image, the vertical white bars look like this (displaying the top end of the white bar) we see that the white bar top starts at row number 24, we see that the strip is 7 pixels wide.
In[45]:=
Out[45]//MatrixForm=
After applying the 3x3 filter, the white bar would blur to the following
In[46]:=
Out[46]//MatrixForm=
So we see that the white bar is 9 pixels wide, and now starts at row 22, so it has added 2 rows at the top (and 2 rows at the bottom by symmettry), hence it will be of 214 pixels high. We also see the effect of averaging is to give smooth boundaries.
Do similar analysis on the 7x7 filter.
In[53]:=
Out[53]//MatrixForm=
We see that now the white bar is 13 pixels wide, and starts at row 18, so it has added 6 rows at the top and 6 rows at the bottom, so it is now 222 pixels high. we see that the edges now are more smooth.
Do similar analysis on the 9x9 filter.
In[59]:=
Out[59]//MatrixForm=
We see that now the white bar is 15 pixels wide,and starts at row 16,so it has added 8 rows at the top and 8 rows at the bottom,so it is now 216 pixels high. we see that the edges now are even more smooth.
Created by Mathematica (November 14, 2004)