getDerivKernels
import { getDerivKernels } from '@banou/opencv-wasm'Use after await initOpenCV(). See the initialization and named imports guide.
Returns filter coefficients for computing spatial image derivatives.
The function computes and returns the filter coefficients for spatial image derivatives. When
ksize=FILTER_SCHARR, the Scharr 3 \times 3 kernels are generated (see #Scharr). Otherwise, Sobel
kernels are generated (see #Sobel). The filters are normally passed to #sepFilter2D or to
getDerivKernels(kx: Mat, ky: Mat, dx: number, dy: number, ksize: number, normalize: boolean, ktype: number): void;3 available overloads
getDerivKernels(kx: Mat, ky: Mat, dx: number, dy: number, ksize: number): void;getDerivKernels(kx: Mat, ky: Mat, dx: number, dy: number, ksize: number, normalize: boolean): void;getDerivKernels(kx: Mat, ky: Mat, dx: number, dy: number, ksize: number, normalize: boolean, ktype: number): void;kxOutput destination, filled by the native operation. Output matrix of row filter coefficients. It has the type ktype .
kyOutput destination, filled by the native operation. Output matrix of column filter coefficients. It has the type ktype .
dxDerivative order in respect of x.
dyDerivative order in respect of y.
ksizeAperture size. It can be FILTER_SCHARR, 1, 3, 5, or 7.
normalizeFlag indicating whether to normalize (scale down) the filter coefficients or not. Theoretically, the coefficients should have the denominator
=2^{ksize*2-dx-dy-2}. If you are going to filter floating-point images, you are likely to use the normalized kernels. But if you compute derivatives of an 8-bit image, store the results in a 16-bit image, and wish to preserve all the fractional bits, you may want to set normalize=false .ktypeType of filter coefficients. It can be CV_32f or CV_64F .
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.