The C++ interface for bilateral filtering. More...

array bilateral (const array &image, const float space, const float color)
 Bilateral filtering. More...
 

Detailed Description

The C++ interface for bilateral filtering.

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. One and three channel images are supported.

Function Documentation

array af::bilateral ( const array &  image,
const float  space,
const float  color 
)

Bilateral filtering.

// bilateral filter an image with color values [0-1]
float sigma_space = 2.f;
float sigma_color = 0.1f;
array img_out = bilateral(img_in, sigma_space, sigma_color);
// bilateral filter an image with color values [0-255]
float sigma_space = 2.f;
float sigma_color = 0.1f * 255.f;
array img_out = bilateral(img_in, sigma_space, sigma_color);
Parameters
[in]imageinput image
[in]spaceradius in pixels, area for filtering. note: internally space *= 1.5
[in]colordifference in color allowed, range depends on values in image
Note
color range depends on values in the image if image is [0-1], scale color from [0-1]; if image is [0-255], scale color from [0-255];