Question

Discrete Cosine Transform. a. On the 256x256 grayscale image kobi.png, calculate the two-dimensional Discrete Cosine Transform...

Discrete Cosine Transform.
a. On the 256x256 grayscale image kobi.png, calculate the two-dimensional Discrete Cosine
Transform using dct2. Output the results: the input image, and the DCT image.
b. Take the DCT image in (a), and apply the two-dimensional inverse DCT image. Subtract that from
the original kobi.png image, and plot the image of the absolute value of the differences. Does the
entire image have zero values? Why not?

0 0
Add a comment Improve this question Transcribed image text
Answer #1

%Following commands or program used is given below

im=imread('kobi.png') %Reading the image

imr=imresize(im,[256 256]) % Resizing of the image if the size is not 256X256

figure(1), imshow(imr)

imd=dct2(imr)   %It Computes IDCT of the image

imshow(imd)   %It Shows DCT of the image

imid=idct2(imd)   %It Computes Inverse DCT of the image

imshow(imid)  %It shows Inverse DCT of the image

diff=imr- uint8(imid) % It compute difference between resized image and Inverse DCT image

imshow(diff) % It shows difference between DCT image and Inverse DCT image

Explanation

Does the entire image have zero values?

No .

Why not?

DCT is Lossy compression. Hence the expected values in Reconstructed image (IDCT) will not be exactly the same as the original due to loss during computation of DCT image. However, error is within some margin

Add a comment
Know the answer?
Add Answer to:
Discrete Cosine Transform. a. On the 256x256 grayscale image kobi.png, calculate the two-dimensional Discrete Cosine Transform...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT