How can I extract only the compressed image from that code? (not the reconstructed one)
1 次查看(过去 30 天)
显示 更早的评论
I followed the link and i got the reconstructed one but i also need to extract the compressed one : https://www.mathworks.com/help/images/discrete-cosine-transform.html
0 个评论
采纳的回答
cui,xingxing
2022-12-12
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 * block_struct.data * T';
B = blockproc(I,[8 8],dct);
invdct = @(block_struct) T' * block_struct.data * T;
I_recover = blockproc(B,[8 8],invdct);
figure;
err = immse(I,I_recover)
imshowpair(I,I_recover,'montage')
you see, I and I_recover are the same
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Import, Export, and Conversion 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!