JPEG Compression with 8x8 DCT Block
Afficher commentaires plus anciens
Hi, i did this code to apply the jpeg compression to an image.
clc
clear all
close all
a=imread('coins.png');
figure(1)
imagesc(a)
xlabel('x')
ylabel('y')
title('a(x,y)')
colormap('gray')
colorbar
Atdc=dct2(a);
T=10;
Atdc(abs(Atdc)<T)=0;
Ac=idct2(Atdc);
figure (2)
imagesc(log10(abs(Atdc)+1))
xlabel('u')
ylabel('v')
colorbar
title('TDC')
K=rescale(Ac);
figure(3)
montage({a,K})
title('Original (left) and compressed (right')
But now I need to modify this code to apply an 8x8 DCT block, I suppose I have to change T for a matrix of ones, but I have no idea how to do this. I hope someone can help me, thanks.
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Neighborhood and Block Processing dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!