Back to Adaptive Vision Library website
You are here: Start » Function Reference » Shape Features » ShapeElongation
ShapeElongation
Computes the elongation factor of a shape (perfect circle has minimal elongation equal 1.0).
Header: | AVL.h |
---|
Syntax
C++
C#
void avl::ShapeElongation ( const avl::Path& inShape, float& outElongation )
Parameters
Name | Type | Default | Description | |
---|---|---|---|---|
inShape | const Path& | |||
outElongation | float& |
Description
Elongation is a measure of how long the shape is in relation to its width. The perfect circle has the minimal elongation equal to 1.0, while the upper bound doesn't exist. The operation internally approximates the shape with an ellipse, and then computes the result as: Where L denotes the longer axis of the approximating ellipse, and S denotes the shorter one.
Note that if the input path is not a valid shape (i.e. it has at least one self-intersection), the computation may lead to results that are not intuitive.
Examples
Errors
Error type | Description |
---|---|
DomainError | Open path on input in ShapeElongation. |
DomainError | Degenerate shape on input in ShapeElongation. |
See Also
- RegionElongation – Computes the elongation factor of a region ( perfect circle has minimal elongation equal 1.0 ).
- ShapeCircularity – Computes the area of a shape divided by the area of a circle having the same feature.