Back to Aurora Vision Library website

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

FitCircleToPoints


Header: AVL.h
Namespace: avl
Module: FoundationBasic

Approximates points with a circle using selected outliers suppression method.

Syntax

C++
C#
 
void avl::FitCircleToPoints
(
	const atl::Array<avl::Point2D>& inPoints,
	atl::Optional<const avl::Range&> inRange,
	avl::CircleFittingMethod::Type inFittingMethod,
	atl::Optional<avl::MEstimator::Type> inOutlierSuppression,
	atl::Conditional<avl::Circle2D>& outCircle,
	atl::Optional<atl::Array<avl::Point2D>&> outInliers = atl::NIL
)

Parameters

Name Type 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 inFittingMethod CircleFittingMethod::Type
Input value inOutlierSuppression Optional<MEstimator::Type> NIL
Output value outCircle Conditional<Circle2D>& Fitted circle or nothing if method failed to converge
Output value outInliers Optional<Array<Point2D>&> NIL Points matching the computed circle

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.

Description

The operation computes a circle which approximates the input points best. Several methods are available, AlgebraicKasa being the fastest one. It is also the most inaccurate when the input points are sampled along small arc only.

Examples

The resulting outCircle drawn with the input points, inFittingMethod = AlgebraicKasa and inOutlierSuppression = Auto.

Errors

List of possible exceptions:

Error type Description
DomainError Outlier suppression is supported only in algebraic fitting methods.
DomainError Range exceeds the input point array in FitCircleToPoints.

See Also

  • FitArcToPoints – Approximates points with an arc using the selected outliers suppression method.
  • FitLineToPoints – Approximates points with a line using the Least Squares method.