Back to Adaptive Vision Library website
You are here: Start » Function Reference » Path Features » PathDiameter
PathDiameter
Finds the longest segment connecting two characteristic points of a path.
Syntax
C++
C#
void avl::PathDiameter ( const avl::Path& inPath, atl::Optional<avl::Segment2D&> outDiameter, atl::Optional<float&> outDiameterLength )
Parameters
Name | Type | Default | Description | |
---|---|---|---|---|
inPath | const Path& | Input path | ||
outDiameter | Optional<Segment2D&> | |||
outDiameterLength | Optional<float&> |
Description
The operation finds the most distant pair of points within a path and returns the distance between them (outDiameterLength) and the segment representing the diameter (outDiameter). If there is more than one pair of maximal distance, the returned segment will correspond to one of them. The orientation of the resulting outDiameter is always between 0 and 180 degrees.
Examples
Errors
Error type | Description |
---|---|
DomainError | Empty path on input in PathDiameter. |