> For the complete documentation index, see [llms.txt](https://docs.unitlab.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.unitlab.ai/documentation/zh/annotations/annotation-tools/bounding-box.md).

# 矩形框标注工具

在 Unitlab Workbench 中使用矩形框（Bounding box）标注工具绘制、调整大小、移动和旋转矩形框，在重叠的框中选择下层对象，快速为目标检测模型准备训练数据，也适用于卫星影像中的旋转框和物体计数。

矩形框用一个矩形标出对象的位置。它是绘制最快的形状，也是目标检测模型最常见的输入。

![机器人拾取箱子的厨房台面，每个箱子都用矩形框标注](https://content.gitbook.com/content/vbN1G7M3hTB0Q58dqxlj/blobs/oq3AfignlLEpO0tTJWjp/tools-bbox-hero.webp)

## 适用场景 <a href="#when-to-use-it" id="when-to-use-it"></a>

* 目标检测，只需要位置和尺寸即可。
* 物体计数，例如料箱中的零件或货架上的商品。
* 在绘制更精细的多边形或掩码之前先做一遍粗标。

## 绘制矩形框 <a href="#draw-a-box" id="draw-a-box"></a>

1. 按 `B` 或在工具栏中选择 **Bounding Box**。
2. 选择一个矩形框类别，例如 **Object**。
3. 在对象的一个角按下，拖动到对角后松开。

矩形框会出现在 **Objects** 面板中。让四条边紧贴对象最外侧的可见边缘。

## 编辑矩形框 <a href="#edit-a-box" id="edit-a-box"></a>

* \*\*调整大小：\*\*选中矩形框并拖动边或角上的控制点。
* \*\*移动：\*\*在 **Pan**（`V`）模式下拖动框内区域。
* \*\*旋转：\*\*选中矩形框并拖动其上方的旋转控制点。对倾斜的对象（例如卫星影像中的船只）使用旋转框。

开启 [Auto select](https://docs.unitlab.ai/documentation/zh/annotations/annotation-tools/auto-select.md) 后，将指针停在已保存的矩形框上即可在不离开当前工具的情况下编辑它。在其他位置按下则绘制新框。

{% hint style="info" %}
\*\*矩形框相互重叠？\*\*开启 Auto select 后，`Shift` + 单击可选中下层的矩形框。
{% endhint %}

## 键盘快捷键 <a href="#keyboard-shortcuts" id="keyboard-shortcuts"></a>

| 操作                | 快捷键                       |
| ----------------- | ------------------------- |
| 矩形框工具             | `B`                       |
| 开启或关闭 Auto select | `A`                       |
| 选择下层矩形框           | `Shift` + 单击              |
| 删除选中的矩形框          | `Delete`                  |
| 复制、粘贴             | `Ctrl` + `C`、`Ctrl` + `V` |

相关内容：[标注工具](https://docs.unitlab.ai/documentation/zh/annotations/annotation-tools.md) · [立方体标注工具](https://docs.unitlab.ai/documentation/zh/annotations/annotation-tools/cuboid.md) · [Magic Touch 与 Detect all objects](https://docs.unitlab.ai/documentation/zh/auto-labeling/detect-anything-sam-1-sam-3.md)

<sub>机器人图像：</sub>[<sub>DROID 数据集</sub>](https://droid-dataset.github.io/)<sub>（Khazatsky 等，2024），CC BY 4.0。</sub>
