getGaussianKernel

Description

Computes and returns the ksize x 1 matrix of Gaussian filter coefficients.

Signature

cv2.getGaussianKernel(ksize, sigma[, ktype]) → retval

Parameters

Explanation

This function computes and returns the ksize x 1 matrix of Gaussian filter coefficients:

\[G_i\ =\ \alpha\ *\ e^\frac{-\left(i-(ksize-1))/2\right)^2}{2*{\rm sigma}^2}\]

Where \(i= 0…ksize-1\) and \(\alpha\) is the scaling factor so that \(\sum_{i} G_i=1 \).

Notes


References

Created with OpenCV 4.4.0