> For the complete documentation index, see [llms.txt](https://docs.augelab.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.augelab.com/function-blocks/blocks-reference/ai-blocks/ocr-easyocr.md).

# OCR (EasyOCR)

A function block that detects text in images using the EasyOCR engine. It can return recognized text, individual text segments, bounding boxes, and an optional annotated image. Includes automatic rotation attempts to handle rotated text.

## 📥 Inputs <a href="#inputs" id="inputs"></a>

`Image` Grayscale or color image containing text to be recognized.

## 📤 Outputs <a href="#outputs" id="outputs"></a>

`Result` Annotated image with detected text boxes and optional text labels.

`Whole Text` All recognized text joined as a single string.

`Texts` List of recognized text segments.

`Boxes` List of polygon boxes for each detected text (4 points per box).

## 🕹️ Controls <a href="#controls" id="controls"></a>

`Use auto rotation` Enable attempts to rotate the image (90°, -90°, 180°) to improve detection on rotated text.

`Show Texts` Toggle display of recognized text labels on the annotated `Result` image.

`Threshold` Confidence threshold slider to filter out low-confidence text detections (0–100%).

## 🎯 Features <a href="#features" id="features"></a>

* Multi-angle detection: tries simple rotations to handle rotated text when `Use auto rotation` is enabled.
* Confidence filtering: remove weak detections by adjusting `Threshold`.
* Visual output: returns an annotated `Result` image with boxes and optional text labels when detections are produced.
* Returns both aggregated `Whole Text` and individual `Texts` and `Boxes` for downstream processing.

## 📝 Usage <a href="#usage" id="usage"></a>

1. Connect an image-producing block into the `Image` socket.
2. Optionally enable `Use auto rotation` if source images may be rotated.
3. Adjust `Threshold` to balance sensitivity vs false detections.
4. Enable `Show Texts` if you want text labels drawn on the `Result` image.
5. Use the outputs to save, log, or further process recognized text and box coordinates.

## 📊 Evaluation <a href="#evaluation" id="evaluation"></a>

When executed, the block analyzes the input image (and rotated variants if enabled), filters detections by the `Threshold`, and returns the annotated image (if any), the full concatenated text, a list of text segments, and the list of polygon boxes.

## 💡 Tips and Tricks <a href="#tips-and-tricks" id="tips-and-tricks"></a>

* Preprocess low-quality images with `Image Resizer` or `Super Resolution` to improve recognition on small or blurred text.
* Crop to the text area first using `Image ROI Select` or `Image ROI` so the block focuses on relevant regions.
* Reduce background clutter with `Background Removal (RMBG-1.4)` or `Background Removal (BiRefNet)` before OCR when text sits on complex backgrounds.
* Improve contrast and readability using `Auto Contrast`, `Adjust Colors`, `Denoising`, or `Image Threshold` depending on the input.
* For live inspection, route the `Result` to `Show Image` to preview annotated detections.
* Save detection images or logs with `Image Logger`, `Image Write`, or export recognized text using `Data to JSON` or `CSV Export`.
* If you need alternative OCR behavior, compare results with the generic `OCR` block or combine with `Draw Detections` to overlay custom visuals.

## 🛠️ Troubleshooting <a href="#troubleshooting" id="troubleshooting"></a>

* No text detected: lower the `Threshold` and ensure the input image is not too small — try `Image Resizer` or `Super Resolution`.
* False positives or garbled text: raise the `Threshold` and apply `Denoising` or `Auto Contrast` to stabilize inputs.
* Rotated text not found: enable `Use auto rotation` to try common rotations, or pre-align using `Auto Alignment` if you have a reference.
* Too many small detections: crop to the region of interest with `Image ROI Select` and filter results by bounding box size in downstream blocks.
