Image ROI Select Multi
This function block lets you interactively select multiple rectangular regions of interest (ROIs) on an input image using the mouse. Use clickβandβdrag to draw each rectangle, press U to undo the last rectangle, and press C to clear all selections. The block outputs the cropped images and the rectangle coordinates for further processing.
π₯ Inputs
Image Any
Accepts any image source (camera frame, loaded image, processed image) to display and crop.
π€ Outputs
Images
A list of cropped images, one per selected rectangle. If no rectangles are selected, the full input image is returned as a single-item list.
Rectangles
A list of rectangle coordinates corresponding to each cropped image. Coordinates are returned in image space for downstream blocks.
πΉοΈ Controls
Image interactive canvas
Click and drag on the image area to draw a rectangle.
Release the mouse to finalize the rectangle (a live preview is shown while drawing).
The canvas shows all finalized rectangles overlaid for visual feedback.
U
Undo last finalized rectangle.
C
Clear all rectangles.
βοΈ Running mechanism
When an image is provided to the
Image Anyinput and the block runs, the image is shown on the interactive canvas.Each drawn rectangle is recorded and kept between runs so you can refine selections across steps.
On evaluation the block crops the input image for every stored rectangle and returns the cropped images and their rectangle coordinates.
If no rectangles are present, the block returns the whole image as a single ROI so downstream flow continues without interruption.
β¨ Features
Select multiple ROIs in one session and keep them for repeated processing.
Live preview while drawing and clear visual overlays of all ROIs.
Keyboard shortcuts for quick undo and clear operations.
Outputs both cropped images and rectangle coordinates so you can use either image or spatial data downstream.
Works with any image-producing block (live camera, file loader, or a processed image).
π Usage instructions
Connect an image source to
Image Any(for example a camera block likeCamera USBor a file loader likeLoad Image).Run the scenario once so the image appears on the interactive canvas.
Click and drag on the canvas to draw rectangles. Release to finalize each rectangle.
Use
Uto undo the last rectangle orCto clear all.Re-run to update outputs; use the
Imagesoutput to continue processing the cropped regions and theRectanglesoutput when you need position data.
π‘ Tips and Tricks
If the input image is large and canvas interaction is slow, precede this block with
Image Resizeto reduce the working size for faster selection, then feed the resulting ROIs into a higher-resolution pipeline if needed.Use
Show Imageto preview selected ROIs or to open a larger viewer for precise selection.Combine with
Find ObjectorTemplate Matchby sending cropped ROIs to those blocks for focused detection on each region.Save crops automatically by routing the
Imagesoutput toImage LoggerorMulti Image Write.Create a dataset grid of all selected ROIs using
Collage Imagesafter selection to review results at a glance.If you need polygonal regions instead of rectangles, consider
Image ROI Polygon Multifor multi-polygon selection workflows.
π οΈ Troubleshooting
No image appears on the canvas
Ensure an image-producing block is connected to
Image Anyand run the flow once to load image data.
Drawing does not register or preview is missing
Make sure the canvas is active and the image has been rendered. Try re-running the flow or reconnecting the image source.
Output list is empty
If no rectangles were selected this block returns the entire image as a single-item list; check the
Imagesoutput accordingly.
Selections look misaligned after resizing the viewer
The block stores coordinates relative to the image; ensure the input image used for cropping is the same resolution as shown in the canvas for pixel-perfect crops.
Last updated
Was this helpful?