Homework 3


Problem 1

Problem 2

Below are some images from various ways to compress Lena using the DCT. The first four images show the result of using different zonal filters, that is, keeping various numbers of DCT coefficients before transforming back to the image domain. These three all use 8x8 blocks for processing. The next three images show the results of using larger block sizes, first 10, then 12 and 16. The quality goes way down as block size goes up because we're not changing the number of coefficients kept from each block (8), so the total amount of information thrown away is much greater. The matlab code I used is here.

MSE is calculated as sum(sum((I-O).^2))/M*N, where I and O are the input and output images of size MxN. SNR is
10*log10(var(I)/MSE) where var(I) is the variance of I. This is equivalent to 20*log(std(I)/sqrt(MSE)).

10 coefficients 8 coefficients (1:8) 6 coefficients 4 coefficients (1:16)
MSE SNR(dB) MSE SNR(dB) MSE SNR(dB) MSE SNR(dB)
79.7 14.51 107.6 13.21 125.2 12.55 178.8 11.00

Now, the results of changing the block size. I didn't get MSE and SNR measurements on these because they way I implemented the block-by-block DCT (I don't have the image processing toolbox at home) resulted in black bands at the edges for block sizes that don't divide 256 evenly. So this threw off the error calculation. But subjectively, you can see that quality declines rapidly as the block size goes up while keeping the number of coefficients used constant (8 coefficients for all images below). The image with blocksize 12 looks roughly about the same quality as the 4 coefficient image with 8x8 blocks. This makes sense, because roughly the same amount of information is being kept: (8 coefs)/(144 coef/block) = .0556 and 4/64 = .0625.

Block size = 10 Block size = 12 Block size = 16

Back