Bilateral FIlter

Gaussian filtering has been one of the most successful image filters in history. However, its faults as highlighted in the post on anisotropic diffusion has propelled the development of new methods that filter piecewise constant regions without dislocating or blurring the the edges. Anisotropic diffusion is one of such method. Anisotropic diffusion however, is an iterative process thus can be computationally intensive. A method that overcomes the computationally demands of Anisotropic diffusion is the Bilateral filter. To understand the development of Bilateral Filter, it is imperative to understand the development of the Gaussian filter.
Gaussian Filter is a neighbourhood operator that replaces the pixel under consideration by the weighted average of its neighbours. I know what I just said may sound like gibberish but  let me break it down.
Consider a man, who stays in a rich neighbourhood. The premise of this neighbourhood operator is this, if a man stays in a rich neighbourhood, he must be rich man. So, if there is a supposed poor man living in a rich neighbourhood, it means he wealth has not been correctly evaluated and hence, although he was previously considered poor, the mistake is now rectified and he is now considered rich. The seems like a logical approach in all regards. One question comes to light though, how do we define the neighbourhood.


Consider a rich neighbourhood that shares a boundary with a poor neighbourhood. How do you characterize a man based on his neighbours as he might stay close to the boundary and hence might be poor or “average”. Mr Gaussian Filtering then says, let me solve this


“The farther a neighbour stays from the man whose actual wealth is being considered, the less he is likely to contribute any information about the wealth the man considered. The probable information based on distance corresponds to a Gaussian curve”


A problem arose. Poor people living on the boundary of poor neighbourhood were considered to be averagely wealthy because they lived close to reach people on the other side of the boundary. The hard boundary disappeared and it was hard to distinguish both poor and rich, especially at the boundary.


Two men thus decided to end the rift between both neighbourhoods. Their names were Tomasi and Manduchi. They said “Mr Gaussian Filtering is right, but his hypothesis is not complete. Let us not characterize only by how close our neighbours are, but only by how much money they have as compared to how much money you appear to have.” It worked perfectly, people started to have their true worth and the boundary remained.


Now to the images, de-noising images is the art of removing noise and giving pixels their true worth.
The familiar Gaussian filter, penalises the contributions of neighbouring pixels based on their distance to the pixel under consideration. The assigned weights in the convolution is determined based on the predefined variance assigned to the Gaussian.


Enough talk in plain English. Let us translate into a mathematical representation. To evolve into the bilateral filter, we first provide a mathematical representation of the Gaussian filter.

Let be the position of a neighbouring pixel in the neighbourhood of the pixel under consideration at position . defined the pixel intensity at a given position. The neighbourhood operator to filter a given pixel is given by



The parameter defines a weight for the neighbour pixel under consideration. As we have earlier iterated, this weight is obtained as a penalization of the distance difference using a Gaussian.  is thus defined as




Bilateral filter presents an extra weighting term. This weighting term , is a penalization based on the difference in pixel or voxel values. The addition of this term thus changes the neighbourhood function




As you can guess from earlier explanation, this can be computed using a Gaussian function



Applying this function to images smooths the different regions of the image without any loss to the image boundaries or edges. We would practically implement this filter and apply it to an image in the next “episode”

0 comments :