您好,我正在使用 matlab 并尝试使用边界框选择一个区域。代码如下图
BW=bwconncomp(I1);
STATS = regionprops(BW, 'FilledArea','BoundingBox','Image');
结果如下图
我正在尝试获得如下所示的输出。可能吗?
最佳答案
我在 File Exchange 上找到了这两个用于生成定向边界框的代码:
orientedBox
David Legland 在 geom2d 中:OBOX = orientedBox(PTS)
Computes the oriented bounding box of a set of points.imOrientedBox
Feret 直径和方向盒 也由 David LeglandOBB = imOrientedBox(IMG)
Computes the minimum area oriented bounding box of labels in imageIMG
.
您可能会从 imOrientedBox
中找到您想要的东西。
关于matlab - 如果图像使用 matlab,则区域周围的最小矩形边界框,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29103460/