aagaard
aagaard

Reputation: 1666

OpenCV: Make a Difference-of-Gaussian

Is there a simple way of making DoG kernel to filter a image. I know it is possible to generate the kernels manually and then substract them from each other, but isn't there a smarter way to do this?

Upvotes: 1

Views: 2553

Answers (1)

Sam
Sam

Reputation: 20058

Another way of doing it is to create the analytic formula for your kernel, with the needed parameters, and calculate the position of every pixel inside.

getDoG(i,j, sigma1Big, sigma2Big, sigma1Small, sigma2small, 
                            rotationBig, rotationSmall, kernelSize, ...);

Do not ask me for the formula :)

But the easiest way is to make two kernels with the correct parameters and subtract them.

Do not forget to normalize the kernel (shift the values so that the sum of all kernel values is 1)

Upvotes: 1

Related Questions