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

FitSegmentToPoints_RANSAC
Header: | FIL.h |
---|---|
Namespace: | fil |
Module: | FoundationBasic |
Approximates points with a segment using a RANSAC algorithm.
Applications: Finds a well matching segments, but for handling outliers requires a distance threshold that may be difficult to set.
Syntax
C++
C#
void fil::FitSegmentToPoints_RANSAC ( const ftl::Array<fil::Point2D>& inPoints, ftl::Optional<const fil::Range&> inRange, ftl::Optional<int> inMaxOutlierCount, float inMaxInlierDistance, ftl::Optional<int> inIterationCount, ftl::Conditional<fil::Segment2D>& outSegment )
Parameters
Name | Type | Range | Default | Description | |
---|---|---|---|---|---|
![]() |
inPoints | const Array<Point2D>& | |||
![]() |
inRange | Optional<const Range&> | NIL | Determines which array points take part in fitting process | |
![]() |
inMaxOutlierCount | Optional<int> | 0 - ![]() |
0 | Determines how many outlier points can be present to end the search |
![]() |
inMaxInlierDistance | float | 0.0 - ![]() |
3.0f | Distance from the output segment for a point to be considered an inlier |
![]() |
inIterationCount | Optional<int> | 1 - ![]() |
42 | Number of iterations; Auto means that all point pairs will be used |
![]() |
outSegment | Conditional<Segment2D>& |
Errors
List of possible exceptions:
Error type | Description |
---|---|
DomainError | Empty array of points in FitSegmentToPoints_RANSAC. |
DomainError | Range exceeds the input point array in FitSegmentToPoints_RANSAC. |