Back to Adaptive Vision Library websiteYou are here:
Start »
Function Reference »
Region Features »
RegionDiameter
Computes the longest segment connecting two pixels contained in region and its length.
Syntax
C++
C#
void avl::RegionDiameter
(
const avl::Region& inRegion,
atl::Optional<avl::Segment2D&> outDiameter = atl::NIL,
atl::Optional<float&> outDiameterLength = atl::NIL
)
void RegionDiameter
(
Region inRegion,
out Segment2D? outDiameter,
out float? outDiameterLength
)
Parameters
Description
The operation finds the most distant pair of region pixels 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.
Hints
- If the input region is not guaranteed to be non-empty, precede this filter with SkipEmptyRegion.
Examples
The resulting outDiameterLength = 276.4815, outDiameter segment was drawn onto the region.
Errors
Error type |
Description |
DomainError |
Empty region in RegionDiameter |
See Also
- PathDiameter – Finds the longest segment connecting two characteristic points of a path.