Skip to content

createLineSegmentDetector

Image processingfunctionOpenCV 5.0.0
import { createLineSegmentDetector } from '@banou/opencv-wasm'

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

ARGUMENTSrefine, scale, sigma_scale, quant
FUNCTIONcreateLineSegmentDetector
RETURN TYPELineSegmentDetector | null
Call structure. A void return can still write to destination arguments. The parameter descriptions define inputs, outputs and ownership.

Creates a smart pointer to a LineSegmentDetector object and initializes it.

The LineSegmentDetector algorithm is defined using the standard values. Only advanced users may want to edit those, as to tailor it for their own application.

createLineSegmentDetector(refine: number, scale: number, sigma_scale: number, quant: number, ang_th: number, log_eps: number, density_th: number, n_bins: number): LineSegmentDetector | null;
9 available overloads
createLineSegmentDetector(): LineSegmentDetector | null;
createLineSegmentDetector(refine: number): LineSegmentDetector | null;
createLineSegmentDetector(refine: number, scale: number): LineSegmentDetector | null;
createLineSegmentDetector(refine: number, scale: number, sigma_scale: number): LineSegmentDetector | null;
createLineSegmentDetector(refine: number, scale: number, sigma_scale: number, quant: number): LineSegmentDetector | null;
createLineSegmentDetector(refine: number, scale: number, sigma_scale: number, quant: number, ang_th: number): LineSegmentDetector | null;
createLineSegmentDetector(refine: number, scale: number, sigma_scale: number, quant: number, ang_th: number, log_eps: number): LineSegmentDetector | null;
createLineSegmentDetector(refine: number, scale: number, sigma_scale: number, quant: number, ang_th: number, log_eps: number, density_th: number): LineSegmentDetector | null;
createLineSegmentDetector(refine: number, scale: number, sigma_scale: number, quant: number, ang_th: number, log_eps: number, density_th: number, n_bins: number): LineSegmentDetector | null;
refine

The way found lines will be refined, see #LineSegmentDetectorModes

scale

The scale of the image that will be used to find the lines. Range (0..1].

sigma_scale

Sigma for Gaussian filter. It is computed as sigma = sigma_scale/scale.

quant

Bound to the quantization error on the gradient norm.

ang_th

Gradient angle tolerance in degrees.

log_eps

Detection threshold: -log10(NFA) > log_eps. Used only when advance refinement is chosen.

density_th

Minimal density of aligned region points in the enclosing rectangle.

n_bins

Number of bins in pseudo-ordering of gradient modulus.

Returns

The LineSegmentDetector | null result.

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.