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

Fields

Angle

orientation of the line

ClassId

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

EPointInOctaveX

line's extremes in image it was extracted from

EPointInOctaveY

line's extremes in image it was extracted from

EndPointX

lines' extremes in original image

EndPointY

lines' extremes in original image

LineLength

the length of line

NumOfPixels

number of pixels covered by the line

Octave

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

Pt

coordinates of the middlepoint

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

SPointInOctaveX

line's extremes in image it was extracted from

SPointInOctaveY

line's extremes in image it was extracted from

Size

minimum area containing line

StartPointX

lines' extremes in original image

StartPointY

lines' extremes in original image

Properties

EndPoint

Returns the end point of the line in the original image

EndPointInOctave

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

StartPoint

Returns the start point of the line in the original image

StartPointInOctave

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