Skip to content

ximgproc_FastLineDetector

Extended image processingclassOpenCV 5.0.0
import { ximgproc_FastLineDetector } from '@banou/opencv-wasm'

Use after await initOpenCV(). See the initialization and named imports guide.

ARGUMENTSConstructor or factory
CLASSximgproc_FastLineDetector
RETURN TYPEOwned native handle
Call structure. A void return can still write to destination arguments. The parameter descriptions define inputs, outputs and ownership.

Native object: release it with using or delete(). Factories can return null; check before calling methods. Inherits Algorithm.

Class implementing the FLD (Fast Line Detector) algorithm described in [Lee14] .

Constructors and members

clone

Create another handle to the same native object. This retains the object without copying its pixels or algorithm state; dispose both handles separately.

clone(): this;
Returns

The this result.

detect

example: fld_lines.cpp An example using the FastLineDetector Finds lines in the input image. This is the output of the default parameters of the algorithm on the above shown image.

  ![image](pics/corridor_fld.jpg)
detect(image: Mat, lines: Mat): void;
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);

lines

Output destination, filled by the native operation. 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.

drawSegments

Draws the line segments on a given image.

drawSegments(image: Mat, lines: Mat, draw_arrow: boolean, linecolor: Scalar, linethickness: number): void;
4 available overloads
drawSegments(image: Mat, lines: Mat): void;
drawSegments(image: Mat, lines: Mat, draw_arrow: boolean): void;
drawSegments(image: Mat, lines: Mat, draw_arrow: boolean, linecolor: Scalar): void;
drawSegments(image: Mat, lines: Mat, draw_arrow: boolean, linecolor: Scalar, linethickness: number): void;
image

Input/output value, modified by the native operation. The image, where the lines will be drawn. Should be bigger or equal to the image, where the lines were found.

lines

A vector of the lines that needed to be drawn.

draw_arrow

If true, arrow heads will be drawn.

linecolor

Line color.

linethickness

Line thickness.

These signatures describe this package. Upstream documentation can mention optional backends that are absent from this build. Check runtime compatibility before choosing a backend or file format.