Check Area (Polygon)
This function block lets you draw a polygon directly on an image and check whether given position coordinates fall inside that polygon. Use it to highlight a region of interest (ROI), count or mark objects inside the area, and export the polygon as a shape for downstream processing.
π₯ Inputs (sockets)
Input Image (Binary Image) This is the image on which you draw the polygon and see visual feedback.
Position Coordinate List A list of point coordinates (x, y) to test against the drawn polygon. Multiple positions are supported.
π€ Outputs (sockets)
Output Image The image with the polygon area highlighted and detected positions marked.
Polygon Coordinates The polygon vertices as a shape that can be used by other blocks.
Object In Area Boolean that indicates if any provided positions lie inside the polygon.
Detected Positions The list of positions that are found to be inside the polygon.
πΉοΈ Controls (widgets & interactions)
Image Canvas Click on the image to add polygon points. The drawn polygon is displayed over the image in real time.
U Press this key to undo the last added point.
C Press this key to clear all polygon points and start over.
Select Area Use the drawing interaction to create the desired polygon region.
π¨ Features
Visual polygon drawing over the input image with persistent preview.
Immediate visual highlighting of the selected area with a translucent overlay.
Marking of detected positions inside the polygon with clear visual markers.
Returns polygon coordinates as a reusable shape for other processing blocks.
Supports multiple input positions and reports which are inside the drawn area.
βοΈ Running mechanism
The image provided to the
Input Image (Binary Image)socket is displayed on the canvas.You interactively add polygon vertices by clicking on the canvas. Each click becomes a vertex.
The drawn polygon is visually highlighted on the image.
When position coordinates are supplied to the
Position Coordinate Listsocket, the block checks each point and marks those inside the polygon.Results (highlighted image, polygon coordinates, boolean flag and detected positions) are output so other blocks can consume them.
π Usage instructions
Connect an image to
Input Image (Binary Image)to enable the drawing canvas.Click on the image to add polygon vertices in clockwise or counterclockwise order.
Use
Uto undo a point orCto clear and redraw the polygon.Feed a list of coordinates to
Position Coordinate Listto check which points are inside the polygon.Use the
Polygon Coordinatesoutput to pass the drawn area to other blocks for further processing.
π‘ Tips and Tricks
To provide the points to test automatically, use
Find ObjectorObject Detection(orObject Detection - Custom) upstream so detected object centers can be fed into thePosition Coordinate Listinput.Visualize results in a larger window by connecting the
Output ImagetoShow Imagefor an expanded preview.Save or log the highlighted images by connecting
Output ImagetoImage LoggerorImage Write.To create multiple ROI areas, combine this block with
Image ROI Polygon Multito manage several polygons and pass the selected polygon coordinates further.If you want to mark detections with rectangles instead of points, use
Draw RectangleorDraw Pointdownstream with the coordinates provided by this block.For tracking workflows, feed detections from
Object Detectioninto anObject_Detection_Trackerand use this block to check entry/exit events inside a polygonal area.
π οΈ Troubleshooting
If clicks do not appear, ensure an image is connected to the
Input Image (Binary Image)socket and the canvas is visible.If points are reported outside unexpectedly, verify that coordinate format matches (x, y) and that coordinates are in the same reference frame as the displayed image.
If the polygon disappears between sessions, redraw it or store the polygon output to a persistent storage block (e.g., use outputs with file or logging blocks) and reapply when needed.
Last updated
Was this helpful?