发布网友 发布时间:2022-04-24 14:30
共1个回答
热心网友 时间:2022-05-05 05:08
A = imread(filename, 'JPEG');
B = dct2(A);
% If you need to do 8x8 block DCT or 16x16 block DCT
% you need to call the dct2() function for each of the 8x8 or 16x16
% blocks within a 2-D loop, that's not difficult:
[M,N]=size(A);
for i=1:8:floor(M/8)
for j=1:8:floor(N/8)
ablk = A(i:i+7,j:j+7);
dct_ablk = dct2(ablk);
% ... other processing here:
% ...
end
end