How can I extract only the compressed image from that code? (not the reconstructed one)

5 views (last 30 days)
I followed the link and i got the reconstructed one but i also need to extract the compressed one :

Accepted Answer

cui on 12 Dec 2022
hi, the reconstructed one is you want the compressed one.
or use B to recover origin image.
I = imread('cameraman.tif');
I = im2double(I);
T = dctmtx(8);
dct = @(block_struct) T * * T';
B = blockproc(I,[8 8],dct);
invdct = @(block_struct) T' * * T;
I_recover = blockproc(B,[8 8],invdct);
err = immse(I,I_recover)
err = 1.1837e-30
you see, I and I_recover are the same
  1 Comment
Khaled on 12 Dec 2022
ok thank you but the image has the same size so we got the image after decompression my goal is to get th image before decompression

Sign in to comment.

More Answers (0)


Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!