Table of Contents

Struct KeyLine

Namespace
OpenCvSharp.LineDescriptor
Assembly
OpenCvSharp.dll

A class to represent a line

As aformentioned, it is been necessary to design a class that fully stores the information needed to characterize completely a line and plot it on image it was extracted from, when required.

KeyLine class has been created for such goal; it is mainly inspired to Feature2d's KeyPoint class, since KeyLine shares some of* KeyPoint*'s fields, even if a part of them assumes a different meaning, when speaking about lines.In particular:

  • the* class_id* field is used to gather lines extracted from different octaves which refer to same line inside original image (such lines and the one they represent in original image share the same* class_id* value)
  • the* angle* field represents line's slope with respect to (positive) X axis
  • the* pt* field represents line's midpoint
  • the* response* field is computed as the ratio between the line's length and maximum between image's width and height
  • the* size* field is the area of the smallest rectangle containing line

Apart from fields inspired to KeyPoint class, KeyLines stores information about extremes of line in original image and in octave it was extracted from, about line's length and number of pixels it covers.

[SuppressMessage("Microsoft.Design", "CA1815: Override equals and operator equals on value types")]
public readonly struct KeyLine
Inherited Members

Constructors

KeyLine(float, int, int, Point2f, float, float, float, float, float, float, float, float, float, float, float, int)

Constructor

public KeyLine(float angle = 0, int classId = 0, int octave = 0, Point2f pt = default, float response = 0, float size = 0, float startPointX = 0, float startPointY = 0, float endPointX = 0, float endPointY = 0, float sPointInOctaveX = 0, float sPointInOctaveY = 0, float ePointInOctaveX = 0, float ePointInOctaveY = 0, float lineLength = 0, int numOfPixels = 0)

Parameters

angle float
classId int
octave int
pt Point2f
response float
size float
startPointX float
startPointY float
endPointX float
endPointY float
sPointInOctaveX float
sPointInOctaveY float
ePointInOctaveX float
ePointInOctaveY float
lineLength float
numOfPixels int

Fields

Angle

orientation of the line

public readonly float Angle

Field Value

float

ClassId

object ID, that can be used to cluster keylines by the line they represent

public readonly int ClassId

Field Value

int

EPointInOctaveX

line's extremes in image it was extracted from

public readonly float EPointInOctaveX

Field Value

float

EPointInOctaveY

line's extremes in image it was extracted from

public readonly float EPointInOctaveY

Field Value

float

EndPointX

lines' extremes in original image

public readonly float EndPointX

Field Value

float

EndPointY

lines' extremes in original image

public readonly float EndPointY

Field Value

float

LineLength

the length of line

public readonly float LineLength

Field Value

float

NumOfPixels

number of pixels covered by the line

public readonly int NumOfPixels

Field Value

int

Octave

octave (pyramid layer), from which the keyline has been extracted

public readonly int Octave

Field Value

int

Pt

coordinates of the middlepoint

public readonly Point2f Pt

Field Value

Point2f

Response

the response, by which the strongest keylines have been selected. It's represented by the ratio between line's length and maximum between image's width and height

public readonly float Response

Field Value

float

SPointInOctaveX

line's extremes in image it was extracted from

public readonly float SPointInOctaveX

Field Value

float

SPointInOctaveY

line's extremes in image it was extracted from

public readonly float SPointInOctaveY

Field Value

float

Size

minimum area containing line

public readonly float Size

Field Value

float

StartPointX

lines' extremes in original image

public readonly float StartPointX

Field Value

float

StartPointY

lines' extremes in original image

public readonly float StartPointY

Field Value

float

Properties

EndPoint

Returns the end point of the line in the original image

public Point2f EndPoint { get; }

Property Value

Point2f

EndPointInOctave

Returns the end point of the line in the octave it was extracted from

public Point2f EndPointInOctave { get; }

Property Value

Point2f

StartPoint

Returns the start point of the line in the original image

public Point2f StartPoint { get; }

Property Value

Point2f

StartPointInOctave

Returns the start point of the line in the octave it was extracted from

public Point2f StartPointInOctave { get; }

Property Value

Point2f