[Insight-users] RecursiveGaussianImageFilter and normalization

Nicolas Savoire Nicolas . Savoire at sophia . inria . fr
Thu, 18 Dec 2003 17:36:32 +0100


Hello,

  I am using the RecursiveGaussianImageFilter to smooth an image and
compute its derivatives, and I have some trouble with normalization. I
expect this filter to give the result of the convolution with the
gaussian function g(x) = 1/(sigma^2*2*pi) exp(x^2/(2*sigma^2)),
nevertheless I get the right result only if I set
NormalizationAcrossScale to true.
On the other hand, if I want to compute the derivative of my image in
the x direction, I have to set NormalizeAcrossScale to true for the
smoothing filter and to false for the derivative filter in order to get
the expected result. As for the second derivative in one direction, to
get the correct result, one must set both NormalizeAcrossScale to false.
This is somewhat not satisfying.
I think the problem stems from the fact that the recursive filters used
internally compute derivative without normalization:
  -> g0(x) = exp(-x^2/(2*sigma^2)) for zero order
  -> g1(x) = -x*g0(x) for first order
  -> g2(x) = (x^2-sigma^2)*g0(x) for second order
and then either 1/sqrt(sigma^2*2*pi) or 1/sqrt(sigma^4*2*pi) is used to
normalize the filter. It is not satisfying, because g1(x) is different
from g0'(x) and g2(x) is different from g1'(x), which explains why some
NormalizeAcrossScale flags must be set and others not, to get the
expected result.

I don't really get the usefulness of the NormalizeAcrossScale flag, is
it related to the normalisation used in the scale-space theory for
derivatives ?

Nicolas