Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

I don't really get the idea of the gaussian derivative in 8 orientations. The 2D gaussian functions are separable, so you can get the result for any direction only by computing the horizontal and vertical derivatives.

If you really want to implement the gaussian derivative, you should derivate the gaussian function and use that in your convolution (like this you can control the variance of the distribution). If the gaussian kernel is gskernel, the gaussian derivate is gdkernel (both should have the same variance), you have:

sepFilter2D(inimg, grady, ddepth, gskernel, gdkernel.t());
sepFilter2D(inimg, gradx, ddepth, gdkernel, gskernel.t());

If you really need the 8 orientations, probably the simplest method would be to rotate the image. It's much more complicated to try to convolute in arbitrary directions with another function.