# Draw Result On Image

This function block is used to overlay text on an input image based on a specified condition. It allows users to visually communicate success or failure of operations directly on the image.

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

`Image` The image onto which you want to overlay text.

`Condition` A boolean value that determines whether to display the success or failure text.

`Success Condition Text` The text that will be displayed on the image if the condition is true.

`Fail Condition Text` The text that will be displayed on the image if the condition is false.

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

`Image` The modified image with the overlaid text based on the specified condition.

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

`Font Scale` A slider to adjust the font size of the overlay text.

`Horizontal Position` A slider to control the horizontal positioning of the text overlay on the image.

`Vertical Position` A slider to control the vertical positioning of the text overlay on the image.

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

`Dynamic Text Overlay` The block allows for real-time adjustments to the text, making it easier to adapt to different image sizes or desired appearances.

`Visual Feedback` Provides immediate visual feedback on the outcome of processes based on the provided input condition.

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

1. **Connect Input Image**: Connect the image you want to annotate to the `Image` input.
2. **Set Condition**: Provide a boolean signal to the `Condition` input to determine whether the success or failure text should be displayed.
3. **Enter Success and Fail Texts**: Type the text you wish to display in both the `Success Condition Text` and `Fail Condition Text` fields.
4. **Adjust Text Position and Size**: Use the font scale and position sliders to place the text on the image as desired.
5. **Evaluate**: Run the block to see the changes reflected on the output image.

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

When executed, this function block will produce a version of the input image with the text overlaid according to the specified condition, allowing for easy interpretation of processing results.

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

<details>

<summary>Text Readability</summary>

When overlaying text on complex backgrounds, consider using semi-transparent backgrounds for the text to enhance readability. Adjust the text color to contrast with the image for better visibility.

</details>

<details>

<summary>Test with Various Inputs</summary>

Use different success and failure texts along with sample images to ensure proper positioning and font scaling for various scenarios.

</details>

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

<details>

<summary>Text Overlapping with Image Edges</summary>

If the text is cut off or not fully visible, try adjusting the `Horizontal Position` and `Vertical Position` sliders to move the text further from the edges of the image.

</details>

<details>

<summary>Ensure Condition Input Works</summary>

If the text does not change based on the condition, ensure the `Condition` input is being updated correctly and is linked to a valid boolean source.

</details>
