Take the 2-minute tour ×
Signal Processing Stack Exchange is a question and answer site for practitioners of the art and science of signal, image and video processing. It's 100% free, no registration required.

Allow me to show you a snip from Szeliski's Computer Vision book on bilateral filter. I don't know how to interpret these kernel definitions:


In the actual summation what values do the $k$ and $l$ take? E.g For a kernel of size 5x5 does $k$ take values between negative and positive inf? or between 1 to 5 (e.g. in matlab programming)? Or does it take values from -2 to 2?

Also what do those double bars mean in the definition of range kernel?

share|improve this question
add comment

2 Answers

A small discussion of the details you've asked for:

  1. The bilateral filter is controlled by two parameters: $\sigma$d and $\sigma$r.

• As the range parameter $\sigma$r increases, the bilateral filter becomes closer to Gaussian blur because the range Gaussian is flatter i.e., almost a constant over the intensity interval covered by the image.

• Increasing the spatial parameter $\sigma$d smooths larger features.

An important characteristic of bilateral filtering is that the weights are multiplied, which implies that as soon as one of the weight is close to 0, no smoothing occurs. As an example, a large spatial Gaussian coupled with narrow range Gaussian achieves a limited smoothing although the filter has large spatial extent. The range weight enforces a strict preservation of the contours.

"The Norm or the double bars indicate the gaussian distance in the equation.This distance is defined by Gσ(||p − q||), where σ is a parameter defining the extension of the neighborhood."

Since (i,j) and (k,l) are simply spatial points on an image, they will vary from the start of the image to the end of the image. Typically this would be dependent on your indexing measure, for example in a matrix, you've have to range from 0 to 5 for a 5x5 image. The actual values of k,l matter little. Its the relative value which matters far more.

share|improve this answer
add comment

Typically in image processing, a filter kernel is centered upon the destination pixel, so in your example, $k$ and $l$ would take on the values $-2, 1, 0, 1, 2$.

The double-vertical-bar symbol is typically used to denote some kind of norm. In your case, since (I'm assuming) $f(i,j)$ and $f(k,l)$ are scalar values, I'm assuming $\lVert f(i,j) - f(k,l) \rVert^2$ refers to the squared magnitude of the difference between the two pixel values.

share|improve this answer
thanks. these are color images. so f(i,j)-f(k,l) is a vector. –  cannot image process Dec 17 '12 at 16:44
add comment

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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