Similar to Laplace of Gaussian, the image is first smoothed by convolution with Gaussian kernel of certain width
![/begin{displaymath}G_{/sigma_1}(x,y)=/frac{1}{/sqrt{2/pi /sigma_1^2}}exp[-/frac{x^2+y^2}{2/sigma_1^2}] /end{displaymath}](http://fourier.eng.hmc.edu/e161/lectures/gradient/img94.png)
to get

With a different width


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.

The DoG as an operator or convolution kernel is defined as
![/begin{displaymath}DoG /stackrel{/triangle}{=}G_{/sigma_1}-G_{/sigma_2}=/frac{1}...
...)/2/sigma_1^2}-
/frac{1}{/sigma_2}e^{-(x^2+y^2)/2/sigma_2^2}]
/end{displaymath}](http://fourier.eng.hmc.edu/e161/lectures/gradient/img99.png)
Both 1D and 2D functions of


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:
- Applying DoG to the image
- Detection of zero-crossings in the image
- Threshold the zero-crossings to keep only those strong ones (large difference between the positive maximum and the negative minimum)
Edge detection by DoG operator: