image compressing with DCT

2 Ansichten (letzte 30 Tage)
adi
adi am 22 Nov. 2011
what is the coding Elimination of DCT coefficients for jpeg image compression ?? i using matlab R2008a
help me..
  1 Kommentar
Walter Roberson
Walter Roberson am 22 Nov. 2011
I do not understand this question as phrased, unless it is a duplicate of your other question http://www.mathworks.com/matlabcentral/answers/21891-jpeg-image-compressing-with-dct

Melden Sie sich an, um zu kommentieren.

Antworten (1)

Hamrit
Hamrit am 13 Mai 2012
dvalue=imread('yourimage');
dvalue = double(dvalue)/255;
dvalue = rgb2gray(dvalue);
imshow(dvalue)
img_dct=dct2(dvalue);
img_pow=(img_dct).^2;
img_pow=img_pow(:);
[B,index]=sort(img_pow);%no zig-zag
B=flipud(B);
index=flipud(index);
compressed_dct=zeros(size(dvalue));
coeff = 20000;% maybe change the value
for k=1:coeff
compressed_dct(index(k))=img_dct(index(k));
end
im=idct2(compressed_dct);
imwrite(im, 'Hassan.jpg')
not for color Jpeg

Kategorien

Mehr zu Denoising and Compression finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by