[][src]Function opencv::imgproc::get_deriv_kernels

pub fn get_deriv_kernels(
    kx: &mut dyn ToOutputArray,
    ky: &mut dyn ToOutputArray,
    dx: i32,
    dy: i32,
    ksize: i32,
    normalize: bool,
    ktype: i32
) -> Result<()>

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 inline formula kernels are generated (see #Scharr). Otherwise, Sobel kernels are generated (see #Sobel). The filters are normally passed to #sepFilter2D or to

Parameters

  • kx: Output matrix of row filter coefficients. It has the type ktype .
  • ky: Output matrix of column filter coefficients. It has the type ktype .
  • dx: Derivative order in respect of x.
  • dy: Derivative order in respect of y.
  • ksize: Aperture size. It can be FILTER_SCHARR, 1, 3, 5, or 7.
  • normalize: Flag indicating whether to normalize (scale down) the filter coefficients or not. Theoretically, the coefficients should have the denominator inline formula. 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: Type of filter coefficients. It can be CV_32f or CV_64F .

C++ default parameters

  • normalize: false
  • ktype: CV_32F