CvFitLine2D Method (IEnumerableCvPoint, DistanceType, Double, Double, Double) OpenCvSharp Class Library
Fits line to 2D point set

Namespace:  OpenCvSharp
Assembly:  OpenCvSharp (in OpenCvSharp.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax

public static CvLine2D FitLine2D(
	IEnumerable<CvPoint> points,
	DistanceType distType,
	double param,
	double reps,
	double aeps
)

Parameters

points
Type: System.Collections.GenericIEnumerableCvPoint
Sequence or array of 2D points with 32-bit integer coordinates.
distType
Type: OpenCvSharpDistanceType
The distance used for fitting (see the discussion).
param
Type: SystemDouble
Numerical parameter (C) for some types of distances, if 0 then some optimal value is chosen.
reps
Type: SystemDouble
Sufficient accuracy for radius (distance between the coordinate origin and the line) and angle, respectively, 0.01 would be a good defaults for both.
aeps
Type: SystemDouble
Sufficient accuracy for radius (distance between the coordinate origin and the line) and angle, respectively, 0.01 would be a good defaults for both.

Return Value

Type: CvLine2D
The output line parameters. (vx, vy) is a normalized vector collinear to the line and (x0, y0) is some point on the line.
See Also

Reference