0

I need to compute the convolution between an input image and the derivative of a Gaussian kernel. This question has been already asked (How to apply a partial derivative Gaussian kernel to an image with OpenCV?), but it's not clear if the proposed solution refers to a simple Gaussian kernel or to its derivative.

I'm not a great expert of image filtering, but searching on the web I found out that the Sobel operator is an approximation of a gaussian kernel derivative. So, can I directly use it on my input image to get my convolution? Or, do I need to apply it on a gaussian kernel? Or is there still an even better way to proceed?

Thank you in advance

Community
  • 1
  • 1
Marco Ferro
  • 386
  • 4
  • 18
  • It depends on your application. Assuming that you are doing this as a preprocessing step for another algorithm, you may get better results by following the above answer and then applying a derivative filter. Later you can try out different algorithms for Gaussian derivative. Factors that influence "best" include the size of the filter and sigma. The Sobel operator can be interpreted as matching a particular filter size and sigma. – Robert Prévost May 16 '17 at 17:04
  • Where do you see that in the answer of the post a derivative filter is used? It is suggested to use `cv::filter2d` with a Gaussian filter, not its derivative. How would I apply a derivative filter? Basically, I'm trying to re-implement a paper for a curvature-based corner detection, and what the authors do in a certain step is to convolve the matrix of curvature with the derivative of a Gaussian filter to select a number of candidate corners. – Marco Ferro May 17 '17 at 15:06
  • Convolution is associative. Essentially, you can apply the Gaussian and then a derivative to the image or apply the derivative to the Gaussian (get a derivative of the Gaussian) and then apply that to the image. – Robert Prévost May 17 '17 at 15:27

0 Answers0