Start » Filter Reference » OpenCV » Structural Analysis and Shape Descriptors » cvFitLine

cvFitLine


Module: OpenCV

Fits a line to a 2D or 3D point set.

Name Type Description
Input value
inPoints Point2DArray Input Point2D array.
Input value
inDistType CvDistanceType Distance used by the M-estimator.
Input value
inParam Real Numerical parameter for some types of distances. If it is 0, an optimal value is chosen.
Input value
inReps Real Sufficient accuracy for the radius [distance between the coordinate origin and the line].
Input value
inAeps Real Sufficient accuracy for the angle. 0.01 would be a good default value for reps and aeps.
Output value
outLine Line2D

Errors

This filter can throw an exception to report error. Read how to deal with errors in Error Handling.

List of possible exceptions:

Error type Description
DomainError Distance type can be DIST_* except DIST_C and DIST_USER in cvFitLine.
DomainError Input array must not be empty in cvFitLine.

Complexity Level

This filter is available on Basic Complexity Level.