
EECS 556, Imaging Processing, Douglas C. Noll 1/30/2003
Homework #3
Due Date: Feb. 6, 2003
1. [10 each] Lim, Problems 3.2, 3.8, 3.11, 3.16
2. [100] In the problem you will write a 2D DCT programs using Matlab’s fft2 and ifft2.
Matlab has its own dct2, but you will write your own – the Matlab dct2 is slightly
different that which we discussed in class so you can’t use it exactly to debug your code.
You will also look at the ability of the DCT and DFT
a. Write the forward dct_2 function using dct_2_template.m.
b. Write the forward idct_2 function using idct_2_template.m.
c. Run the first half of hw3_template.m to validate the forward and reverse 2D
DCT’s that you wrote. This part produces 4 images. Please label all images.
d. Now, we will look at that information compression properties of the DCT.
i. Break the image into 6 128x128 subimages (blocks).
ii. Execute the 2D DCT on each block.
iii. Retain a 32x32 block of data from the DCT of each, specifically let:
≤≤
=otherwise0
31,31),(
),( lklkC
lkC x
x
iv. Inverse 2D DCT each block and piece image together again.
e. Do the same steps for the DFT. For part iii., keep an equivalent number of
independent coefficients (note that DFT is complex, DCT is real).
f. Compare the results for d. and e. Is DCT or DFT preferred for block processing of
data? Hand in code and all figures.