Difference of Gaussians
DoG subtracts two nearby blurs to spotlight structures at one size, which gives SIFT a fast way to hunt keypoints across scales.
Why Does This Exist?
A Laplacian pyramid finds scale tuned structure but costs a lot of separable second derivatives. SIFT needed something cheaper that still peaks on blobs and corners at each size. Subtracting two Gaussian blurs approximates the Laplacian with only blurs and subtraction.
That trick powers the SIFT detector. Build a scale space, subtract neighbors, then look for extrema in space and scale. For the blob view first, read blob detection.
Think of It Like This
Two frosted panes of glass
Look through one lightly frosted pane, then a slightly more frosted pane. Each view alone looks blurry. Hold the difference between the views and only structures at one size pop out.
Nearby Gaussian widths play the frosted panes. Their difference cancels both finer grain and larger shading, leaving the middle size. The analogy stops at math: DoG approximates , it does not equal it.
How It Actually Works
Blur image with Gaussians and , then subtract:
where is the blurred image. SIFT stacks several images per octave, downsamples, and repeats. Each pixel is compared to neighbors: in its own scale plus above and below. A pixel larger or smaller than all is a candidate keypoint.
Worked numbers
Take and base , the SIFT defaults. Adjacent blurs use and . A disk of radius peaks when the DoG scale matches it, while a pixel with center value against all neighbors below becomes a bright extremum. Later SIFT stages reject low contrast points with and edge-like points by Hessian ratio, but DoG supplies the candidates.
Watch Out For
DoG extrema are not finished keypoints
DoG fires on noise, edges, and low contrast texture. Without contrast filtering, edge suppression, and subpixel refinement, you match junk. Never feed raw DoG extrema into a matcher.
Octave count copied blindly
Too few octaves miss large objects, too many waste time on tiny thumbnails. Match octave count and scales per octave to your smallest and largest target sizes.
The Quick Version
- DoG equals the difference of two nearby Gaussian blurs.
- It approximates scale normalized LoG at a fraction of the cost.
- SIFT finds -neighbor extrema over space and scale.
- Contrast and edge tests prune the raw candidates.
- Octaves extend detection from fine detail to large structure.