spatialGradient
import { spatialGradient } from '@banou/opencv-wasm'Use after await initOpenCV(). See the initialization and named imports guide.
Calculates the first order image derivative in both x and y using a Sobel operator
Equivalent to calling:
Sobel( src, dx, CV_16SC1, 1, 0, 3 );
Sobel( src, dy, CV_16SC1, 0, 1, 3 );
See: Sobel
spatialGradient(src: Mat, dx: Mat, dy: Mat, ksize: number, borderType: number): void;3 available overloads
spatialGradient(src: Mat, dx: Mat, dy: Mat): void;spatialGradient(src: Mat, dx: Mat, dy: Mat, ksize: number): void;spatialGradient(src: Mat, dx: Mat, dy: Mat, ksize: number, borderType: number): void;srcinput image.
dxOutput destination, filled by the native operation. output image with first-order derivative in x.
dyOutput destination, filled by the native operation. output image with first-order derivative in y.
ksizesize of Sobel kernel. It must be 3.
borderTypepixel extrapolation method, see #BorderTypes. Only #BORDER_DEFAULT=#BORDER_REFLECT_101 and #BORDER_REPLICATE are supported.
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.