Question: Please help me write a matlab code to compress the image using the global DCT method to select the small magnitude coefficients and set them
Please help me write a matlab code to compress the image using the global DCT method to select the small magnitude coefficients and set them to zeros.

Also apply the following nose to the image.
im1=imnoise(im,gaussian,0,0.09);
im2=imnoise(im,salt & pepper,0.25);
Im3=imnoise(im,speckle,0.20);
Compress the image using the following ratios:
a. Retain 2% of the coefficients. (This requires sorting the coefficients and retaining the largest 2%, while the rest are set to zero.)
b. Retain 10% of the coefficients.
c. Retain 50% of the coefficients
d. Find the root mean square error between the original and reconstructed images in each case
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
