I am getting error while performing dct and dwt for images,please correct it or give some suggestions.Thanks in advance

1)
for ii=1:length(yy1)%yy1 contains 2 cells of size 192x192x3
dwt{1,ii}=dwt(yy1{ii},'db4');% i need to store approximation coefficient alone.
end
2)
for ii=1:length(yy1)
dct{1,ii}=dct2(yy1{ii});% error is 'matrix dimension must agree'
end

 Réponse acceptée

dwt is for vectors. dct2 is for 2 dimensional arrays. You are trying to pass in 3 dimensional arrays.

5 commentaires

for dct2 i have converted from 3d to 2d,but still showing error:Output argument "b" (and maybe others) not assigned during call to "E:\toolbox\images\images\dct2.m>dct2".
Please show your revised code for the dct2 case. Also if there are warnings or other messages displayed, please show them here.
y11=rgb2gray(g1);%both g1 and g3 now converted into 192x240 uint8
y12=rgb2gray(g3);
y13={y11,y12}:
code:
for ii=1:length(y13)
dct2{1,ii}=dct2(y13{ii});
end%error is Attempt to execute SCRIPT images\private\dct as a function:
E:\toolbox\images\images\private\dct.m
Error in dct2 (line 50) b = dct(dct(arg1).').';
It looks to me as if you might have a corrupted installation or else a corrupted path. Try
resetdefaultpath
and then try again. If that fails you need to reinstall the wavelet toolbox.

Connectez-vous pour commenter.

Plus de réponses (0)

Produits

Community Treasure Hunt

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

Start Hunting!

Translated by