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

FitSegmentToPoints_LTE
Header: | FIL.h |
---|---|
Namespace: | fil |
Module: | FoundationBasic |
Approximates points with a segment using Least Trimmed Error algorithm.
Applications: Brute-force finding of a segment that best matches a subset of the input points. Very efficient against outliers, but possibly slow for bigger subsets.
Syntax
C++
C#
void fil::FitSegmentToPoints_LTE ( const ftl::Array<fil::Point2D>& inPoints, ftl::Optional<const fil::Range&> inRange, int inSeedSubsetSize, ftl::Optional<int> inEvalSubsetSize, fil::Segment2D& outSegment, ftl::Optional<ftl::Array<fil::Point2D>&> outLTInliers = ftl::NIL, ftl::Optional<float&> outLTError = ftl::NIL, int& diagIterationCount = ftl::Dummy<int>() )
Parameters
Name | Type | Range | Default | Description | |
---|---|---|---|---|---|
![]() |
inPoints | const Array<Point2D>& | Input points | ||
![]() |
inRange | Optional<const Range&> | NIL | Determines which array points take part in fitting process | |
![]() |
inSeedSubsetSize | int | 2 - 10 | 3 | Number of points in one combination for getting a sample segment |
![]() |
inEvalSubsetSize | Optional<int> | 3 - ![]() |
NIL | Number of closest points used for evaluation of a sample segment, or Auto if seed points are to be used |
![]() |
outSegment | Segment2D& | Fitted segment | ||
![]() |
outLTInliers | Optional<Array<Point2D>&> | NIL | Inlying points of the best LTE segment | |
![]() |
outLTError | Optional<float&> | NIL | The Least Trimmed Error | |
![]() |
diagIterationCount | int& | Number of combinations considered |
Optional Outputs
The computation of following outputs can be switched off by passing value ftl::NIL
to these parameters: outLTInliers, outLTError.
Read more about Optional Outputs.
Errors
List of possible exceptions:
Error type | Description |
---|---|
DomainError | Empty array of points in FitSegmentToPoints_LTE. |
DomainError | Range exceeds the input point array in FitSegmentToPoints_LTE. |