Back to Aurora Vision Library website

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

FitLineToPoints_LTE


Header: AVL.h
Namespace: avl
Module: FoundationBasic

Approximates points with a line using Least Trimmed Error algorithm.

Applications: Brute-force finding of a line that best matches a subset of the input points. Very efficient against outliers, but possibly slow for bigger subsets.

Syntax

C++
C#
 
void avl::FitLineToPoints_LTE
(
	const atl::Array<avl::Point2D>& inPoints,
	atl::Optional<const avl::Range&> inRange,
	int inSeedSubsetSize,
	atl::Optional<int> inEvalSubsetSize,
	avl::Line2D& outLine,
	atl::Optional<atl::Array<avl::Point2D>&> outLTInliers = atl::NIL,
	atl::Optional<float&> outLTError = atl::NIL,
	int& diagIterationCount = atl::Dummy<int>()
)

Parameters

Name Type Range Default Description
Input value inPoints const Array<Point2D>& Input points
Input value inRange Optional<const Range&> NIL Determines which array points take part in fitting process
Input value inSeedSubsetSize int 2 - 10 3 Number of points in one combination for getting a sample line
Input value inEvalSubsetSize Optional<int> 3 - NIL Number of closest points used for evaluation of a sample line, or Auto if seed points are to be used
Output value outLine Line2D& Fitted line
Output value outLTInliers Optional<Array<Point2D>&> NIL Inlying points of the best LTE line
Output value outLTError Optional<float&> NIL The Least Trimmed Error
Diagnostic input diagIterationCount int& Number of combinations considered

Optional Outputs

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

Read more about Optional Outputs.

Errors

List of possible exceptions:

Error type Description
DomainError Empty array of points in FitLineToPoints_LTE.
DomainError Range exceeds the input point array in FitLineToPoints_LTE.