Azzera filtri
Azzera filtri

image compressing with DCT

4 visualizzazioni (ultimi 30 giorni)
adi
adi il 22 Nov 2011
what is the coding Elimination of DCT coefficients for jpeg image compression ?? i using matlab R2008a
help me..
  1 Commento
Walter Roberson
Walter Roberson il 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

Accedi per commentare.

Risposte (1)

Hamrit
Hamrit il 13 Mag 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

Categorie

Scopri di più su Denoising and Compression in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by