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 Any input 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

  1. Connect an image source to Image Any (for example a camera block like Camera USB or a file loader like Load Image).

  2. Run the scenario once so the image appears on the interactive canvas.

  3. Click and drag on the canvas to draw rectangles. Release to finalize each rectangle.

  4. Use U to undo the last rectangle or C to clear all.

  5. Re-run to update outputs; use the Images output to continue processing the cropped regions and the Rectangles output when you need position data.

πŸ’‘ Tips and Tricks

  • If the input image is large and canvas interaction is slow, precede this block with Image Resize to reduce the working size for faster selection, then feed the resulting ROIs into a higher-resolution pipeline if needed.

  • Use Show Image to preview selected ROIs or to open a larger viewer for precise selection.

  • Combine with Find Object or Template Match by sending cropped ROIs to those blocks for focused detection on each region.

  • Save crops automatically by routing the Images output to Image Logger or Multi Image Write.

  • Create a dataset grid of all selected ROIs using Collage Images after selection to review results at a glance.

  • If you need polygonal regions instead of rectangles, consider Image ROI Polygon Multi for multi-polygon selection workflows.

πŸ› οΈ Troubleshooting

  • No image appears on the canvas

    • Ensure an image-producing block is connected to Image Any and 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 Images output 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?