【发布时间】:2015-12-23 22:51:38
【问题描述】:
我想在 matlab 中使用 regionprops 'BoundingBox' 属性找到连接组件对象的宽度和高度。我找到并标记了矩形,但我不知道如何提取高度和宽度。那么我该如何提取是吗?我的代码如下所示
cc=bwconncomp(im);
stats=regionprops(cc,'BoundingBox');
for n = 1 : length(stats)
thisBB = stats(n).BoundingBox;
rectangle('Position', [thisBB(1),thisBB(2),thisBB(3),thisBB(4)],...
'EdgeColor','r','LineWidth',1 )
end
【问题讨论】:
标签: matlab