简体   繁体   English

如果图像使用matlab,则区域周围的最小矩形边界框

[英]Minimal Rectangle Bounding box around a region if an image using matlab

Hi i am working with matlab and trying to select a region using a bounding box. 您好我正在使用matlab并尝试使用边界框选择区域。 The code is as shown below 代码如下所示

BW=bwconncomp(I1);
STATS = regionprops(BW, 'FilledArea','BoundingBox','Image');

The result is as shown below 结果如下所示

在此输入图像描述

I am trying to obtain an output as shown below. 我正在尝试获得如下所示的输出。 Is it possible? 可能吗?

在此输入图像描述

I found these two codes for the generation of oriented bounding boxes on the File Exchange: 我发现这两个代码用于在文件交换上生成定向边界框

  • orientedBox in geom2d by David Legland : orientedBox大卫Legland geom2d:

    OBOX = orientedBox(PTS) Computes the oriented bounding box of a set of points. OBOX = orientedBox(PTS)计算一组点的定向边界框。

  • imOrientedBox in Feret diameter and oriented box also by David Legland imOrientedBox费雷特直径和方向的盒子也由大卫Legland

    OBB = imOrientedBox(IMG) Computes the minimum area oriented bounding box of labels in image IMG . OBB = imOrientedBox(IMG)计算图像IMG中标签的最小面向边界框。

You will probably get what you are looking for from imOrientedBox . 你可能会从imOrientedBox得到你想要的imOrientedBox

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM