Skip to content

Difference of Gaussians

Difference of Gaussians (DoG) enhances spots of one size: a slightly blurred copy of the image minus a more blurred one keeps the details of a spot’s size and removes finer noise and coarser background and structures. Bright spots become positive peaks, dark spots negative ones, and flat background becomes 0.

Two Gaussians, the narrow one of Sigma and a wider one of 1.6 Sigma, and their difference: a peak with negative side lobes that keeps details of a spot's size

A typical spot pipeline:

Difference of Gaussians → Find Maxima → Extract Objects

It is a preprocessing step: its result replaces the image for the steps after it. Measure intensities on the original channel, not on this image. In a project file it is DIFFERENCE_OF_GAUSSIANS.

As Laplacian of Gaussian: to find small spots of about one size on an uneven background. The DoG approximates the LoG and gives values in the same units, so a Find Maxima cut-off found for one works for the other. For objects of different sizes, use Bandpass, where both σ are free.

ParameterDescription
SigmaThe scale σ of the spots to enhance - the narrower Gaussian; the wider one is 1.6 σ. As a guide, σ ≈ spot radius / √2 (1.4 for spots of 4 px radius). Smaller details count as noise, larger ones as background. Default 1.5, range 0.1-1000.
UnitUnit of Sigma: px (default) or nm. Without a pixel size, nm are taken as pixels.

The image is smoothed with the discrete Gaussian (Lindeberg 1998, appendix A.4.1) at σ and at 1.6 σ, and the result is

L(σ)−L(1.6 σ)0.6\frac{L(\sigma) - L(1.6\,\sigma)}{0.6}

The ratio 1.6 is the narrowest band-pass that still keeps the filter sensitive (Marr & Hildreth 1980, appendix B). Since G(kσ)−G(σ)≈(k−1) σ2∇2GG(k\sigma) - G(\sigma) \approx (k - 1)\,\sigma^2 \nabla^2 G (Lowe 2004, sect. 3), dividing by k−1=0.6k - 1 = 0.6 gives the units of the scale-normalized Laplacian of Gaussian, with bright spots positive.

  • 2D only: each plane is filtered on its own.
  • On a whole slide the filter runs per tile, mirrored at the tile’s borders like Gaussian Blur. Small images are one tile and not affected.
  • Marr D. & Hildreth E., “Theory of Edge Detection,” Proceedings of the Royal Society of London. Series B, vol. 207, pp. 187-217, 1980. doi:10.1098/rspb.1980.0020
  • Lowe D. G., “Distinctive Image Features from Scale-Invariant Keypoints,” International Journal of Computer Vision, vol. 60, pp. 91-110, 2004. doi:10.1023/B:VISI.0000029664.99615.94
  • Lindeberg T., “Feature Detection with Automatic Scale Selection,” International Journal of Computer Vision, vol. 30, pp. 79-116, 1998. doi:10.1023/A:1008045108935

The step cites all three; see Citation for exporting the citations of a project.