Similar to Laplace of Gaussian, the image is first smoothed by convolution with Gaussian kernel of certain width
to get
With a different width , a second smoothed image can be obtained:
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
Both 1D and 2D functions of and and their difference are shown below:
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: