- Main Page
- Tutorials
- Functions
- Release Notes
- Examples

Functions
gaussiankernel
Complete List of ArrayFire Functions ArrayFire Functions by Category » Image Processing » | Utility Functions

Creates a Gaussian Kernel. More...

## Functions
AFAPI array | gaussiankernel (const int rows, const int cols, const double sig_r=0, const double sig_c=0)
| Creates a Gaussian Kernel. More...
AFAPI array | gaussianKernel (const int rows, const int cols, const double sig_r=0, const double sig_c=0)
| C++ Interface for generating gausian kernels. More...
AFAPI af_err | af_gaussian_kernel (af_array *out, const int rows, const int cols, const double sigma_r, const double sigma_c)
| C Interface generating gaussian kernels. More...

## Detailed Description

Creates a Gaussian Kernel.

This function creates a kernel of a specified size that contains a Gaussian distribution. This distribution is normalized to one. This is most commonly used when performing a Gaussian blur on an image. The function takes two sets of arguments, the size of the kernel (width and height in pixels) and the sigma parameters (for row and column) which effect the distribution of the weights in the y and x directions, respectively.

Changing sigma causes the weights in each direction to vary. Sigma is calculated internally as (0.25 * rows + 0.75) for rows and similarly for columns.

## Function Documentation

AFAPI af_err af_gaussian_kernel | ( | af_array * | out,
|  | const int | rows,
|  | const int | cols,
|  | const double | sigma_r,
|  | const double | sigma_c
| ) |  |

C Interface generating gaussian kernels.

Parameters

  [out] | out | is an array with values generated using gaussian function
  [in] | rows | number of rows of the gaussian kernel
  [in] | cols | number of columns of the gaussian kernel
  [in] | sigma_r | (default 0) (calculated internally as 0.25 * rows + 0.75)
  [in] | sigma_c | (default 0) (calculated internally as 0.25 * cols + 0.75)

Returns
  AF_SUCCESS if gaussian distribution values are generated successfully, otherwise an appropriate error code is returned.

AFAPI array af::gaussiankernel | ( | const int | rows,
|  | const int | cols,
|  | const double | sig_r = `0`,
|  | const double | sig_c = `0`
| ) |  |

Creates a Gaussian Kernel.

This function creates a kernel of a specified size that contains a Gaussian distribution. This distribution is normalized to one. This is most commonly used when performing a Gaussian blur on an image. The function takes two sets of arguments, the size of the kernel (width and height in pixels) and the sigma parameters (for row and column) which effect the distribution of the weights in the y and x directions, respectively.

Changing sigma causes the weights in each direction to vary. Sigma is calculated internally as (0.25 * rows + 0.75) for rows and similarly for columns.

Deprecated:
  Use gaussianKernel instead

AFAPI array af::gaussianKernel | ( | const int | rows,
|  | const int | cols,
|  | const double | sig_r = `0`,
|  | const double | sig_c = `0`
| ) |  |

C++ Interface for generating gausian kernels.

Parameters

  [in] | rows | number of rows of the kernel
  [in] | cols | number of columns of the kernel
  [in] | sig_r | (default 0) (calculated internally as 0.25 * rows + 0.75)
  [in] | sig_c | (default 0) (calculated internally as 0.25 * cols + 0.75)

Returns
  an array with values generated using gaussian function

Examples:
  binary_thresholding.cpp, edge.cpp, filters.cpp, image_editing.cpp, and morphing.cpp.