Efficient difference of gaussians

Hello!

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;