フィルターのクリア

how matlab function dct2() is different from the the following 2-dct code

1 回表示 (過去 30 日間)
Muhammad Kashif
Muhammad Kashif 2018 年 7 月 31 日
編集済み: Muhammad Kashif 2018 年 7 月 31 日
i applied matlab function dct2() and the following code. both methods gives me different values. if you explain why? it will be helpful. thanks
T = dctmtx(8);
dct = @(block_struct) T * block_struct.data * T';
codeI1 = im2double(codeI); % coded image
B = blockproc(codeI1,[8 8],dct);
mask = [1 1 1 1 0 0 0 0
1 1 1 0 0 0 0 0
1 1 0 0 0 0 0 0
1 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0];
B2 = blockproc(B,[8 8],@(block_struct) mask .* block_struct.data);
figure
imshow(B);
invdct = @(block_struct) T' * block_struct.data * T;
I2 = blockproc(B2,[8 8],invdct);
figure
imshow(I2);

回答 (0 件)

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by