Table of Contents

Class Line2D

Namespace
OpenCvSharp
Assembly
OpenCvSharp.dll

2-dimentional line vector

public class Line2D
Inheritance
Line2D
Inherited Members

Constructors

Line2D(double, double, double, double)

Initializes this object

public Line2D(double vx, double vy, double x1, double y1)

Parameters

vx double

The X component of the normalized vector collinear to the line

vy double

The Y component of the normalized vector collinear to the line

x1 double

Z-coordinate of some point on the line

y1 double

Z-coordinate of some point on the line

Line2D(float[])

Initializes by cvFitLine output

public Line2D(float[] line)

Parameters

line float[]

The returned value from cvFitLine

Properties

Vx

The X component of the normalized vector collinear to the line

public double Vx { get; }

Property Value

double

Vy

The Y component of the normalized vector collinear to the line

public double Vy { get; }

Property Value

double

X1

X-coordinate of some point on the line

public double X1 { get; }

Property Value

double

Y1

Y-coordinate of some point on the line

public double Y1 { get; }

Property Value

double

Methods

Distance(Point)

Returns the distance between this line and the specified point

public double Distance(Point point)

Parameters

point Point

Returns

double

Distance(Point2d)

Returns the distance between this line and the specified point

public double Distance(Point2d point)

Parameters

point Point2d

Returns

double

Distance(Point2f)

Returns the distance between this line and the specified point

public double Distance(Point2f point)

Parameters

point Point2f

Returns

double

Distance(double, double)

Returns the distance between this line and the specified point

public double Distance(double x, double y)

Parameters

x double
y double

Returns

double

FitSize(int, int, out Point, out Point)

Fits this line to the specified size (for drawing)

public void FitSize(int width, int height, out Point pt1, out Point pt2)

Parameters

width int

Width of fit size

height int

Height of fit size

pt1 Point

1st edge point of fitted line

pt2 Point

2nd edge point of fitted line

GetVectorAngle()

public double GetVectorAngle()

Returns

double

GetVectorRadian()

public double GetVectorRadian()

Returns

double