Ask Your Question
0

Gaussian derivative with orientation

asked 2014-05-27 07:19:12 -0600

Hansg91 gravatar image

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 flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
1

answered 2014-05-27 11:46:00 -0600

kbarni gravatar image

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.

edit flag offensive delete link more

Question Tools

Stats

Asked: 2014-05-27 07:19:12 -0600

Seen: 1,853 times

Last updated: May 27 '14