Re: A derivative of a Gaussian



Hi Shlomo

Dont use the Sobel - it is a numerical approximation to a derivative
and not the same as the analytical function. It wont work very well
for small gaussian sigma or higher order derivatives.

I used the Hermite Polynomial to generate 2D Gaussians all the time
during my PhD.

I will e-mail you a bunch of functions from my old MATLAB work - dont
ask me anything about them because I honestly wont remember!

Jason



Shlomo wrote:
Hi All,
I am investigating the canny edge detector and at the moment I am
experimenting with the derivative of a Gaussian (the first step in the
canny edge detection is convolving with a derivative of a Gaussian) and
have several questions that I hope you could help me with. I understand
that it is possible to derive the derivative of a Gaussian by a
recursive calculation using the Hermite polynomials. As I only need
the first derivative I thought about the following two options:

Option A: generate Gaussian kernels with different kernel size and
different variance in MATLAB and save them in memory.
Follow this operation with a convolution with a Sobel operator to
approximate first order differentiation
I am not sure if this is the standard way of doing that, any comments
would be welcomed.

Option B: derive the first derivative of a 2D Gaussian analytically,
generate a kernel in MATLAB and save that into memory.
Would this be better, I mean if we have the actual function why use an
approximation using a Sobel operator?

2-I am not sure my analytic derivation of the 2D Gaussian derivative is
correct (though I am sure about the 1D derivative), can anyone shed
some light on that?

In MATLAB I used the following process for generating a Kernel:
1- I obtained a 5x5 kernel with sigma=1
0.0030 0.0133 0.0219 0.0133 0.0030
0.0133 0.0596 0.0983 0.0596 0.0133
0.0219 0.0983 0.1621 0.0983 0.0219
0.0133 0.0596 0.0983 0.0596 0.0133
0.0030 0.0133 0.0219 0.0133 0.0030

2- I found the reciprocal of the smallest value (in this case 1/
.002969 =333) and multiplied the matrix by that value and rounding off
to the nearest integer.
The number 342 is the sum of all the elements in the matrix and serves
as a normalization factor.

1 5 8 5 1
5 20 33 20 5
8 33 54 33 8 x (1/342)
5 20 33 20 5
1 5 8 5 1
Is this the standard algorithm for generating a good Gaussian kernel? I
can measure the MSE and see how good it is but I want to know about
others experience.
Should I follow the same method for generating a derivative of a
Gaussian kernel?

Thanks you all for the help.

Shlomo Kashani
M.Sc Student, Digital Signal Processing
University of London

.



Relevant Pages

  • Re: A derivative of a Gaussian
    ... directional derivatives has to be convolved with the image to obtain ... Gaussian function convolved with a 1D Gaussian blur function convolved ... with the image function, is equivalent to the image function convolved ...
    (sci.image.processing)
  • Re: A derivative of a Gaussian
    ... As I understand using the associatively of convolution and the fact the ... both the Gaussian and the derivative of a Gaussian operations are ... %apply directional derivatives ...
    (sci.image.processing)
  • Re: Why is Fedora not a Free GNU/Linux distributions?
    ... loadable binary driver modules were not derivative works of the kernel - and I believe that the initial popularity of depended on that interpretation just as much as the wide use of glibc depends on it not claiming programs that use it as derivatives. ... If you truly believe in what you are saying, I would ask you to provide a direct quote. ... Does this direct quote from 1995 help your memory problem? ... Note that Linus is only one of the many copyright holders and other kernel developers intention matters too and they clearly don't agree with binary modules at all. ...
    (Fedora)
  • Re: Why is Fedora not a Free GNU/Linux distributions?
    ... of code that is restricted by the real GPL. ... involved in getting the cooperation that Alexandre refers to. ... Linus was once widely quoted as saying that loadable binary driver modules were not derivative works of the kernel - and I believe that the initial popularity of depended on that interpretation just as much as the wide use of glibc depends on it not claiming programs that use it as derivatives. ...
    (Fedora)
  • Re: Why is Fedora not a Free GNU/Linux distributions?
    ... loadable binary driver modules were not derivative works of the kernel - and I believe that the initial popularity of depended on that interpretation just as much as the wide use of glibc depends on it not claiming programs that use it as derivatives. ... moral viewpoint - is to just see module loading as "use" of the ... And if you read his statement there on why it is OK to have a non-GPL AFS module, you might perhaps understand why I am perplexed that it is not OK to have a non-GPL zfs module. ...
    (Fedora)

Loading