1
我想问一个关于分割二进制图像的问题。我试着用下面的代码:如何在Matlab中将图像划分为更小的部分(绘图)
%# FAPatch is the binary image
figure,imshow(FAPatch)
hold on
%# PositionTab is a table that include the 3 outest point.
for i=1 :3
eval(['p' num2str(i) '= PositionTab(' num2str(i) ',:);']);
end
%#C is the centroid [130,59]. And this is the code I use to draw the lines from centroid to the point
plot([C(1),p1(2)],[C(2),p1(1)],[C(1),p2(2)],[C(2),p2(1)],[C(1),p3(2)],[C(2),p3(1)],'Color','r','LineWidth',2)
这是表:
我得到一个二进制图象行:
如何分割这个图像分成三小块?这不是一条直线,可以是随机的,我找不到解决方案。
我的回答是否解决了您的问题?如果是这样,请考虑接受它作为您的答案 - 通过点击投票计数旁边的空心绿色勾号/复选标记。如果没有,请说出什么不起作用,以便我或其他人可以进一步帮助您。谢谢。 http://meta.stackexchange.com/questions/5234/how-does-accepting-an-answer-work/5235#5235 –