如何利用matlab打开jpeg图像,并进行dct变换,请高手指点?

发布网友 发布时间: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

声明声明:本网页内容为用户发布,旨在传播知识,不代表本网认同其观点,若有侵权等问题请及时与本网联系,我们将在第一时间删除处理。E-MAIL:11247931@qq.com