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

# Bounding Box

Overview of the Bounding Box labeling tool in Ango Hub

The bounding box labeling tool allows you to draw a box around an object or point of interest in an image. It also allows you to perform OCR on the area marked by the box.

{% hint style="info" %}
The Bounding Box tool is supported across the Image, Video, DICOM, and Medical labeling editors.
{% endhint %}

![](https://3895963154-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Mj9Q2CMggO8ujraHZeP%2F-Mk6PkSagTqxzKOwanFv%2F-Mk6QRjBJ6Pd_HgPLrh-%2Fimage.png?alt=media\&token=28971697-21eb-4e6a-9f83-58bc59bcd22b)

## How to add a Bounding Box tool to your project <a href="#how-to-add-a-bounding-box-tool-to-your-project" id="how-to-add-a-bounding-box-tool-to-your-project"></a>

From the project’s *Settings* tab, enter the *Label Set* section.

Click on *Add Category*. From the list that appears, click on *Bounding Box*.

A new row will appear named *Bounding Box*. Click on it to expand it.

<figure><img src="https://3895963154-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTcOUG6rfWxqGM0N4db2P%2Fuploads%2FfdPWuWNo3od4HuzIMeEa%2Fimage.png?alt=media&amp;token=62448756-03cc-4621-9e03-635f0ba46c51" alt=""><figcaption></figcaption></figure>

**Schema ID**: A unique ID which identifies this class in your project.

**Title:** The name of your class.

**Required:** Whether or not annotators have to add at least one instance of this class in order to submit their annotation task.

**Targeted OCR**: By enabling this, you will be able to perform OCR and get the OCR results in the exports for the areas highlighted by the bounding boxes belonging to this class.

If you would like to ask labelers further questions, for example, if you want to show a further *radio* after drawing the bounding box, click on *Add Classification* and add a further question. [More on nested questions here](/labeling/labeling-tools/tools/nested-classifications.md).

### How to Draw a Bounding Box <a href="#how-to-draw-a-bounding-box" id="how-to-draw-a-bounding-box"></a>

Click on the image where you’d like the bounding box to start. Click again where you’d like the bounding box to end.

![](https://3895963154-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Mj9Q2CMggO8ujraHZeP%2F-Mk6PkSagTqxzKOwanFv%2F-Mk6QRjBJ6Pd_HgPLrh-%2Fimage.png?alt=media\&token=28971697-21eb-4e6a-9f83-58bc59bcd22b)

After creating the box, you can change its size by selecting it by clicking it, then dragging on its points. You can drag the entire bounding box by selecting it then dragging it with the mouse cursor.

### Move and Resize Bounding Boxes with the Keyboard

Select a bounding box, then use the following shortcuts. On macOS, use **Option** in place of **Alt**.

| Action                                        | Shortcut                 |
| --------------------------------------------- | ------------------------ |
| Move the box one image pixel in any direction | Alt + Arrow key          |
| Expand the box horizontally                   | Ctrl + Alt + Right arrow |
| Shrink the box horizontally                   | Ctrl + Alt + Left arrow  |
| Expand the box vertically                     | Ctrl + Alt + Up arrow    |
| Shrink the box vertically                     | Ctrl + Alt + Down arrow  |

Resizing adjusts both opposite edges by one image pixel. For example, expanding horizontally moves the left edge left and the right edge right. Edges stop at the image boundary.

Hold **Shift** with any of these shortcuts to make larger adjustments. The size of the larger adjustment depends on the current zoom level.

You can select multiple boxes to move or resize them together. Locked boxes are not changed. These shortcuts are not available for NRRD or NIfTI series, in read-only tasks, or while drawing an annotation.

## How to Add a Halo around Bounding Boxes

To add a visual "halo" around bounding boxes, in the labeling editor, click on the quick settings icon, then on "Enable Halo Box". Enter the Halo Box Margin in pixels.

<figure><img src="https://3895963154-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTcOUG6rfWxqGM0N4db2P%2Fuploads%2FmYLcBj9SqHBrmemkMDdm%2Fimage.png?alt=media&amp;token=42df9b2a-0967-4c38-9347-e3a84a222c6d" alt=""><figcaption></figcaption></figure>

This halo box is purely visual and has no impact on the final export.

## Perform OCR on the contents of the bounding box

Hub allows you to perform OCR on the contents of bounding boxes, both single and in bulk.

To do so, when adding your bounding box class to your project, enable the *Targeted OCR* toggle as mentioned [in this section](#how-to-add-a-bounding-box-tool-to-your-project).

### On a Single Bounding Box

Once you are in the labeling editor, draw a bounding box over the text you'd like to perform OCR on. Then, right-click on the box and expand the context menu. This is what you should see:

<figure><img src="https://3895963154-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTcOUG6rfWxqGM0N4db2P%2Fuploads%2FCUERaY8WdjDCFd65cnXm%2Fimage.png?alt=media&amp;token=8a3b6446-8ba7-4d71-b8b2-a0c381b570dd" alt=""><figcaption></figcaption></figure>

Click on the![](https://3895963154-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTcOUG6rfWxqGM0N4db2P%2Fuploads%2FRHLfDSuI4WTMxUO1RHqy%2Fimage.png?alt=media\&token=a02c0517-0ec6-4b2b-9778-e075b87d12f0)button to perform OCR on the area highlighted by the box. The OCR results will appear in the context menu, together with how confident our OCR module is about the OCR results:

<figure><img src="https://3895963154-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTcOUG6rfWxqGM0N4db2P%2Fuploads%2Fl4ITqVhrr3jYy2uKXcbu%2Fimage.png?alt=media&amp;token=2dcac74d-5e13-426f-adf3-a3e5687f45aa" alt=""><figcaption></figcaption></figure>

### On Multiple Bounding Boxes <a href="#differences-between-bounding-box-and-polygon" id="differences-between-bounding-box-and-polygon"></a>

In the labeling editor, press *Shift* and click on the bounding boxes you'd like to perform OCR on. Once you have selected all boxes, right click on any one of them and click on *Run OCR*.

To see the OCR results, right-click on a box and expand the context menu that appears. Alternatively, expand the rows in the *Objects* section in the lower-left corner of the UI.

## 3D Bounding Box Tool in Medical Labeling Editor

{% embed url="<https://docs.imerit.net/labeling/labeling-editor-interface/medical-labeling-editor/3d-bounding-box>" %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.imerit.net/labeling/labeling-tools/tools/bounding-box.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
