Info
此问题已关闭。 请重新打开它进行编辑或回答。
why this gives me "Index exceeds matrix dimensions?" can any one help me. Thanks in advance
1 次查看(过去 30 天)
显示 更早的评论
figure
img = imshow(stretched_CIR);
title('CIR after Decorrelation Stretch');
h = imfreehand;
m = createMask(h, img);
delete(h)
% Extract individual color channels
r = img(:,:,1);
g = img(:,:,2);
b = img(:,:,3);
%Now I evaluate for RGB color channels;
>> r = img(:,:,1);
%works but
>> g = img(:,:,2);
Index exceeds matrix dimensions.
%why?
0 个评论
回答(3 个)
Matthew Eicholtz
2016-10-5
Are you sure the image is RGB instead of grayscale? As the error suggests, the variable img must not have a 2 layer in the 3rd dimension.
0 个评论
此问题已关闭。
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!