Back to FabImage Library website
You are here: Start » Function Reference » Geometry 2D » Geometry 2D Fitting » FitLineToPoints_M

FitLineToPoints_M
Header: | FIL.h |
---|---|
Namespace: | fil |
Module: | FoundationBasic |
Approximates points with a line using selected M-estimator for outlier suppression.
Applications: Finding a locally optimal line. Good enough when the number of outliers is small.
Syntax
C++
C#
void fil::FitLineToPoints_M ( const ftl::Array<fil::Point2D>& inPoints, ftl::Optional<const fil::Range&> inRange, fil::MEstimator::Type inOutlierSuppression, float inClippingFactor, int inIterationCount, ftl::Optional<const fil::Line2D&> inInitialLine, fil::Line2D& outLine, ftl::Optional<ftl::Array<fil::Point2D>&> outInliers = ftl::NIL )
Parameters
Name | Type | Range | Default | Description | |
---|---|---|---|---|---|
![]() |
inPoints | const Array<Point2D>& | |||
![]() |
inRange | Optional<const Range&> | NIL | Determines which array points take part in fitting process | |
![]() |
inOutlierSuppression | MEstimator::Type | |||
![]() |
inClippingFactor | float | 0.675 - 6.0 | 2.5f | Multitude of standard deviation within which points are considered inliers |
![]() |
inIterationCount | int | 0 - ![]() |
5 | Number of iterations of outlier suppressing algorithm |
![]() |
inInitialLine | Optional<const Line2D&> | NIL | Initial approximation (if available) | |
![]() |
outLine | Line2D& | |||
![]() |
outInliers | Optional<Array<Point2D>&> | NIL | Points matching the computed line |
Optional Outputs
The computation of following outputs can be switched off by passing value ftl::NIL
to these parameters: outInliers.
Read more about Optional Outputs.
Errors
List of possible exceptions:
Error type | Description |
---|---|
DomainError | Empty array of points in FitLineToPoints_M. |
DomainError | Range exceeds the input point array in FitLineToPoints_M. |