Index exceeds matrix dimensions. Error in nv (line 21) R = BL(i,j,1);
1 view (last 30 days)
Show older comments
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 Comments
Answers (1)
See Also
Categories
Find more on Matrix Indexing in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!