Back to FabImage Library website

You are here: Start » Function Reference » Geometry 3D » Geometry 3D Fitting » FitLineToPoints3D_M

FitLineToPoints3D_M


Header: FIL.h
Namespace: fil
Module: Vision3DStandard

Approximates points in 3D with a line using selected M-estimator for outlier suppression.

Applications: Finding a locally optimal line in 3D. Good enough when the number of outliers is small.

Syntax

C++
C#
 
void fil::FitLineToPoints3D_M
(
	const ftl::Array<fil::Point3D>& inPoints,
	fil::MEstimator::Type inOutlierSuppression,
	float inClippingFactor,
	int inIterationCount,
	ftl::Optional<const fil::Line3D&> inInitialLine,
	fil::Line3D& outLine,
	ftl::Optional<ftl::Array<fil::Point3D>&> outInliers = ftl::NIL
)

Parameters

Name Type Range Default Description
Input value inPoints const Array<Point3D>&
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 Line3D&> NIL Initial approximation (if available)
Output value outLine Line3D&
Output value outInliers Optional<Array<Point3D>&> NIL Points matching the computed line

Optional Outputs

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

Read more about Optional Outputs.

Errors

List of possible exceptions:

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