Assignment P2 Student: Jan Hendrik Dithmar, 2031259, jadi5003@stud.uni-saarland.de Problem 1 (b) If you compare baboon.ppm with baboon1.ppm (S=1) you cannot (or maybe hardly) see a difference. For me, the two images look the same. If you don't zoom in, baboon2.ppm (S=2) looks also the same, but if you zoom in, you see that baboon2.ppm has more quadratic artifacts for example at the brighter blue "stripe" in the center of the red nose. When it comes to the eyes, you can see that some of the darker regions are lost in the subsampled image. Looking at baboon4.ppm (S=4), you can see without zooming in that there is a (small) difference with respect to the blue stripe on the nose. Also, if you go up the nose a little bit, you see that when the red turns into darker colors, some of the fine details are lost. On the original image, there is a yellow spot if you go a little bit up from the mouth. In the subsampled image this spot has a different color (something about red/orange). baboon8.ppm (S=8) shows significant differences already on the first look. At the border, when the red color of the nose goes into a blue, you see dark artifacts which means that the subsampled image is not so smooth at this point. Also there are some dark (boxed) artifacts on the baboon's left eye. Zooming in shows that subsampling destroyes the "structure" of the eyes completely. If you zoom in you see ugly boxes. At the left and right nostril you also see that the image lost its smoothness. On the image baboon8.ppm you can see clearly boxes as a result of subsampling. (c) Since the luma component Y is not subsampled at all, you always need 8 bits for that. If you subsample the Cb or Cr channel, you subsample it in two dimensions, which means that you have for S=2 a subsampling by 4, for S=4 a subsampling by 16 and for S=8 a subsampling by 64. For S=2, this means that you need 8/4 = 2 bits for the Cb and 2 bits for the Cr channel. For S=4, you need 8/16 = 1/2. Since 0.5 bits is not possible, you need 1 bit for Cb and 1 bit for Cr. For S=8, you need 8/64 = 1/8. Since 0.125 bits is not possible, you also need 1 bit for Cb and 1 bit for Cr. To sum things up, I get the following result: S=2: 8 + 2 + 2 = 12 bits S=4: 8 + 1 + 1 = 10 bits S=8: 8 + 1 + 1 = 10 bits Problem 2 (b) The runtime for option 1 is significantly higher than for option 2. Runtime for option 1: real 1m35.486s user 1m34.102s sys 0m0.092s Runtime for option 2: real 0m2.377s user 0m1.712s sys 0m0.028s The spectra (boats1s.pgm and boats2s.pgm) also differ significantly. On boats2s.pgm you can see the structure of the boat while you don't see it on boats1s.pgm. This is due to the fact that you do the DCT in the second case block-wise which means that you only consider parts of 8x8 blocks to store your values. On boats1s.pgm you see the average grey value only at the top left of the spectrum while you have an average grey value for each block on boats2s.pgm. This is the reason why you see the structure of the boat on boats2s.pgm. (c) The high frequencies have been removed. If you compare the images with respect to their visual quality, you will see a better result for the 8x8 DCT. (d) If you look at the two spectra you will see that in boats5s.pgm more higher frequencies survive. On the other hand, this also means that frequencies which are not so important could also survive with the first strategy. The second strategy is better, because frequencies which are not so important do not or do hardly survive. This can be seen for example in the area where the wall near the lighthouse is "displayed" in the spectrum: with the first strategy you have a rather bright part here. Another point where you can see that the second strategy results in a finer spectrum is if you look at the white part on top of the the cabin on the first boat (the boat which is in front). If you compare the two images visually, you can see that there are less artifacts with the second strategy (cf. artifacts in the clouds). The weighting matrix introduces more "smoothness" to the image.