Index exceeds matrix dimensions. Error in nv (line 21) R = BL(i,j,1);
조회 수: 1 (최근 30일)
이전 댓글 표시
a=imread('Fig1(a).jpg');
% re=imresize(a,[768 768]);
% [r,c,numberofpixels]=size(re);
J = imresize(a, [768 786]);
[r c]=size(J);
bs=8; % Block Size (32x32)
row=r/bs;
col=c/bs;
nob=row*col;
% Total number of 32x32 Blocks
% Dividing the image into 32x32 Blocks
kk=0;
l=0;
[F]=zeros(96,96);
%[B0]=zeros(32,32);
for i=1:row
for j=1:col
BL=J((i-1)*8+[1:8],(j-1)*8+[1:8],1:3);
figure,imshow(BL);
% imwrite(BL,'C:\Users\Admin\Desktop\sample\op.jpg');
R = BL(i,j,1);
G = BL(i,j,2);
B = BL(i,j,3);
% figure,imshow([R G B]);
d=[R G B];
disp(d);
end
end
댓글 수: 0
답변 (1개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Matrix Indexing에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!