[][src]Function opencv::imgproc::get_gaussian_kernel

pub fn get_gaussian_kernel(ksize: i32, sigma: f64, ktype: i32) -> Result<Mat>

Returns Gaussian filter coefficients.

The function computes and returns the inline formula matrix of Gaussian filter coefficients:

block formula

where inline formula and inline formula is the scale factor chosen so that inline formula.

Two of such generated kernels can be passed to sepFilter2D. Those functions automatically recognize smoothing kernels (a symmetrical kernel with sum of weights equal to 1) and handle them accordingly. You may also use the higher-level GaussianBlur.

Parameters

  • ksize: Aperture size. It should be odd ( inline formula ) and positive.
  • sigma: Gaussian standard deviation. If it is non-positive, it is computed from ksize as sigma = 0.3*((ksize-1)*0.5 - 1) + 0.8.
  • ktype: Type of filter coefficients. It can be CV_32F or CV_64F .

See also

sepFilter2D, getDerivKernels, getStructuringElement, GaussianBlur

C++ default parameters

  • ktype: CV_64F