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!