opencv::imgproc

Function gaussian_blur

Source
pub fn gaussian_blur(
    src: &impl ToInputArray,
    dst: &mut impl ToOutputArray,
    ksize: Size,
    sigma_x: f64,
    sigma_y: f64,
    border_type: i32,
    hint: AlgorithmHint,
) -> Result<()>
Expand description

Blurs an image using a Gaussian filter.

The function convolves the source image with the specified Gaussian kernel. In-place filtering is supported.

§Parameters

  • src: input image; the image can have any number of channels, which are processed independently, but the depth should be CV_8U, CV_16U, CV_16S, CV_32F or CV_64F.
  • dst: output image of the same size and type as src.
  • ksize: Gaussian kernel size. ksize.width and ksize.height can differ but they both must be positive and odd. Or, they can be zero’s and then they are computed from sigma.
  • sigmaX: Gaussian kernel standard deviation in X direction.
  • sigmaY: Gaussian kernel standard deviation in Y direction; if sigmaY is zero, it is set to be equal to sigmaX, if both sigmas are zeros, they are computed from ksize.width and ksize.height, respectively (see get_gaussian_kernel for details); to fully control the result regardless of possible future modifications of all this semantics, it is recommended to specify all of ksize, sigmaX, and sigmaY.
  • borderType: pixel extrapolation method, see #BorderTypes. [BORDER_WRAP] is not supported.
  • hint: Implementation modfication flags. See [algorithm_hint]

§See also

sepFilter2D, filter2D, blur, boxFilter, bilateralFilter, medianBlur

§C++ default parameters

  • sigma_y: 0
  • border_type: BORDER_DEFAULT
  • hint: cv::ALGO_HINT_DEFAULT