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
anglefloatclassIdintoctaveintptPoint2fresponsefloatsizefloatstartPointXfloatstartPointYfloatendPointXfloatendPointYfloatsPointInOctaveXfloatsPointInOctaveYfloatePointInOctaveXfloatePointInOctaveYfloatlineLengthfloatnumOfPixelsint
Fields
Angle
orientation of the line
public readonly float Angle
Field Value
ClassId
object ID, that can be used to cluster keylines by the line they represent
public readonly int ClassId
Field Value
EPointInOctaveX
line's extremes in image it was extracted from
public readonly float EPointInOctaveX
Field Value
EPointInOctaveY
line's extremes in image it was extracted from
public readonly float EPointInOctaveY
Field Value
EndPointX
lines' extremes in original image
public readonly float EndPointX
Field Value
EndPointY
lines' extremes in original image
public readonly float EndPointY
Field Value
LineLength
the length of line
public readonly float LineLength
Field Value
NumOfPixels
number of pixels covered by the line
public readonly int NumOfPixels
Field Value
Octave
octave (pyramid layer), from which the keyline has been extracted
public readonly int Octave
Field Value
Pt
coordinates of the middlepoint
public readonly Point2f Pt
Field Value
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
SPointInOctaveX
line's extremes in image it was extracted from
public readonly float SPointInOctaveX
Field Value
SPointInOctaveY
line's extremes in image it was extracted from
public readonly float SPointInOctaveY
Field Value
Size
minimum area containing line
public readonly float Size
Field Value
StartPointX
lines' extremes in original image
public readonly float StartPointX
Field Value
StartPointY
lines' extremes in original image
public readonly float StartPointY
Field Value
Properties
EndPoint
Returns the end point of the line in the original image
public Point2f EndPoint { get; }
Property Value
EndPointInOctave
Returns the end point of the line in the octave it was extracted from
public Point2f EndPointInOctave { get; }
Property Value
StartPoint
Returns the start point of the line in the original image
public Point2f StartPoint { get; }
Property Value
StartPointInOctave
Returns the start point of the line in the octave it was extracted from
public Point2f StartPointInOctave { get; }