Table of Contents

Class LSDDetector

Namespace
OpenCvSharp.LineDescriptor
Assembly
OpenCvSharp.dll

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.

public class LSDDetector : CvObject, IDisposable
Inheritance
LSDDetector
Implements
Inherited Members

Constructors

LSDDetector()

Default constructor.

public LSDDetector()

LSDDetector(in LSDParam)

Constructor

public LSDDetector(in LSDParam lsdParam)

Parameters

lsdParam LSDParam

Methods

Detect(Mat, int, int, Mat?)

Detect lines inside an image.

public KeyLine[] Detect(Mat image, int scale, int numOctaves, Mat? mask = null)

Parameters

image Mat

input image

scale int

scale factor used in pyramids generation

numOctaves int

number of octaves inside pyramid

mask Mat

mask matrix to detect only KeyLines of interest

Returns

KeyLine[]

vector that will store extracted lines for one or more images

Detect(IEnumerable<Mat>, int, int, IEnumerable<Mat>?)

Detect lines inside an image.

public KeyLine[][] Detect(IEnumerable<Mat> images, int scale, int numOctaves, IEnumerable<Mat>? masks = null)

Parameters

images IEnumerable<Mat>

input images

scale int

scale factor used in pyramids generation

numOctaves int

number of octaves inside pyramid

masks IEnumerable<Mat>

vector of mask matrices to detect only KeyLines of interest from each input image

Returns

KeyLine[][]

set of vectors that will store extracted lines for one or more images