Image ROI Select
This function block provides an interactive image area where you can draw a rectangular crop (ROI) using the mouse. Use it to quickly define a region of interest for downstream processing, inspection, or saving.
π₯ Inputs (sockets)
Image Any Connect an image to this socket to enable interactive selection. The image can be RGB or grayscale.
π€ Outputs (sockets)
Image Any A visualization of the source image with the selected rectangle drawn on it.
Rectangle The rectangle coordinates of the selected ROI (top-left and bottom-right points).
πΉοΈ Controls
Image Click and drag inside this display area to draw the ROI rectangle. Release the mouse to finalize the selection.
Last Selection The last drawn rectangle is kept and shown on the image display after running the block. The selection is preserved across saves and reloads.
π¨ Features
Interactive click-and-drag selection for fast ROI definition.
Visual feedback with a clear green rectangle drawn over the image.
Outputs both the cropped image region and the rectangle coordinates for use in other blocks.
Selection persists so you can tweak downstream processing without reselecting immediately.
π Usage Instructions
Connect an image-producing block to the
Image Anyinput.Run the system once so the image appears in the block.
Click and drag inside the
Imagearea to draw a rectangle over the region you want to crop. Release to confirm.Downstream blocks will receive the cropped image and the rectangle coordinates when this block is evaluated.
Examples of common workflows:
Preview and fine-tune a crop prior to saving frames with
Image WriteorImage Logger.Crop a region before sending it to
Find ObjectorTemplate Matchfor faster, more focused detection.Use the cropped output with
Histogram On LineorColor Density Percentageto analyze a specific part of the image.
π Evaluation
When evaluated, the block returns:
a copy of the image with the rectangle drawn (
Image Any), andthe rectangle coordinates (
Rectangle). If no selection is made, the full image area is returned as the ROI.
π‘ Tips and Tricks
To inspect the crop in a larger window, pair this block with
Show Image.If you need polygonal ROIs instead of rectangular ones, use
Image ROI PolygonorImage ROI Polygon Multi.Combine with
Image Resizewhen a fixed processing size is required by downstream blocks.Save selected frames or datasets by connecting the cropped output to
Image WriteorImage Logger.Use
Apply Maskif you want to further mask out parts of the cropped region before analysis.
π οΈ Troubleshooting
No image appears: ensure an image-producing block is connected to
Image Anyand the system has been run once.Selection does not update visually: try running the block after drawing; the display refreshes when evaluated.
ROI coordinates seem out of range: make sure the source image resolution is the same as the one displayed. If you resize upstream images, reselect the ROI.
Need repeated or multiple ROIs: use
Image ROI Polygon Multito define multiple regions or save your selection and reapply it with downstream flow control blocks.
Last updated
Was this helpful?