SIFT is a solved algorithm (David Lowe, 2004). Its complexity is O(nlogn) per image where n is the number of pixels, and it produces a fixed-length 128-dimensional descriptor per keypoint. The problem it solves has a clean, efficient answer — but the why behind each design step is worth tracing.
Step 1 — Build a scale space. Blur the image repeatedly with Gaussians of increasing σ: L(x,y,σ)=G(x,y,σ)∗I(x,y). Fine detail vanishes at large σ; stable structures persist.
Step 2 — Difference of Gaussians (DoG). Subtract adjacent blurred copies: D(x,y,σ)=L(x,y,kσ)−L(x,y,σ). DoG approximates the Laplacian of Gaussian, a blob detector. Local extrema of D across (x,y,σ) are candidate keypoints — they mark positions that are distinctive at a particular scale.
Step 3 — Orientation assignment. For each keypoint, collect gradient magnitudes and directions in a 16×16 neighborhood. Build an 8-bin histogram of directions, weighted by magnitude. The dominant bin becomes the keypoint's canonical orientation. From this moment the descriptor is orientation-normalized: all subsequent measurements are taken relative to this angle, so a 90-degree rotation simply shifts which bin is "bin 0."
Step 4 — The 128-d descriptor. Divide the 16×16 neighborhood into a 4×4 grid of cells. In each 4×4 cell compute an 8-bin gradient-direction histogram. Concatenate the 4×4×8=128 values, normalize the vector (making it robust to linear lighting changes), then clip values at 0.2 and renormalize (removing the effect of non-linear changes).
Matching two images means comparing 128-d vectors with Euclidean distance and using Lowe's ratio test: a match is accepted only if the closest descriptor is significantly closer than the second-closest (d1/d2<0.8). This simple threshold dramatically cuts false positives.
SIFT's brilliance is that no single step is complex — each is a weighted histogram or a Gaussian blur. The invariance emerges from their careful combination. See also dimensionality reduction for why compressing 128 dimensions matters, and pattern matching for the broader landscape of matching algorithms.
Comments
Loading comments...