Back to Adaptive Vision Library website

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

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.

Syntax

C++
C#
 
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
)

Parameters

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

Errors

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.