Project 6
Problem 3: In this project, I used a 2D Discrete Cosine Transform to eliminate high frequency data from images in order to compress them to lower quality levels. I found that the quality quickly began to deteriorate as the quantization value p was increased. In problem 3, an 8x8 chunk of the original image was experimented with first, using different p values, and then the entire image was quantized and de-quantized as well. The image was originally color, but was converted to black and white in order to simplify things. Code Used:
Problem 4: In this portion, the same process of trying p = 1, p = 2, and p = 4 was used, as in the previous problem. However, this time JPEG quantization was used. In problem 3, a linear quantization matrix Q was generated by p*8./hilb(8) in Matlab. This time the JPEG recommended Matrix was entered and used for the quantization instead. Code for this section.
Problem 5: This problem involved performing DCT and quantization/dequantization on each color of the image (r, g, b) and then combining the three colors back into a single image. As you can see in the images to the right, the quality of the image decreases with increasing p, becoming more blocky and difficult to see. Code for this section.
Problem 6: Finally, the last problem centered around using the YUV system instead of the rgb system. The colors of the image were converted into a luminance value Y, as well as U, V. Then, these were run through the same process of quantization/dequantization used before. Afterwards, the transformation into YUV space was reversed, bringing the final result back into the rgb system before displaying it. These are the equations for the YUV transformation: Y = 0.299*r + 0.587*g + 0.114*b; U = b - Y; V = r - Y; First, I used the 'JPEG' Quantization Matrix for the Y, U, and V values. That code is here. Then, I also tried using the color difference matrix for U, V, and JPEG for the Y values. That code is here. There is no apparent difference between the two types of matrices being used for quantization of the U and V values.