필터 지우기
필터 지우기

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

조회 수: 2 (최근 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