[Insight-users] GradientImageFilter vs. GradientRecursiveGaus
sianImageFilter
Miller, James V (Research)
millerjv at crd.ge.com
Thu Aug 19 09:16:12 EDT 2004
Both of these filters are calculating an image where each pixel is a
CovariantVector whose components are the derivative in x, derivative in y,
etc.
GradientImageFilter performs a simple central difference operation. I use
this
filter on data that I have already smoothed with another algorithm. For
instance, the DiscreteGaussianImageFilter, BilateralImageFilter,
CurvatureFlowImageFilter, or any of the anisotropic diffusion filters.
GradientRecursiveGaussianImageFilter yields a vector field similar to what
you
would get if you convolved an image with several derivate of gaussian
filters.
Convolving with a derivative of Gaussian is usually better (wrt to numerical
precision) than convolving with a standard Gaussian and then using central
differences. (Note that DiscreteGaussianImageFilter is a special type of
Gaussian smoothing that does perform well wrt precision when followed
by central differences). The GradientRecursiveGaussian does not actually
perform a convolution, but is a constant time algorithm wrt to kernel size.
Details can be found in the paper referenced in the code.
GradientRecursiveGaussianImageFilter probably uses more memory and
processing
time that GradientImageFilter. However, this is not an apples to apples
comparison. We should compare GradientRecursiveGaussian against
DiscreteGaussian+GradientImageFilter. Here the memory usage is probably
a push. If you are using a large smoothing kernel, then
GradientRecursiveGaussian will be much faster.
Here are my general rules of thumb:
1. If I am using a large smoothing kernel, I use the
GradientRecursiveGaussian filter.
2. If I am computing several derivatives (first, second, third), I smooth
the data once, and use central difference type filters.
Jim
-----Original Message-----
From: Michael [mailto:michakuhn at gmx.ch]
Sent: Thursday, August 19, 2004 8:23 AM
To: Insight-users
Subject: [Insight-users] GradientImageFilter vs.
GradientRecursiveGaussianImageFilter
Hi,
what exactly are the differences between the GradientImageFilter and the
GradientRecursiveGaussianImageFilter (except of the way they calculate
the gradient image)?
In both cases I would expect an output image that consists of pixels
with values [derivative1, derivative2, ..., derivativeN]. This means in
2D pixels with values [derivativeX, derivativeY], where derivativeX
denotes the derivative in direction x at the pixel position and
derivativeY the derivative in direction y. Say, we have a pixel at
position [x0, y0]. Then derivativeX should evaluate to approximately
(GetPixel(x0 + delta, y0) - GetPixel(x0 - delta, y0)) / (2 * delta)
for both filters. Is this correct?
If yes, how do the filters perform (compared to each other) with respect
to speed and memory consumption?
If no, what are the filters supposed to do?
Thanks,
Michael
_______________________________________________
Insight-users mailing list
Insight-users at itk.org
http://www.itk.org/mailman/listinfo/insight-users
More information about the Insight-users
mailing list