Efficient difference of gaussians

asked 2013-01-05 05:36:31 -0500

peanutman gravatar image


I am trying to implement difference of guassians (DoG), for a specific case of edge detection. As the name of the algorithm suggests, it is actually fairly straightforward:

Mat g1, g2, result;
Mat img = imread("test.png", CV_LOAD_IMAGE_COLOR); 
GaussianBlur(img, g1, Size(1,1), 0);
GaussianBlur(img, g2, Size(3,3), 0);
result = g1 - g2;

However, I have the feeling that this can be done more efficiently. Can it perhaps be done in less passes over the data? I have encountered the concept of seperable filters, but I'm too much of an image processing noob to understand how to apply them in this case.

edit retag flag offensive close merge delete