> 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/detections-shapes/roi-processing/image-roi-circle.md).

# Image ROI Circle

This function block lets you create a single editable circular region of interest (ROI) on an image. Use the interactive canvas to draw, move and resize the circle. The block returns the cropped circular image and a circle shape (center and radius) that you can pass to other blocks.

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

`Image` Image to crop and to edit the circle overlay on (grayscale or color).

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

`Image` Cropped image containing the circular area (background outside circle masked out).

`Circle` Circle shape describing the selected ROI as center and radius (useful for geometry-aware blocks).

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

`ROI Canvas` Interactive image area where you create and edit the circle by mouse.

`Create by Drag` Click-and-drag on the canvas to create a new circle.

`Move Center` Drag the circle center to reposition the ROI.

`Resize Radius` Drag the radius handle to change the circle size.

`Clear (C)` Press the C key to clear the current circle and start over.

## ⚙️ Running mechanism <a href="#how-it-works" id="how-it-works"></a>

* The block displays the provided image on the interactive canvas and overlays the current circle (if set).
* While running, the canvas listens for mouse drag and move events to create, move or resize the circle.
* Once a valid circle exists, the block produces the cropped circular image (masked) and a shape output containing center and radius values.
* If the circle is not defined or radius is zero the block outputs `None` for both sockets so downstream blocks can handle the absence of a ROI.

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

* Intuitive click-and-drag interaction to create an ROI.
* Separate handles for moving the center and resizing the radius.
* Immediate visual feedback with a colored overlay and handle highlighting.
* Outputs both the masked crop and a reusable shape description.

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

1. Connect an image-producing block to the `Image` input and run once so the image appears on the canvas.
2. Click and drag on the `ROI Canvas` to create a circle.
3. Drag the circle center to move it or drag the radius handle to resize.
4. Press `C` to clear and redraw if needed.
5. Use the `Image` and `Circle` outputs to send the crop or shape to other blocks.

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

* Preview the selected crop in a larger window with `Show Image` for a closer inspection before exporting.
* If your source image is large, use `Image Resize` before this block to speed interaction and ensure the ROI fits the workspace.
* Use `Apply Mask` to combine the circular mask with other images or to overlay the mask result on a different background.
* To select more complex or multiple regions, consider using `Image ROI Select` or `Image ROI Polygon Multi` and then refine with this circular ROI if needed.
* Save captured crops directly using `Image Logger` or `Image Write` for record keeping or downstream processing.
* Preprocess noisy inputs with `Blur` or `Image Threshold` so the visual region aligns better with your detection or measurement workflows.
* Combine circle outputs with measurement or analysis blocks (for example shape-analysis or detectors) by passing the `Circle` shape where supported.

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

* No image visible on the canvas: ensure the upstream block is producing an image and run the scenario once so the image is loaded.
* Outputs are `None`: circle center or radius is undefined, or radius is effectively zero. Redraw the circle.
* Circle appears off or too small: try resizing the canvas via upstream `Image Resize` or redraw the circle at a larger scale.
* Interaction feels unresponsive: confirm the image was provided at least once and that the canvas shows the image; re-run the block if needed.
