﻿cvFitLine Method
http://www.emgu.com
Fits line to 2D or 3D point set

Namespace: Emgu.CV
Assembly: Emgu.CV (in Emgu.CV.dll) Version: 2.4.0.1717 (2.4.0.1717)

# Syntax

C#
```public static void cvFitLine(
IntPtr points,
DIST_TYPE distType,
double param,
double reps,
double aeps,
float[] line
)```
Visual Basic
```Public Shared Sub cvFitLine ( _
points As IntPtr, _
distType As DIST_TYPE, _
param As Double, _
reps As Double, _
aeps As Double, _
<OutAttribute> line As Single() _
)```
Visual C++
```public:
static void cvFitLine(
IntPtr points,
DIST_TYPE distType,
double param,
double reps,
double aeps,
[OutAttribute] array<float>^ line
)```

#### Parameters

points
Type: System..::..IntPtr
Sequence or array of 2D or 3D points with 32-bit integer or floating-point coordinates
distType
Type: Emgu.CV.CvEnum..::..DIST_TYPE
The distance used for fitting
param
Type: System..::..Double
Numerical parameter (C) for some types of distances, if 0 then some optimal value is chosen
reps
Type: System..::..Double
Sufficient accuracy for radius (distance between the coordinate origin and the line), 0.01 would be a good default
aeps
Type: System..::..Double
Sufficient accuracy for angle, 0.01 would be a good default
line
Type: array<System..::..Single>[]()[][]
The output line parameters. In case of 2d fitting it is array of 4 floats (vx, vy, x0, y0) where (vx, vy) is a normalized vector collinear to the line and (x0, y0) is some point on the line. In case of 3D fitting it is array of 6 floats (vx, vy, vz, x0, y0, z0) where (vx, vy, vz) is a normalized vector collinear to the line and (x0, y0, z0) is some point on the line.