Back to Aurora Vision Library website

You are here: Start » Function Reference » Geometry 2D » Geometry 2D Fitting » FitLineToPoints_M


Header: AVL.h
Namespace: avl
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.


void avl::FitLineToPoints_M
	const atl::Array<avl::Point2D>& inPoints,
	atl::Optional<const avl::Range&> inRange,
	avl::MEstimator::Type inOutlierSuppression,
	float inClippingFactor,
	int inIterationCount,
	atl::Optional<const avl::Line2D&> inInitialLine,
	avl::Line2D& outLine,
	atl::Optional<atl::Array<avl::Point2D>&> outInliers = atl::NIL


Name Type Range Default Description
Input value
inPoints const Array<Point2D>&
Input value
inRange Optional<const Range&> NIL Determines which array points take part in fitting process
Input value
inOutlierSuppression MEstimator::Type
Input value
inClippingFactor float 0.675 - 6.0 2.5f Multitude of standard deviation within which points are considered inliers
Input value
inIterationCount int 0 - 5 Number of iterations of outlier suppressing algorithm
Input value
inInitialLine Optional<const Line2D&> NIL Initial approximation (if available)
Output value
outLine Line2D&
Output value
outInliers Optional<Array<Point2D>&> NIL Points matching the computed line

Optional Outputs

The computation of following outputs can be switched off by passing value atl::NIL to these parameters: outInliers.

Read more about Optional Outputs.


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.