Show / Hide Table of Contents

Class FastLineDetector

Class implementing the FLD (Fast Line Detector) algorithm described in @cite Lee14.

Inheritance
System.Object
DisposableObject
DisposableCvObject
Algorithm
FastLineDetector
Implements
ICvPtrHolder
Inherited Members
Algorithm.Write(FileStorage)
Algorithm.Read(FileNode)
Algorithm.Empty
Algorithm.Save(String)
Algorithm.GetDefaultName()
DisposableCvObject.ptr
DisposableCvObject.CvPtr
DisposableObject.DataHandle
DisposableObject.IsDisposed
DisposableObject.IsEnabledDispose
DisposableObject.AllocatedMemory
DisposableObject.AllocatedMemorySize
DisposableObject.Dispose()
DisposableObject.Dispose(Boolean)
DisposableObject.AllocGCHandle(Object)
DisposableObject.AllocMemory(Int32)
DisposableObject.NotifyMemoryPressure(Int64)
DisposableObject.ThrowIfDisposed()
Namespace: OpenCvSharp.XImgProc
Assembly: OpenCvSharp.dll
Syntax
public class FastLineDetector : Algorithm, ICvPtrHolder

Constructors

| Improve this Doc View Source

FastLineDetector(IntPtr)

Creates instance by raw pointer

Declaration
protected FastLineDetector(IntPtr p)
Parameters
Type Name Description
IntPtr p

Methods

| Improve this Doc View Source

Create(Int32, Single, Double, Double, Int32, Boolean)

Creates a smart pointer to a FastLineDetector object and initializes it

Declaration
public static FastLineDetector Create(int lengthThreshold = 10, float distanceThreshold = 1.41421354F, double cannyTh1 = 50, double cannyTh2 = 50, int cannyApertureSize = 3, bool doMerge = false)
Parameters
Type Name Description
System.Int32 lengthThreshold

Segment shorter than this will be discarded

System.Single distanceThreshold

A point placed from a hypothesis line segment farther than this will be regarded as an outlier

System.Double cannyTh1

First threshold for hysteresis procedure in Canny()

System.Double cannyTh2

Second threshold for hysteresis procedure in Canny()

System.Int32 cannyApertureSize

Aperturesize for the sobel operator in Canny()

System.Boolean doMerge

If true, incremental merging of segments will be perfomred

Returns
Type Description
FastLineDetector
| Improve this Doc View Source

Detect(InputArray)

Finds lines in the input image. This is the output of the default parameters of the algorithm on the above shown image.

Declaration
public virtual Vec4f[] Detect(InputArray image)
Parameters
Type Name Description
InputArray image

A grayscale (CV_8UC1) input image. If only a roi needs to be selected, use: fld_ptr-\>detect(image(roi), lines, ...); lines += Scalar(roi.x, roi.y, roi.x, roi.y);

Returns
Type Description
Vec4f[]

A vector of Vec4f elements specifying the beginning and ending point of a line. Where Vec4f is (x1, y1, x2, y2), point 1 is the start, point 2 - end.Returned lines are directed so that the brighter side is on their left.

| Improve this Doc View Source

Detect(InputArray, OutputArray)

Finds lines in the input image. This is the output of the default parameters of the algorithm on the above shown image.

Declaration
public virtual void Detect(InputArray image, OutputArray lines)
Parameters
Type Name Description
InputArray image

A grayscale (CV_8UC1) input image. If only a roi needs to be selected, use: fld_ptr-\>detect(image(roi), lines, ...); lines += Scalar(roi.x, roi.y, roi.x, roi.y);

OutputArray lines

A vector of Vec4f elements specifying the beginning and ending point of a line. Where Vec4f is (x1, y1, x2, y2), point 1 is the start, point 2 - end.Returned lines are directed so that the brighter side is on their left.

| Improve this Doc View Source

DisposeManaged()

Releases managed resources

Declaration
protected override void DisposeManaged()
Overrides
DisposableObject.DisposeManaged()
| Improve this Doc View Source

DisposeUnmanaged()

Declaration
protected override void DisposeUnmanaged()
Overrides
DisposableCvObject.DisposeUnmanaged()
| Improve this Doc View Source

DrawSegments(InputOutputArray, IEnumerable<Vec4f>, Boolean)

Draws the line segments on a given image.

Declaration
public virtual void DrawSegments(InputOutputArray image, IEnumerable<Vec4f> lines, bool drawArrow = false)
Parameters
Type Name Description
InputOutputArray image

The image, where the lines will be drawn. Should be bigger or equal to the image, where the lines were found.

IEnumerable<Vec4f> lines

A vector of the lines that needed to be drawn.

System.Boolean drawArrow

If true, arrow heads will be drawn.

| Improve this Doc View Source

DrawSegments(InputOutputArray, InputArray, Boolean)

Draws the line segments on a given image.

Declaration
public virtual void DrawSegments(InputOutputArray image, InputArray lines, bool drawArrow = false)
Parameters
Type Name Description
InputOutputArray image

The image, where the lines will be drawn. Should be bigger or equal to the image, where the lines were found.

InputArray lines

A vector of the lines that needed to be drawn.

System.Boolean drawArrow

If true, arrow heads will be drawn.

| Improve this Doc View Source

Get()

Declaration
public override IntPtr Get()
Returns
Type Description
IntPtr

Implements

ICvPtrHolder
  • Improve this Doc
  • View Source
In This Article
Back to top Generated by DocFX