我想问一个关于拆分二进制图像的问题。我尝试使用以下代码:
%# 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)
这是表格:
我得到一个带有行的二进制图像:
如何将此图像分成三个小块?这不是一条直线,可以是随机的,我找不到解决方案。