Skip to content

Polygon Overlap

Overview

The Polygon Overlap node computes the percentage of a Region of Interest (ROI) that is occupied by one or more polygons.

Use Polygon Overlap when:

  • You want to measure what fraction of an area is filled by detected items.

⚠️ Warning

Using a higher resolution will result in more accurate calculation, although it the processing time might significantly increase.

Inputs

NameTypeDescription
polygonslist[polygon]The polygon or list of polygons to check for overlap with the ROI.
roipolygonThe region of interest that defines the target area.

Outputs

NameTypeDescription
overlapnumberFraction of the ROI covered by the input polygons (0–1).

Parameters

ParameterDefaultValid valuesTunable
Resolution width1000≥ 1
Resolution height1000≥ 1

Resolution width

The pixel width of the internal rasterization grid used when calculating polygon overlap.

Resolution height

The pixel height of the internal rasterization grid used when calculating polygon overlap.

Example

Checking container fill level

A flow monitors a storage bin (defined as an ROI) and detects items inside it. The Polygon Overlap node calculates what percentage of the bin area is covered by these items.

Configuration:

  • Resolution width: 512
  • Resolution height: 512

Result: The node outputs 0.232, indicating that roughly 23 % of the ROI is covered by the detected items.

Polygon Overlap computation on a PCB inspection scene
Overlap computation for two detected objects within a region of interest (ROI). The ROI is shown as a blue dashed rectangle. Two detected polygons (green) represent PCB boards on the assembly surface. The node computes the fraction of ROI pixels that intersect with the polygon pixels. Here, the combined polygon area covers approximately 23.2 % of the ROI (overlap = 0.232).

Reference: