2
$\begingroup$

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?

$\endgroup$
4

2 Answers 2

5
$\begingroup$

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:

enter image description here

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:

enter image description here

I applied 40 iterations of the filter (Link to 75 Iterations):

enter image description here

The full code is available on my StackExchange Signal Processing Q74674 GitHub Repository (Look at the SignalProcessing\Q74674 folder).

$\endgroup$
1
  • $\begingroup$ Huh, nice. I like the idea. Simple and doesn't require a grid which can get expensive for finer quality control. However, I can imagine this approach quickly leading to poor results when we increase the size of filters. Anyway, you get an upvote for teaching me something new. $\endgroup$ Commented Apr 24, 2021 at 6:47
2
$\begingroup$

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.

$\endgroup$
3
  • $\begingroup$ Could you explain how it works? $\endgroup$ Commented Mar 18, 2023 at 20:07
  • $\begingroup$ @GeorgeIrwin added some more details. $\endgroup$ Commented Apr 13, 2023 at 18:54
  • $\begingroup$ Thanks for the explanation. So it is an approximated calculation. I thought they can have the same output. Have you seen arxiv.org/abs/1511.03296? What does it add? $\endgroup$ Commented Apr 14, 2023 at 9:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.