---
title: "How To: Annotate Images with Oriented Bounding Boxes"
description: "From installation to a saved annotation - set up LumiScan Annotation, load a set of images, create labels, draw and correct oriented bounding boxes, and save them for training."
product: "LumiScan Annotation"
component: "lumiscan-annotation"
version: "1.8.4"
display_version: "1.8.4.3"
latest_version: true
language: "en"
url: "https://docs.hdvisionsystems.com/en/lumiscan-annotation/1.8.4/how-tos/annotate-images-with-oriented-bounding-boxes.html"
---

# How To: Annotate Images with Oriented Bounding Boxes – LumiScan Annotation

This guide takes you from the installation of LumiScan Annotation to a set of images annotated with oriented bounding boxes. The annotations are the training data for neural networks, for example for LumiScan AI Object Matching, trained with LumiScan Training.

When you have finished:

- LumiScan Annotation is installed and licensed,
- your images are loaded,
- the object classes are defined as labels,
- the objects in the images are marked with oriented (rotated) bounding boxes, and the annotations are saved next to the images.

This guide covers the operation of the software. How to annotate well - what a box should include, how to handle partly hidden objects - depends on the application and is agreed with the team that trains the network.

## Before you start {#prerequisites}

- Windows 11 PC with mouse and keyboard
- LumiScan Key with a licence for LumiScan Annotation, see [Requirements](https://docs.hdvisionsystems.com/en/lumiscan-annotation/1.8.4/requirements.html)
- The installer `Installer_LumiScan_Annotation_va_b_c_d.exe`, where `a.b.c.d` is the version
- The images to annotate, as PNG files

## How it fits together {#overview}

LumiScan Annotation shows one image at a time. You draw a box around each object and give it a label, the name of its class. Boxes can be rotated, so they fit objects that lie at any angle.

When you save, the annotations of the image are written as a CSV file next to the image. A JSON file records who saved, when, and which image and file. Several users can annotate the same folders: each save is recorded with the user selected in the application.

## Step 1 - Install CodeMeter Runtime {#step-1-codemeter}

LumiScan Annotation is licensed with the LumiScan Key and needs CodeMeter Runtime 9.00 or later.

1. Check whether CodeMeter Runtime is installed, for example in the Windows Start menu.
2. If not, install it and connect the LumiScan Key to a free USB port, as described in [Installing CodeMeter Runtime](https://docs.hdvisionsystems.com/en/lumiscan-licensing/1.0.4/installing-codemeter.html).

## Step 2 - Install LumiScan Annotation {#step-2-install}

1. Close all open applications.
2. Double-click `Installer_LumiScan_Annotation_va_b_c_d.exe`.
3. Accept the licence terms.
4. Keep the default installation folder or choose another one with **Browse**, then click **Next**.
5. Click **Install**, then **OK** and **Finish**.

LumiScan Annotation can now be started from the Windows Start menu. The detailed steps are in [Installing LumiScan Annotation on Windows](https://docs.hdvisionsystems.com/en/lumiscan-annotation/1.8.4/installing-lumiscan-annotation-on-windows.html).

## Step 3 - Prepare the images {#step-3-images}

Put the PNG images to annotate into one folder. To work on several sets, give each set its own folder below a common folder:

```
<data folder>
├── <set A>
│   ├── image_001.png
│   └── image_002.png
└── <set B>
    ├── image_003.png
    └── image_004.png
```

You then select the common folder once and switch between the sets in the application. See [Folder Structure](https://docs.hdvisionsystems.com/en/lumiscan-annotation/1.8.4/folder-structure.html).

## Step 4 - Start the application and select the images {#step-4-start}

1. Start LumiScan Annotation. On the first start, the window is empty.

2. Click **Menu > Settings**.

3. Click **Set Folder** and select the folder with the images, or the common folder of several sets.

   ![Settings window of LumiScan Annotation with the fields Data Directory](https://docs.hdvisionsystems.com/en/lumiscan-annotation/1.8.4/_images/howto-obb-settings.png)

   *Figure 1. Settings window with the data directory*

4. Optional: click **User Management** and add your user name, then select it in the **User** field of the main window. Every save is recorded with this name.

5. Close the settings window.

Expected: the images are listed under **List of Pictures**. With several sets, the **Folder** field at the top selects the set.

![Main window of LumiScan Annotation with two annotated packages in the central view](https://docs.hdvisionsystems.com/en/lumiscan-annotation/1.8.4/_images/howto-obb-main.jpg)

*Figure 2. Main window with an annotated image*

The main window shows, from left to right, the image with its boxes, the list of images, the list of labels, the field to add labels, and sliders for brightness and contrast. The buttons below the image go to the previous image, save, and go to the next image. All elements are described in [User Interface](https://docs.hdvisionsystems.com/en/lumiscan-annotation/1.8.4/user-interface.html).

## Step 5 - Create the labels {#step-5-labels}

A label is the name of an object class, for example `back` or `foliert`. Create one label for each class the network is to tell apart.

1. Type the name in the field under **Add Label**.
2. Click **Add Label**.

The label appears in the label list with a number. The selected label is given to every new box.

![Label list with the entries 1: back and 2: foliert](https://docs.hdvisionsystems.com/en/lumiscan-annotation/1.8.4/_images/howto-obb-labels.png)

*Figure 3. Label list and the Add Label field*

## Step 6 - Draw an oriented bounding box {#step-6-draw}

1. Select the label of the object in the label list.
2. Double-click on the image where the **bottom edge** of the box is to be. This edge is always drawn green.
3. Click on the **top edge** of the object, without holding the mouse button. This sets the height.
4. Click on a **side** of the object, again without holding the button. This sets the width.

The box is drawn with the selected label. Its green edge marks the bottom of the object, so the box also records which way the object faces.

![Rotated bounding box around a package](https://docs.hdvisionsystems.com/en/lumiscan-annotation/1.8.4/_images/howto-obb-box.jpg)

*Figure 4. An oriented bounding box around a package; the green edge marks its bottom*

## Step 7 - Correct and delete boxes {#step-7-correct}

Click a box to select it. A selected box shows four yellow corner handles. Then:

- drag inside the box to move it,
- drag an edge to change its size in that direction,
- drag a corner to rotate it around its centre,
- select another label, or press its number `1` to `9`, to change the label,
- right-click the box to delete it.

For fine adjustments, use the keyboard: `Ctrl`/`Shift` with `i`, `j`, `k`, `l` moves the box by one or ten pixels, with `u` and `o` rotates it by one or ten degrees. All shortcuts are listed in [Image Annotation](https://docs.hdvisionsystems.com/en/lumiscan-annotation/1.8.4/image-annotation.html) and [Shortcuts for Common Operations](https://docs.hdvisionsystems.com/en/lumiscan-annotation/1.8.4/shortcuts-for-common-operations.html).

## Step 8 - Save and go to the next image {#step-8-save}

1. Click **save** below the image, or press `s`.
2. Click **next**, or press `d`, to go to the next image. **previous**, or `a`, goes back.

![Buttons previous (a)](https://docs.hdvisionsystems.com/en/lumiscan-annotation/1.8.4/_images/howto-obb-navigation.png)

*Figure 5. Navigation buttons below the image*

Expected: next to the image, a CSV file with its boxes and a JSON file with the user name, the time, the image name and the name of the CSV file. The image is highlighted in the image list.

> [!TIP]
> When consecutive images differ only a little, press `Alt` + `s` to save and copy the boxes to the next image. Then only correct what has changed.

## Result {#result}

- LumiScan Annotation is installed and licensed.
- The images are loaded, and the object classes are defined as labels.
- The objects are marked with oriented bounding boxes, and the annotations are saved next to the images.

The folders with the images and their annotation files are the input for training. Answers to common questions are in the [FAQ](https://docs.hdvisionsystems.com/en/lumiscan-annotation/1.8.4/faq.html), problems in [Troubleshooting](https://docs.hdvisionsystems.com/en/lumiscan-annotation/1.8.4/troubleshooting.html).
