Skip to content

Canny1

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

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

ARGUMENTSdx, dy, edges, threshold1
FUNCTIONCanny1
RETURN TYPEvoid
Call structure. A void return can still write to destination arguments. The parameter descriptions define inputs, outputs and ownership.

Finds edges in an image using the Canny algorithm with custom image gradient.

Canny1(dx: Mat, dy: Mat, edges: Mat, threshold1: number, threshold2: number, L2gradient: boolean): void;
2 available overloads
Canny1(dx: Mat, dy: Mat, edges: Mat, threshold1: number, threshold2: number): void;
Canny1(dx: Mat, dy: Mat, edges: Mat, threshold1: number, threshold2: number, L2gradient: boolean): void;
dx

16-bit x derivative of input image (CV_16SC1 or CV_16SC3).

dy

16-bit y derivative of input image (same type as dx).

edges

Output destination, filled by the native operation. output edge map; single channels 8-bit image, which has the same size as image .

threshold1

first threshold for the hysteresis procedure.

threshold2

second threshold for the hysteresis procedure.

L2gradient

a flag, indicating whether a more accurate L_2 norm =\sqrt{(dI/dx)^2 + (dI/dy)^2} should be used to calculate the image gradient magnitude ( L2gradient=true ), or whether the default L_1 norm =|dI/dx|+|dI/dy| is enough ( L2gradient=false ).

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.