Image ROI Select
This function block lets you select a single rectangular region of interest (ROI) interactively by dragging on the image preview. It is ideal for cropping an area from an image for further processing or inspection.
π₯ Inputs
Image Any The image to crop. Connect a grayscale or color image to define the area that can be selected.
π€ Outputs
Image Any The cropped image corresponding to the selected rectangle.
Rectangle The pixel rectangle describing the selected area (top-left and bottom-right coordinates).
πΉοΈ Controls
Image Preview The interactive preview where you create and edit the rectangular ROI by mouse.
Drag Create a rectangle by dragging on the preview, or drag inside the rectangle to move it.
Edge / Corner Drag Resize the rectangle by dragging an edge or corner.
Ctrl Hold to force creation of a new rectangle even if an existing rectangle is present.
π― Features
Interactive rectangle creation, move and resize directly on the image preview.
Visual overlay shows the current rectangle and highlights it during interaction.
Accepts single or repeated selection; the most recent ROI is used for output.
Cropped result is returned immediately as an image along with rectangle coordinates.
The selected rectangle is preserved so the same ROI can be restored when the project is reloaded.
βοΈ Running mechanism
Provide an image to the
Image Anyinput and run the scenario once to load the image into the preview.Use the preview to
Dragand draw a rectangle. Drag inside the rectangle to move it, or drag edges/corners to resize.The block computes the pixel coordinates of the selected rectangle and outputs:
the cropped image extracted from those coordinates via
Image Anythe rectangle coordinates via
Rectangle
The preview overlay updates live while you create or edit the ROI.
π Usage instructions
Connect an image-producing block to the
Image Anyinput and run once to populate the preview.Draw the ROI by clicking and dragging on the preview.
Move or resize the ROI as needed.
Hold
Ctrlwhile dragging to create a fresh rectangle.Use the outputs to feed the cropped image or the rectangle coordinates to downstream blocks.
π‘ Tips and Tricks
Combine with
Show Imageto open the cropped result in a larger viewer for inspection.If you need multiple editable ROIs, use
Image ROI Select Multiinstead of this block.Use
Image Resizeafter this block to normalize crop sizes before running detection or analysis.Feed the cropped output into
Find Objectwhen you want to run template matching only inside the selected area β this reduces false matches and speeds processing.Save important crops using
Image LoggerorImage Writeto record examples for later review or training data.To visualize detections or coordinates back on the original image, use
Draw Rectangledownstream with theRectangleoutput.
π οΈ Troubleshooting
If the preview is empty, make sure the producing block is connected and that you have run the pipeline once to load image data.
If selection appears outside the image, verify the input image dimensions and redraw the ROI inside the preview area.
For final processing, confirm the cropped image resolution is appropriate for downstream blocks (use
Image Resizeif needed).
Last updated