Algorithm Search⌘K

Conceptcore

Scale space

Also called linear scale space, Gaussian scale space.

The family of images made by smoothing one image with Gaussians of growing width, so that structures of every size can be found at their own scale.

The scale space of an image ff is the family of smoothed images

L(x,t)=(gt∗f)(x),gt(x)=12πte−∣x∣2/(2t),L(\mathbf x, t) = (g_t \ast f)(\mathbf x), \qquad g_t(\mathbf x) = \frac{1}{2\pi t} e^{-\lvert\mathbf x\rvert^2 / (2t)},

for all scales t≥0t \ge 0, with L(⋅,0)=fL(\cdot, 0) = f. The scale t=σ2t = \sigma^2 is the variance of the Gaussian filter, so details smaller than about t\sqrt t are smoothed away at scale tt. The family is the solution of the heat equation ∂tL=12∇2L\partial_t L = \frac12 \nabla^2 L with ff as the start value. It is the only family of linear, shift invariant smoothings that has a small set of natural properties, among them that smoothing never creates new structure. Feature detectors use it to look at an image at every size at once: the DoG detector, the determinant of Hessian detector and the Harris-Laplace detector search for maxima over position and scale, and automatic scale selection says at which scale to read each feature.

In plain words

A photograph holds things of many sizes: the grain of a wall, the bricks, the windows, the whole house. Which ones matter depends on the task, and the right size is not known in advance. Scale space keeps all sizes. It makes a stack of copies of the image, each one more blurred than the one before. Small details disappear first, then larger ones. A detail that stays visible over a long part of the stack is a real structure of that size. The blur is a special one, the Gaussian, because it is the only blur that never adds new spots or edges while it removes the old ones, so every structure in a blurred copy comes from the original image.

The idea

Smoothing as a family. Let ff be a gray digital image, seen as a function on the plane. Take the Gaussian gtg_t of variance tt in each direction and define L(⋅,t)=gt∗fL(\cdot, t) = g_t \ast f. Then LL is a function of three variables, two of position and one of scale. The units of tt are pixels squared; a scale parameter σ=t\sigma = \sqrt t in pixels is also common.

The semigroup property. Gaussians add their variances: gs∗gt=gs+tg_s \ast g_t = g_{s + t}. So the image at scale s+ts + t is the image at scale ss smoothed by gtg_t, and a coarse scale can be computed from a finer one. This is what makes a Gaussian pyramid cheap: each level smooths the one before it a little more, and halves the size when σ\sigma doubles.

The diffusion equation. gtg_t satisfies ∂tgt=12∇2gt\partial_t g_t = \frac12 \nabla^2 g_t, and so does LL. Smoothing is diffusion of the gray values, as heat spreads in a plate. At a local maximum of LL in space the Laplacian is negative or zero, so the value can only fall as tt grows; at a local minimum it can only rise. This is the causality requirement of Koenderink: a level line at a coarse scale always comes from a level line at a finer scale.

Derivatives commute with smoothing. ∂x(gt∗f)=(∂xgt)∗f\partial_x (g_t \ast f) = (\partial_x g_t) \ast f. So the derivatives of LL at scale tt are well defined for any image, even one with jumps, and are computed by filtering with Gaussian derivatives. This scale-space derivative is the basis of the Laplacian of Gaussian, the Harris measure, the Hessian and most detectors on this site.

Why the Gaussian. Several sets of axioms single out the Gaussian kernel. Among linear and shift invariant smoothings with the semigroup property that treat all directions and all scales alike, the Gaussian is the only one that does not create new local extrema in 1D signals (Babaud and others, 1986) or new level lines in the sense of causality (Koenderink, 1984). Iijima gave an axiomatic derivation in Japan much earlier, as Weickert and others describe. In 2D the statement must be made with care: the Gaussian does not enhance extrema, but new local extrema can appear in an image under Gaussian smoothing, as Lifshitz and Pizer observed.

Discrete scale space. On the pixel grid, the sampled Gaussian is only an approximation, and for small tt it is a poor one. Lindeberg derived the discrete analogue: the kernel T(n,t)=e−tIn(t)T(n, t) = e^{-t} I_n(t), where InI_n is the modified Bessel function of integer order. It sums to 11, has the variance tt exactly, satisfies the semigroup property exactly, and does not create local extrema in 1D. In 2D it is used separably along rows and columns.

Examples

The two kernels at small and medium scale. The table gives the values at n=0,1,2,3n = 0, 1, 2, 3, the sum and the variance.

tt kernel n=0n = 0 n=1n = 1 n=2n = 2 n=3n = 3 sum variance
0.25 discrete e−tIn(t)e^{-t} I_n(t) 0.7910 0.0981 0.0061 0.0003 1.0000 0.250
0.25 sampled Gaussian 0.7979 0.1080 0.0003 0.0000 1.0144 0.215
1 discrete e−tIn(t)e^{-t} I_n(t) 0.4658 0.2079 0.0499 0.0082 1.0000 1.000
1 sampled Gaussian 0.3989 0.2420 0.0540 0.0044 1.0000 1.000

At t=1t = 1 the two kernels are close and both have variance 11. At t=0.25t = 0.25 the sampled Gaussian does not sum to 11 and, after normalization, has the variance 0.2150.215 instead of 0.250.25: it smooths less than it should.

Extrema disappear and do not appear in 1D. Take the 22 values 0,0,3,1,4,1,5,9,2,6,5,3,5,8,9,7,9,3,2,3,0,00, 0, 3, 1, 4, 1, 5, 9, 2, 6, 5, 3, 5, 8, 9, 7, 9, 3, 2, 3, 0, 0 and smooth them with the discrete kernel, with the clamp border rule. The number of strict local extrema inside the signal is:

tt 0 0.5 1 2 4 8 16
extrema 13 11 5 3 1 1 1

The count never grows. At t=4t = 4 one maximum is left, at the position of the largest mass of high values, and it stays.

A blob. A Gaussian blob f=exp⁡(−∣x∣2/(2t0))f = \exp(-\lvert\mathbf x\rvert^2 / (2t_0)) has the scale space L(x,t)=t0t0+texp⁡(−∣x∣2/(2(t0+t)))L(\mathbf x, t) = \frac{t_0}{t_0 + t} \exp(-\lvert\mathbf x\rvert^2 / (2(t_0 + t))): it gets wider and lower, and its variance grows from t0t_0 to t0+tt_0 + t. Its normalized Laplacian at the center is largest at t=t0t = t_0, which is how automatic scale selection finds the size of the blob.

An edge. A unit step along xx becomes L(x,t)=Φ(x/t)L(x, t) = \Phi(x / \sqrt t), with Φ\Phi the normal distribution function. The gradient at the edge is 1/2πt1/\sqrt{2\pi t}, which falls with tt. The product t⋅Lx=1/2π\sqrt t \cdot L_x = 1/\sqrt{2\pi} does not depend on tt: this is the normalized derivative with γ=1\gamma = 1, and it shows that a perfect step has no scale of its own.

Where it is used

  • Scale invariant detectors. The DoG detector of SIFT, the determinant of Hessian detector, SURF, Harris-Laplace and Hessian-Laplace all search maxima of a normalized measure in the three dimensions of scale space.
  • Scale selection. Automatic scale selection chooses the scale of each feature from the scale-space derivatives.
  • Pyramids. Gaussian pyramids and image pyramids sample scale space at a few scales and reduce the size of the coarse images.
  • Edges and derivatives. The Canny edge detector smooths with a Gaussian of chosen scale before it takes derivatives. Derivatives at a known scale also enter optical flow, stereo and the histogram of oriented gradients.
  • Nonlinear scale spaces. Anisotropic diffusion replaces the heat equation by one that smooths less across edges. KAZE features detect points in such a nonlinear scale space.

References

  1. Andrew P. Witkin, Scale-space filtering, Proceedings of the Eighth International Joint Conference on Artificial Intelligence (IJCAI 1983), Volume 2, 1019-1022, 1983, the scale-space image of a 1D signal and the tracking of zero crossings over scale
  2. Jan J. Koenderink, The structure of images, Biological Cybernetics 50(5), 363-370, 1984, the causality requirement and the diffusion equation
  3. Jean Babaud, Andrew P. Witkin, Michel Baudin and Richard O. Duda, Uniqueness of the Gaussian kernel for scale-space filtering, IEEE Transactions on Pattern Analysis and Machine Intelligence 8(1), 26-33, 1986, the uniqueness theorem for 1D signals
  4. Tony Lindeberg, Scale-Space Theory in Computer Vision, Kluwer Academic Publishers, 1994, the chapters on the axioms of linear scale space, the discrete scale-space kernel and Gaussian derivatives
  5. Joachim Weickert, Seiji Ishikawa and Atsushi Imiya, Linear scale-space has first been proposed in Japan, Journal of Mathematical Imaging and Vision 10(3), 237-252, 1999, the account of the axioms of Iijima
  6. Lawrence M. Lifshitz and Stephen M. Pizer, A multiresolution hierarchical approach to image segmentation based on intensity extrema, IEEE Transactions on Pattern Analysis and Machine Intelligence 12(6), 529-540, 1990, the discussion of extrema that appear in 2D images under Gaussian smoothing

Where this leads

About this page

The build computes these levels from the evidence in the repository. Each row says what the next level needs. Read what the levels mean.

LadderLevelWhat the next level needs
Human proofH0 no proof
  • add a proof in proofs/ (06.5)
LeanL0 no Lean part
  • name a Lean module in the lean field (07)
VisualV0 none
  • add viz/scene.ts or a figure (10)
WritingW4 complete
  • a review of the text: no review record reviews/5F7SJW/text.yaml