Back to Adaptive Vision Library website
You are here: Start » Function Reference » Geometry 2D Fitting » FitLineToPoints_TheilSen
FitLineToPoints_TheilSen
| Header: | AVL.h |
|---|---|
| Namespace: | avl |
Approximates points with a line using TheilSen algorithm, optionally with Siegel's improvement.
Syntax
C++
C#
void avl::FitLineToPoints_TheilSen ( const atl::Array<avl::Point2D>& inPoints, atl::Optional<const avl::Range&> inRange, avl::TheilSenVariant::Type inVariant, avl::Line2D& outLine )
Parameters
| Name | Type | Default | Description | |
|---|---|---|---|---|
![]() |
inPoints | const Array<Point2D>& | Input points | |
![]() |
inRange | Optional<const Range&> | NIL | Determines which array points take part in fitting process |
![]() |
inVariant | TheilSenVariant::Type | Switches between Theil-Sen and Siegel methods | |
![]() |
outLine | Line2D& | Fitted line |
Errors
List of possible exceptions:
| Error type | Description |
|---|---|
| DomainError | Empty array of points in FitLineToPoints_TheilSen. |
| DomainError | Range exceeds the input point array in FitLineToPoints_TheilSen. |


