Bilateral filter

A bilateral filter is non-linear, edge-preserving and noise-reducing smoothing filter. The intensity value at each pixel in an image is replaced by a weighted average of intensity values from nearby pixels. This weight can be based on a Gaussian distribution. Crucially, the weights depend not only on Euclidean distance of pixels, but also on the radiometric differences. For example, the range difference such as color intensity, depth distance, etc. This preserves sharp edges by systematically looping through each pixel and adjusting weights to the adjacent pixels accordingly.

The bilateral filter is defined as:

$I^\text{filtered}(x) = \sum_{x_i \in \Omega} I(x_i)f_r(\|I(x_i)-I(x)\|)g_s(\|x_i-x\|)$

where:

• $I^\text{filtered}$ is the filtered image;
• $I$ is the original input image to be filtered;
• $x$ are the coordinates of the current pixel to be filtered;
• $\Omega$ is the window centered in $x$;
• $f_r$ is the range kernel for smoothing differences in intensities. This function can be a Gaussian function;
• $g_s$ is the spatial kernel for smoothing differences in coordinates. This function can be a Gaussian function;

Adobe Photoshop implements a bilateral filter in its surface blur tool.

GIMP implements a bilateral filter in its Filters-->Blur tools; and it is called Selective Gaussian Blur'.