Appearance
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
| Name | Type | Description |
|---|---|---|
| first | polygon | The first polygon for distance calculation |
| second | polygon | The second polygon for distance calculation |
Outputs
| Name | Type | Description |
|---|---|---|
| horizontal | number | The horizontal distance between polygon centers |
| vertical | number | The 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.
Related links
Reference:
- Move Polygon — translates a polygon by given offsets
- Polygon Overlap — calculates area overlap between polygons