Class FastLineDetector
Class implementing the FLD (Fast Line Detector) algorithm described in @cite Lee14.
Implements
Inherited Members
Namespace: OpenCvSharp.XImgProc
Assembly: OpenCvSharp.dll
Syntax
public class FastLineDetector : Algorithm, ICvPtrHolder
Constructors
| Improve this Doc View SourceFastLineDetector(IntPtr)
Creates instance by raw pointer
Declaration
protected FastLineDetector(IntPtr p)
Parameters
Type | Name | Description |
---|---|---|
IntPtr | p |
Methods
| Improve this Doc View SourceCreate(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 |
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: |
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. |
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: |
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. |
DisposeManaged()
Releases managed resources
Declaration
protected override void DisposeManaged()
Overrides
| Improve this Doc View SourceDrawSegments(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. |
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. |