Namespace OpenCvSharp.LineDescriptor
Classes
- LSDDetector
Lines extraction methodology
The lines extraction methodology described in the following is mainly based on @cite EDL.The extraction starts with a Gaussian pyramid generated from an original image, downsampled N-1 times, blurred N times, to obtain N layers(one for each octave), with layer 0 corresponding to input image.Then, from each layer (octave) in the pyramid, lines are extracted using LSD algorithm.
Differently from EDLine lines extractor used in original article, LSD furnishes information only about lines extremes; thus, additional information regarding slope and equation of line are computed via analytic methods.The number of pixels is obtained using * LineIterator*. Extracted lines are returned in the form of KeyLine objects, but since extraction is based on a method different from the one used in * BinaryDescriptor* class, data associated to a line's extremes in original image and in octave it was extracted from, coincide.KeyLine's field class_id is used as an index to indicate the order of extraction of a line inside a single octave.
Structs
- KeyLine
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.