提取二值图中连通域的包围框 matlab


[l,mm]=bwlabel(img2,8);%img2为二值图
status=regionprops(l,'BoundingBox'); %%画外接矩形
hold on;
for i=1:mm
rectangle('position',status(i).BoundingBox,'edgecolor','r');
end
hold off;
aa=zeros(mm,4);
a=status;
for ig=1:mm
aa(ig,1:4)=a(ig).BoundingBox;
end

 

 

参考
https://blog.csdn.net/jzwong/article/details/83352360

你可能感兴趣的:(提取二值图中连通域的包围框 matlab)