A high-performance general-purpose compute library

- Main Page
- Tutorials
- Release Notes
- Examples

Functions
bilateral
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.
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.

## 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.

The return type of the array is f64 for f64 input, f32 for all other input types.

## Function Documentation

## ◆ af_bilateral()

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.

## ◆ bilateral()

AFAPI array 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