1

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?

aagaard
  • 1,596
  • 2
  • 14
  • 28

1 Answers1

1

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)

Sam
  • 19,708
  • 4
  • 59
  • 82
  • Sure, but I think this is to cumbersome, when I have a opencv library available. I manage to overcome this problem by generating to seperable kernels and multiply them together. – aagaard Nov 29 '11 at 13:12