Difference of Gaussian (DoG)

Similar to Laplace of Gaussian, the image is first smoothed by convolution with Gaussian kernel of certain width $\sigma_1$

$\displaystyle G_{\sigma_1}(x,y)
=\frac{1}{\sqrt{2\pi \sigma_1^2}}exp\left(-\frac{x^2+y^2}{2\sigma_1^2}\right)$ (54)

to get

$\displaystyle g_1(x,y)=G_{\sigma_1}(x,y)*f(x,y)$ (55)

With a different width $\sigma_2$, a second smoothed image can be obtained:

$\displaystyle g_2(x,y)=G_{\sigma_2}(x,y)*f(x,y)$ (56)

We can show that the difference of these two Gaussian smoothed images, called difference of Gaussian (DoG), can be used to detect edges in the image.

$\displaystyle g_1(x,y)-g_2(x,y)=G_{\sigma_1}*f(x,y)-G_{\sigma_2}*f(x,y)
=(G_{\sigma_1}-G_{\sigma_2})*f(x,y)=DoG*f(x,y)$ (57)

The DoG as an operator or convolution kernel is defined as

$\displaystyle DoG \stackrel{\triangle}{=}G_{\sigma_1}-G_{\sigma_2}=\frac{1}{\sq...
\frac{1}{\sigma_2}e^{-(x^2+y^2)/2\sigma_2^2}\right)$ (58)

Both 1-D and 2-D functions of $G_{\sigma_1}(x,y)$ and $G_{\sigma_2}(x,y)$ and their difference are shown below:



As the difference between two differently low-pass filtered images, the DoG is actually a band-pass filter, which removes high frequency components representing noise, and also some low frequency components representing the homogeneous areas in the image. The frequency components in the passing band are assumed to be associated to the edges in the images.

The discrete convolution kernel for DoG can be obtained by approximating the continuous expression of DoG given above. Again, it is necessary for the sum or average of all elements of the kernel matrix to be zero.

Comparing this plot with the previous one, we see that the DoG curve is very similar to the LoG curve. Also, similar to the case of LoG, the edges in the image can be obtained by these steps:

The last step is needed to suppress the weak zero-crossings most likely caused by noise.

Edge detection by DoG operator: