Homework 1, EE 528 Fall 2009
For Matlab problems, use as the image, I(m,n), either a chessboard image
or a fence image.
- Problems 4.9, 4.11a, 4.12
of AK Jain. Also verify 4.11a using MATLAB. A continuous
function can be simulated by choosing x = [0:1/(100 zeta_s):
5/zeta_0] (using a very small sampling interval).
- Redo Example 4.2
with (a) f(x,y) = cos 2pi(x/4a + y/8a) + cos 2pi(x/128a +
y/128a), (b) f(x,y) = cos 2pi(x/4a + y/8a) + cos 2pi(4x/a + 4y/a).
- Matlab assignment:
- Demonstrate Moire effect for a DC source (constant grey scale
image) using MATLAB. Note what I said in class wasn't exactly correct.
You will need to decimate the image first and then interpolate using
different size averaging filters.
- Decimation and Interpolation (DO NOT use standard Matlab
functions)
- First
decimate without applying the low pass filter (Decimate in two steps:
first do zeroing in the original image and then downsample). See the
effect of aliasing in the decimated image. Start with decimating by a
factor of 2 and keep going until you "see" the effect of aliasing.
- Let
the chosen decimation factor is D. Now apply a low pass filter (say a
3x3 or a 5x5 averaging filter) to I(m,n) and then decimate by D. Keep
increasing size of the averaging filter until the effect of aliasing is
"negligible".
- DFT: See all of the above in the frequency domain by taking a
DFT of a row of the image.
- Details for decimation by 2
(similarly do for any factor D)
- Take the image I(m,n), Set every alternate row and column to
zero. Call this I_Z(m,n). Now downsample to get I_D(m,n) which is half
the size.
- Compute DFT of I, I_Z and I_D for either whole image or
for a piece (or just 1D DFT) where you can "see" aliasing most easily
- Low pass filter the original image and repeat the above steps
- Do the same thing for different decimation rates D and for
different
- Interpolation: Take the
decimated image I_D(m,n), add D-1 zeros to along rows and columns to
get an original size image I_U(m,n). Interpolate the upsampled image
(try zero-order hold, linear or cubic interpolation) to get the
reconstructed image I_hat(m,n). Do this both for the decimation of the
original image and decimation of the LPF'ed image. Notice that the
effect of aliasing will not go away by interpolation. To get a
quantitative measure, you may want to look at the mean squared error
between the reconstructed and original image in both cases. Note for the LPF'ed case, the original
image will be the LPF'ed one. Compute DFT again.
- For one row of the chessboard image,
write out equations for every image you got after decimation and after
interpolation, i.e. do the entire thing on paper. One row of the
chessboard can be written out
as a difference of two unit step functions: u(x) - 2u(x-20)