Problem

Image Compression by the Two-Dimensional Discrete Cosine Transform Here, you will use a...

Image Compression by the Two-Dimensional Discrete Cosine Transform

Here, you will use a full-frame two-dimensional discrete cosine transform to implement a very simple image compression algorithm. The 2D DCT and the inverse 2D DCT functions are implemented in MATLAB with the functions dct2() and idct2().

(a) Obtain a grayscale image and read it into MATLAB.

(b) Compute the image’s DCT coefficients, using the dct2() command. Inverse the transform coefficients, using the idct2() command. Display the inverse transformed image (remember to convert it to uint8 first) and make sure that you are getting your image back.

(c) Write a MATLAB function that has an input argument for the percentage of DCT coefficients corresponding to the lowest horizontal and vertical frequencies (i.e., the upper left portion of the matrix of DCT coefficients) you will keep. The rest of the coefficients will be set to zero (a very crude form of signal compression). Using this function, keep 50, 25, 15, 10, 5, and 1 percent of the lowest frequency coefficients and set the rest to zero. For each case, obtain the inverse image.

(i) At what percent do you start to notice degradation in the image quality?

(ii) Why do we keep the lower frequency coefficients instead of the higher frequency coefficients?

Print out and turn in

(i) the original image:

(ii) the image with just 1% of the DCT coefficients;

(iii) the image at which you notice degradation in the image quality.

Step-by-Step Solution

Request Professional Solution

Request Solution!

We need at least 10 more requests to produce the solution.

0 / 10 have requested this problem solution

The more requests, the faster the answer.

Request! (Login Required)


All students who have requested the solution will be notified once they are available.
Add your Solution
Textbook Solutions and Answers Search
Solutions For Problems in Chapter 12