The bilateral filter is a slow filter as it has to dynamically adapt its kernel based on local image statistics. To overcome this limitation, researchers came up Bilateral Grids. It performs the same edge-preserving smoothening an order of magnitude faster.
Details about bilateral grids:
The bilateral grid is a data structure used for efficient edge-aware image processing. It has the following steps:
Quantization: The image is quantized into a lower-resolution grid in both spatial and intensity (range) dimensions. This means that each pixel in the original image is assigned to a cell in the grid based on its spatial position and intensity value. The grid is typically three-dimensional, with two spatial dimensions (x, y) and one intensity (range) dimension.
Splatting: The values of the original image pixels are "splatted" into the grid cells they belong to. This involves distributing the pixel values to the corresponding grid cells based on their quantized spatial and intensity positions.
Blurring: The grid is then blurred along each of its three dimensions. This blurring operation is equivalent to applying the bilateral filter to the image. Importantly, blurring the lower-resolution grid is much faster than applying the bilateral filter directly to the original image.
Slicing: Finally, the filtered image is reconstructed from the blurred grid by "slicing" the grid to obtain the output pixel values. This involves interpolating the values of the grid cells to produce the final filtered image.