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

Functions
bilateral
Complete List of ArrayFire Functions ArrayFire Functions by Category » Image Processing » | Filters

Bilateral Filter. More...

## Functions
AFAPI array | bilateral (const array &in, const float spatial_sigma, const float chromatic_sigma, const bool is_color=false)
| C++ Interface for bilateral filter. More...
AFAPI af_err | af_bilateral (af_array *out, const af_array in, const float spatial_sigma, const float chromatic_sigma, const bool isColor)
| C Interface for bilateral filter. More...

## Detailed Description

Bilateral Filter.

A bilateral filter is a edge-preserving filter that reduces noise in an image. The intensity of each pixel is replaced by a weighted average of the intensities of nearby pixels. The weights follow a Gaussian distribution and depend on the distance as well as the color distance.

The bilateral filter requires the size of the filter (in pixels) and the upper bound on color values, N, where pixel values range from 0–N inclusively.

## Function Documentation

AFAPI af_err af_bilateral | ( | af_array * | out,
|  | const af_array | in,
|  | const float | spatial_sigma,
|  | const float | chromatic_sigma,
|  | const bool | isColor
| ) |  |

C Interface for bilateral filter.

Parameters

  [out] | out | array is the processed image
  [in] | in | array is the input image
  [in] | spatial_sigma | is the spatial variance parameter that decides the filter window
  [in] | chromatic_sigma | is the chromatic variance parameter
  [in] | isColor | indicates if the input `in` is color image or grayscale

Returns
  AF_SUCCESS if the filter is applied successfully, otherwise an appropriate error code is returned.

AFAPI array af::bilateral | ( | const array & | in,
|  | const float | spatial_sigma,
|  | const float | chromatic_sigma,
|  | const bool | is_color = `false`
| ) |  |

C++ Interface for bilateral filter.

Parameters

  [in] | in | array is the input image
  [in] | spatial_sigma | is the spatial variance parameter that decides the filter window
  [in] | chromatic_sigma | is the chromatic variance parameter
  [in] | is_color | indicates if the input `in` is color image or grayscale

Returns
  the processed image

Examples:
  filters.cpp.