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

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);

Réponses (0)

Catégories

En savoir plus sur Convert Image Type dans Centre d'aide et File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by