# Gaussian derivative with orientation

Hey all,

I am working out an idea from a paper which talks about taking the Gaussian derivative in 8 orientations. In summary, my question is: How can I do this using OpenCV?

I assume the Gaussian derivative means a difference of Gaussian in a certain orientation. How can I acquire the Gaussian filter in these orientations to use in a convolution? Or is it easier to rotate the image instead?

Best regards, Hans

edit retag close merge delete

Sort by » oldest newest most voted

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());


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.

more

Official site

GitHub

Wiki

Documentation