[Insight-developers] RecursiveGaussianImageFilter
Gunnar Farneback
gunnar at bwh.harvard.edu
Tue Dec 7 17:38:51 EST 2004
> Embarrassingly enough it looks like I managed to mess up the
> normalization across scales after all. Please find a new version at
> http://lmi.bwh.harvard.edu/~gunnar/itk_recursive_gaussian.html
> (only itkRecursiveGaussianImageFilter.txx has been changed).
I have now found out how to run a single test by hand. Apparently
itkRecursiveGaussianImageFiltersTest still fails the normalization
across scales, although now it's at least close.
Now the question is what normalization across scales actually means.
1. Judging from the testcase it means that the maximum impulse
response should be constant for the smoothing filter.
2. A comment in SmoothingRecursiveGaussianImageFilter.cxx says:
| There are two typical ways of normalizing Gaussians depending on their
| application. For scale-space analysis it is desirable to use a
| normalization that will preserve the maximum value of the input. This
I'm not sure I can make sense of this but it seems difficult to do
in general without having an image dependent normalization.
3. The documentation for the NormalizeAcrossScale flag in
itkRecursiveGaussianImageFilter.h says:
| Set/Get the flag for normalizing the gaussian over scale space.
| When this flag is ON the filter will be normalized in such a way
| that larger sigmas will not result in the image fading away.
This is not very exact but possibly consistent with the regression
test.
| \f[
| \frac{ 1 }{ \sqrt{ 2 \pi } };
| \f]
|
| When the flag is OFF the normalization will conserve contant the
| integral of the image intensity.
| \f[
| \frac{ 1 }{ \sigma \sqrt{ 2 \pi } };
| \f]
This normalization factor is only correct for the continuous
Gaussian. My implementation computes the normalization factor so
that the sum of the actual discrete infinite impulse response is
exactly one. From the equations above I then assumed that
multiplying the response by sigma when NormalizAcrossScale is ON
would be good enough.
So, how should the normalization across scale be implemented? I can
certainly change so that 1. is fulfilled if that is what we want but
what is the appropriate scaling in that case for the derivative
filters? Where should I read or who should I ask to find out? Or is my
implementation okay but the test should be changed instead?
Two more technical questions about running tests:
1. I haven't found out how to run e.g. the
itkLaplacianRecursiveGaussianImageFilterTest by hand without having
to look in Testing/Code/BasicFilters/DartTestfile.txt for the
input file. I assume there is some mechanism that automates
running the tests.
2. Is there some easy way to run a custom collection of tests, more
specifically the ones failing on
http://www.itk.org/Testing/Sites/zion.kitware/Linux-g++-3.3/20041206-1919-Experimental/Test.html ?
/Gunnar
More information about the Insight-developers
mailing list