[求助]关于划分边界区域
rt
这是我的程序:
A=imread('F:\cs.bmp');
BWB=roipoly(A);
BWF=roipoly(A);
[m,n]=size(A);
for(i=0:1:m)
for(j=0:1:n)
if BWB(i,j)==0&&BWF(i,j)==0;
C(i,j)=0;
else if BWB(i,j)==255&&BWF(i,j)==255;
C(i,j)=255;
else C(i,j)=100;
end
end
end
end
figure,imshow(C);
错误信息:
Attempted to access BWB(0,0); index must be a positive integer or logical.
Error in ==> GUI>pushbutton1_Callback at 86
if BWB(i,j)==0&&BWF(i,j)==0;
Error in ==> gui_mainfcn at 75
feval(varargin{:});
Error in ==> GUI at 44
gui_mainfcn(gui_State, varargin{:});
??? Error while evaluating uicontrol Callback.