Skip to content

Polygon Distance

Overview

The Polygon Distance node calculates the horizontal and vertical distance between the center points of two polygons. These calculations use normalized coordinates (0 to 1 range) to ensure consistent results across different image resolutions.

Use Polygon Distance when:

  • You need to determine the proximity of two detected objects
  • You want to trigger actions based on how far an object is from a reference zone

💡 Tip

This node is useful for calculating spatial relationships between objects, like determining if a product is close to a target bin.

Inputs

NameTypeDescription
firstpolygonThe first polygon for distance calculation
secondpolygonThe second polygon for distance calculation

Outputs

NameTypeDescription
horizontalnumberThe horizontal distance between polygon centers
verticalnumberThe vertical distance between polygon centers

Parameters

This node does not have any configuration parameters.

Example

Measuring distance between objects

A flow detects two separate parts on a conveyor belt and needs to ensure they are properly spaced. The Polygon Distance node computes their relative distance in the image frame.

Result: The node provides the specific horizontal and vertical distances between the two parts.

Polygon Distance node measuring horizontal and vertical center-to-center distances between two polygons
The Polygon Distance node calculates the horizontal and vertical distances between the centres of two polygons. The distances are normalized values to the image size.

Reference: