please help : Subscripted assignment dimension mismatch. Error in dct (line 13) imred(:,:,1) = uint8(red);

1 次查看(过去 30 天)
function dct(I) coder.extrinsic('dctmtx');
%dctmtx - Compute discrete cosine transform matrix. T = dctmtx(8); red = double(I(:,:,1)); coder.extrinsic('imred'); imred = zeros(8,8);
imred(:,:,1) = uint8(red);
B = blkproc(imred,[8 8],'410*x*500',T,T'); mask = [16 11 10 16 24 40 51 61; 12 12 14 19 26 58 60 55; 14 13 16 24 40 57 69 56; 14 17 22 29 51 87 80 62; 18 22 37 56 68 109 103 77; 24 35 55 64 81 104 113 92; 49 64 78 87 103 121 120 101; 72 92 95 98 112 100 103 99]; B2 = blkproc(B,[8 8],'410.*x',mask); I2 = blkproc(B2,[8 8],'410*x*500',T',T);
  2 个评论
Rik
Rik 2017-2-22
编辑:Rik 2017-2-22
Have a read here and here.
Right now I can't really see what is going on and what is exactly your question.
jebli med
jebli med 2017-2-22
this is my code i use hdl coder in
matlab to convert my code but i have
this error :"Subscripted assignment dimension
mismatch. Error in dct (line 13) imred(:,:,1) = uint8(red);"
please can you help me
function dct(I)
coder.extrinsic('dctmtx');
%dctmtx - Compute discrete cosine transform matrix.
T = dctmtx(8);
red = zeros(8,8,1);
red = double(I(:,:,1));
coder.extrinsic('imred');
coder.extrinsic('blkproc');
imred(:,:,1) = uint8(red);
B = blkproc(imred,[8 8],'410*x*500',T,T');
mask = [16 11 10 16 24 40 51 61;
12 12 14 19 26 58 60 55;
14 13 16 24 40 57 69 56;
14 17 22 29 51 87 80 62;
18 22 37 56 68 109 103 77;
24 35 55 64 81 104 113 92;
49 64 78 87 103 121 120 101;
72 92 95 98 112 100 103 99];
B2 = blkproc(B,[8 8],'410.*x',mask);
I2 = blkproc(B2,[8 8],'410*x*500',T',T);
%figure, imshow(I4);
image(:,:,1)=I2;
image(:,:,2)=I3;
image(:,:,3)=I4;
figure,
subplot(1,2,1); imshow(I); title('image originale')
subplot(1,2,2); imshow(image); title('image compressée')
end

请先登录,再进行评论。

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Multirate Signal Processing 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by