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

  1. Connect an image-producing block to the Image Any input.

  2. Run the system once so the image appears in the block.

  3. Click and drag inside the Image area to draw a rectangle over the region you want to crop. Release to confirm.

  4. 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 Write or Image Logger.

  • Crop a region before sending it to Find Object or Template Match for faster, more focused detection.

  • Use the cropped output with Histogram On Line or Color Density Percentage to analyze a specific part of the image.

πŸ“Š Evaluation

When evaluated, the block returns:

  • a copy of the image with the rectangle drawn (Image Any), and

  • the 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 Polygon or Image ROI Polygon Multi.

  • Combine with Image Resize when a fixed processing size is required by downstream blocks.

  • Save selected frames or datasets by connecting the cropped output to Image Write or Image Logger.

  • Use Apply Mask if 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 Any and 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 Multi to define multiple regions or save your selection and reapply it with downstream flow control blocks.

Last updated

Was this helpful?