matlab中连通区域的边界框

时间:2014-03-26 04:42:41

标签: matlab matlab-guide

Iprops = regionprops(cl,'BoundingBox');
Ibox = [Iprops.BoundingBox];

[m,n]=size(Ibox);

Ibox = reshape(Ibox,[4 (n/4)]);

figure,imshow(image);

hold on;
for cnt = 1:n/4
rectangle('position',Ibox(:,cnt),'edgecolor','r');
end

错误

使用矩形时出错 值必须是4元素向量

detecttext出错(第49行)

 rectangle('position',Ibox(:,cnt),'edgecolor','r');

1 个答案:

答案 0 :(得分:1)

尝试将其设为行而不是列:

Ibox(:,cnt).'
相关问题