FitLineToPoints_RANSAC


Approximates points with a line using a RANSAC algorithm.

Applications:Finds a well matching line, but for handling outliers requires a distance threshold that may be difficult to set.

Syntax

C++
C#
Python
 
def FitLineToPoints_RANSAC(
	inPoints: list[Point2D],
	/,
	*,
	inRange: Range | None = None,
	inMaxOutlierCount: int | None = 0,
	inMaxInlierDistance: float = 3.0,
	inIterationCount: int | None = 42
)
-> outLine: Line2D | None

Parameters

Name Type Range Default Description
Input value inPoints list[Point2D]
Input value inRange Range | None None Determines which array points take part in fitting process
Input value inMaxOutlierCount int | None 0 - 0 Determines how many outlier points can be present to end the search
Input value inMaxInlierDistance float 0.0 - 3.0 Distance from the output line for a point to be considered an inlier
Input value inIterationCount int | None 1 - 42 Number of iterations; Auto means that all point pairs will be used
Output value outLine Line2D | None