Table of Contents

Method GetDerivKernels

Namespace
OpenCvSharp
Assembly
OpenCvSharp.dll

GetDerivKernels(OutputArray, OutputArray, int, int, int, bool, MatType?)

Returns filter coefficients for computing spatial image derivatives.

public static void GetDerivKernels(OutputArray kx, OutputArray ky, int dx, int dy, int ksize, bool normalize = false, MatType? ktype = null)

Parameters

kx OutputArray

Output matrix of row filter coefficients. It has the type ktype.

ky OutputArray

Output matrix of column filter coefficients. It has the type ktype.

dx int

Derivative order in respect of x.

dy int

Derivative order in respect of y.

ksize int

Aperture size. It can be CV_SCHARR, 1, 3, 5, or 7.

normalize bool

Flag indicating whether to normalize (scale down) the filter coefficients or not. Theoretically, the coefficients should have the denominator \f$=2^{ksize*2-dx-dy-2}\f$. 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.

ktype MatType?

Type of filter coefficients. It can be CV_32f or CV_64F.