I am after a simple, yet effective, Image Edge Preserving Filter.
I need something which is faster than the Bilateral Filter with similar quality (The Guided Filter isn't good enough).
Are there such algorithms?
I am after a simple, yet effective, Image Edge Preserving Filter.
I need something which is faster than the Bilateral Filter with similar quality (The Guided Filter isn't good enough).
Are there such algorithms?
Recently I have seen the paper Hui Yin, Yuanhao Gong, Guoping Qiu - Side Window Filtering.
They suggest a really simple filtering framework for Edge Preserving Filter:
Basically, what they suggest is filtering the image with a set of filter based on the Box Filter.
This filter set is basically composed of 8 filters with different orientations and sub sets of the Box Filter (As seen in the figure above).
Once you apply all filters (Which each of them can be implemented very efficiently by all the efficient implementations available for Box Filtering) you chose, on a per pixel basis, the one most similar to the original pixel.
Applying it by iterations, yields very efficient and very good filter.
I took the Lena Image:
I applied 40 iterations of the filter (Link to 75 Iterations):
The full code is available on my StackExchange Signal Processing Q74674 GitHub Repository (Look at the SignalProcessing\Q74674
folder).
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.