Image ROI Polygon Multi
This function block lets you draw and save multiple polygonal regions of interest (ROIs) directly on an image. Use it to highlight areas, crop multiple irregular regions, and export each polygon as a separate image for further processing.
π₯ Inputs
ImageImage to annotate and extract polygons from.
π€ Outputs
Highlighted ImageThe original image annotated with saved polygons and current drawing overlay.Polygon ImagesList of cropped image regions for each saved polygon.PolygonsList of polygon coordinate sets (shape data) describing each saved polygon.
πΉοΈ Controls
Image AreaClickable image canvas where you draw polygons with the mouse.Left mouse clickAdd a vertex to the current polygon.SSave the current polygon (must have at least three points).UUndo last point or enter edit mode for the last saved polygon.CClear the current polygon or remove the last saved polygon.InfoOn-block help text reminding you of the key controls and shortcuts.
π¨ Features
Interactive drawing: create polygons by clicking directly on the image.
Multi-polygon support: save and manage several polygons in the same image.
Edit and undo: recover the last saved polygon for adjustment with the
Ushortcut.Visual overlays: saved polygons are highlighted and numbered; current polygon shows live preview.
Cropped outputs: each saved polygon is exported as an individual image ready for downstream processing.
Efficient caching: avoids unnecessary redraws when image and polygons are unchanged.
βοΈ Running mechanism
Feed an
Imageinto the block. The image appears on the interactive canvas.Draw a polygon by left-clicking successive vertices. A live overlay shows lines and filled preview for the current polygon.
Press
Sto save a completed polygon (minimum three points). Saved polygons become part of theHighlighted Imageand appear in thePolygon ImagesandPolygonsoutputs.Use
Uto undo the last point (or to edit the last saved polygon). UseCto clear the current drawing or delete the last saved polygon.The block returns the annotated image, the list of cropped polygon images, and the polygon coordinate data whenever evaluated.
π‘ Tips and Tricks
To preview the result in a larger window, combine with the
Show Imageblock: feed this block'sHighlighted ImagetoShow Imagefor an expanded viewer.If you need rectangular ROIs instead of polygons, try the
Image ROI SelectorImage ROI Select Multiblocks for quick rectangle drawing.Use
Get ROIif you want to apply other blocks to rectangular crops derived from polygon bounding boxes.For applying the polygon as a binary mask and filtering the image content, pair with
Apply Mask. Feed the polygon image intoMaskand the original image intoImageto extract only the polygon area.To analyze features inside a polygon (for instance, line peaks), crop the polygon output and connect it to
Histogram On LineorHistogram On Curve.For detection pipelines, send each
Polygon Imagesoutput intoFind Object,Object Detection, orObject Detection - Customto run matching/detection only inside selected areas.Save results automatically using
Image LoggerorImage Writeby connecting them to the relevant cropped images.If your source image is large, use
Image Resizerbefore drawing to speed up interaction, then map polygon coordinates back to the original if needed.
π οΈ Troubleshooting
Nothing appears on the canvas: ensure an
Imageis connected and the block has been run at least once.Saved polygon not exported correctly: confirm the polygon had at least three points before saving with
S.Cropped polygon looks shifted or clipped: check image aspect ratio and any resizing blocks upstream. If you resize before drawing, keep track of scale when using crops downstream.
Too slow with many polygons: reduce image resolution with
Image Resizerwhile drawing, or limit the number of saved polygons. Use the blockβs outputs to store only the required polygon images.
Last updated
Was this helpful?