Back to Adaptive Vision Library website

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

FitLineToPoints_RANSAC


Header:AVL.h
Namespace:avl

Approximates points with a line using a RANSAC algorithm.

Syntax

C++
C#
 
void avl::FitLineToPoints_RANSAC
(
	const atl::Array<avl::Point2D>& inPoints,
	atl::Optional<const avl::Range&> inRange,
	atl::Optional<int> inMaxOutlierCount,
	float inMaxInlierDistance,
	atl::Optional<int> inIterationCount,
	atl::Conditional<avl::Line2D>& outLine
)

Parameters

Name Type Range Default Description
inPoints const Array<Point2D>&
inRange Optional<const Range&> NIL Determines which array points take part in fitting process
inMaxOutlierCount Optional<int> 0 - 0 Determines how many outlier points can be present to end the search
inMaxInlierDistance float 0.0 - 3.0f Distance from the output line for a point to be considered an inlier
inIterationCount Optional<int> 1 - 42 Number of iterations; Auto means that all point pairs will be used
outLine Conditional<Line2D>&

Errors

List of possible exceptions:

Error type Description
DomainError Empty point array on input in FitLineToPoints_RANSAC.