FitLineToPoints_M


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#
Python
 
def FitLineToPoints_M(
	inPoints: list[Point2D],
	inIterationCount: int,
	/,
	*,
	inRange: Range | None = None,
	inOutlierSuppression: MEstimator = MEstimator.Huber,
	inClippingFactor: float = 2.5,
	inInitialLine: Line2D | None = None
)
-> (
	outLine: Line2D,
	outInliers: list[Point2D]
)

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 inOutlierSuppression MEstimator MEstimator.Huber
Input value inClippingFactor float 0.675 - 6.0 2.5 Multitude of standard deviation within which points are considered inliers
Input value inIterationCount int 0 - Number of iterations of outlier suppressing algorithm
Input value inInitialLine Line2D | None None Initial approximation (if available)
Output value outLine Line2D
Output value outInliers list[Point2D] Points matching the computed line