# Optical Character Recognition

## Overview

The OCR plugin allows you to run OCR on image assets in your project. The plugin will draw a bounding box around each OCR token, and add the recognized token text in the metadata of each box.

<table data-card-size="large" data-view="cards"><thead><tr><th align="center"></th><th data-hidden data-card-cover data-type="image">Cover image</th></tr></thead><tbody><tr><td align="center">Optical Character Recognition</td><td data-object-fit="contain"><a href="https://angohub-docs-assets.s3.eu-central-1.amazonaws.com/plugin-icons-banners/OCR.png">https://angohub-docs-assets.s3.eu-central-1.amazonaws.com/plugin-icons-banners/OCR.png</a></td></tr></tbody></table>

## Plugin Functionality

The Optical Character Recognition (OCR) Plugin automatically extracts text from images, converting it into structured annotations and add the recognized text in the metadata of the annotations. You can choose the level of detection (block, paragraph, line, or word) and specify the language for recognition.

<figure><img src="/files/LugRcuimmr4UIjEfgU6g" alt=""><figcaption></figcaption></figure>

#### Supported Data Types <a href="#supported-data-types" id="supported-data-types"></a>

* Image

#### Supported Annotation Tools <a href="#supported-annotation-tools" id="supported-annotation-tools"></a>

* Bounding Box

### Plugin Configuration <a href="#plugin-configuration" id="plugin-configuration"></a>

The **Overwrite** setting in model plugins controls whether existing annotations are replaced or kept. When enabled, the plugin replaces all existing annotations with new model predictions; when disabled, it simply adds the new results without deleting what’s already there.

The **Class Mapping** setting defines how the model’s predicted classes are linked to your project’s label schema. Follow these steps to prepare your class mapping.

1. In the "Class Mapping" field, open the left dropdown, and pick from one of the classes the plugin can detect.
2. Open the right dropdown, and pick from one of the tools you have created in your project.
3. Click on the "plus" button to finalize the pairing. Now the object class and your bounding box tool are linked. The plugin will use the selected bounding box tool to label the selected category.
4. Starting again from Step 1, link as many tools to categories as needed.

<figure><img src="/files/JoC3DD7xv8yDIM8928BV" alt=""><figcaption><p>Optical Character Recognition plugin integration to the workflow</p></figcaption></figure>

You may vary a number of settings related to the model plugin from the **Config JSON** field. Each option is detailed below:

```json
{
  "ocr_level": "paragraph",
  "selected_language": "eng"
}
```

* **"ocr\_level":** Defines the granularity of text extraction during OCR.
  * Options:
    * <kbd>"block"</kbd>
    * <kbd>"paragraph"</kbd>
    * <kbd>"line"</kbd>
    * <kbd>"word"</kbd>
  * Example:
    * <kbd>"ocr\_level": "paragraph"</kbd>

<figure><img src="/files/Rlfg63Oa0TqC0sbgmtcz" alt=""><figcaption><p>Example results showing how OCR output varies by <kbd>ocr_level</kbd>. From left to right: <kbd>block</kbd>, <kbd>paragraph</kbd>, <kbd>line</kbd>, and <kbd>word</kbd>.</p></figcaption></figure>

* **"selected\_language":** Specifies the language used for OCR text detection and recognition. Accepts standard ISO language codes.
  * Options:
    * <kbd>"ara"</kbd>
    * <kbd>"deu"</kbd>
    * <kbd>"eng"</kbd>
    * <kbd>"fra"</kbd>
    * <kbd>"tur"</kbd>
    * ...
  * Example:
    * <kbd>"selected\_language": "eng"</kbd>


---

# Agent Instructions: 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:

```
GET https://docs.imerit.net/plugins/first-party-ango-plugins/optical-character-recognition.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
