# Text Detection

This function block is used to identify and locate text within images using a deep learning model. It processes the input image and provides outputs indicating where text is detected.

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

`Image Any` The input image in which text needs to be detected.

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

`Image Any` The modified image with detected text locations highlighted.

`Referance Point` The coordinates of the reference point for each detected text box.

`Referance Rectangles` The coordinates of the rectangles bounding each detected text area.

`Number of Detected Text` The total number of text areas detected in the input image.

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

`Confidence` A slider to set the confidence threshold for text detection. Higher confidence values lead to stricter detection criteria.

`NMS Threshold` A slider to adjust the Non-Maximum Suppression (NMS) threshold, which helps filter out overlapping bounding boxes.

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

`Deep Learning Model` Utilizes a pre-trained deep learning model for robust text detection.

`Real-time Feedback` Adjusting controls allows users to modify detection settings in real time, improving detection results based on the input images.

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

1. **Input Image**: Connect an image source to the `Image Any` input.
2. **Adjust Detection Settings**: Use the `Confidence` and `NMS Threshold` sliders to configure the detection parameters.
3. **Run the Block**: Execute the block to perform text detection. The output image will highlight detected text areas along with their reference points and the quantity of detected text.

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

Upon evaluation, this function block processes the input image to detect text and outputs a modified image with detected text highlighted, as well as additional information such as reference points, rectangles, and the count of detected text areas.

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

<details>

<summary>Improving Detection Accuracy</summary>

Use higher confidence values (e.g., above 70) for clearer text to ensure only the most confident detections are returned.

</details>

<details>

<summary>Handling Different Lighting Conditions</summary>

If text detection is poor in low light or uneven lighting, consider preprocessing the image with an `Auto Contrast` or `Histogram Equalization` to improve visibility.

</details>

<details>

<summary>Selecting Input Types</summary>

Ensure that the input image is of good quality with clear text for optimal detection results. Low-resolution or blurry images may hinder performance.

</details>

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

<details>

<summary>No Text Detected</summary>

If no text is detected, ensure the image quality is high, and verify that the input contains legible text. Adjust the `Confidence` slider to a lower value to test for more sensitive detection.

</details>

<details>

<summary>Performance Issues</summary>

For larger images, reducing the input dimensions may improve processing speed. Consider resizing images if you encounter slow performance.

</details>
