Lucas-Kanade 20 Years On: A Unifying Framework

Simon BakerIain Matthews

article2004IJCV3,524 citations

Establishes a unifying framework for Lucas-Kanade image alignment by proving the first-order equivalence of forward, inverse, additive, and compositional approaches, demonstrating that the inverse compositional Gauss-Newton algorithm achieves dramatic computational speedups without sacrificing accuracy.

Listen

The Lucas-Kanade algorithm, introduced in 1981, established image alignment as a core computer vision technique for tasks such as optical flow, tracking, motion estimation, mosaic construction, and face modeling. Over two decades, numerous variants and extensions appeared, differing in how they approximate the error surface, update the warp, and handle gradient descent, which created confusion about their relative merits and computational costs.

This paper develops a single framework that classifies these algorithms along two independent axes: whether they perform additive or compositional updates to the warp, and whether they operate in a forwards or inverse manner. It derives closed-form expressions for each combination, proves that the four principal variants reach the same first-order solution, and validates the equivalence through controlled experiments on affine and homography warps using thousands of random initializations.

The analysis shows that the inverse compositional algorithm is the only variant that shifts the dominant Hessian computation into a one-time pre-computation while remaining applicable to any set of warps that forms a group. Among gradient-descent approximations, the Gauss-Newton and Levenberg-Marquardt forms converge fastest and most reliably; steepest-descent and diagonal-Hessian approximations converge far more slowly and are sensitive to parameterization. Timing measurements confirm that the inverse compositional Gauss-Newton method reduces per-iteration cost from O(n²N + ) to O(nN + ).

These results matter because practitioners can now select an algorithm on the basis of required speed and expected noise distribution rather than ad-hoc trial. When the template is less noisy than the input image, the inverse compositional Gauss-Newton or Levenberg-Marquardt algorithm is the clear practical choice; when the template is noisier, a forwards variant may be preferable despite its higher cost.

The paper notes that its empirical comparisons are limited to affine and homography warps and that performance still varies with image content. It defers treatment of robust error norms, linear appearance variation, and parameter priors to subsequent papers in the series.

Cover for Lucas-Kanade 20 Years On: A Unifying Framework

Abstract

Since the Lucas-Kanade algorithm was proposed in 1981 image alignment has become one of the most widely used techniques in computer vision. Applications range from optical flow and tracking to layered motion, mosaic construction, and face coding. Numerous algorithms have been proposed and a wide variety of extensions have been made to the original formulation. We present an overview of image alignment, describing most of the algorithms and their extensions in a consistent framework. We concentrate on the inverse compositional algorithm, an efficient algorithm that we recently proposed. We examine which of the extensions to Lucas-Kanade can be used with the inverse compositional algorithm without any significant loss of efficiency, and which cannot. In this paper, Part 1 in a series of papers, we cover the quantity approximated, the warp update rule, and the gradient descent approximation. In future papers, we will cover the choice of the error function, how to allow linear appearance variation, and how to impose priors on the parameters.

Table of Contents

  • 1. Introduction
  • 2. Background: Lucas-Kanade
  • 2.1. Goal of the Lucas-Kanade Algorithm
  • 2.2. Derivation of the Lucas-Kanade Algorithm
  • 2.3. Requirements on the Set of Warps
  • 2.4. Computational Cost of the Lucas-Kanade Algorithm
  • 3. The Quantity Approximated and the Warp Update Rule
  • 3.1. Compositional Image Alignment
  • 3.1.1. Goal of the Compositional Algorithm. The compositional algorithm, used most notably by Shum and Szeliski (2000), approximately minimizes:
  • 3.2. Inverse Compositional Image Alignment
  • 3.2.1. Goal of the Inverse Compositional Algorithm.
  • 3.2.2. Derivation of the Inverse Compositional Algorithm. Performing a first order Taylor expansion on Eq. (31) gives:
  • 3.2.3. Requirements on the Set of Warps. Besides the semi-group requirement of the forwards compositional algorithm the inverse compositional algorithm also requires that the incremental warp W(x;Δp)\mathbf{W}(\mathbf{x}; \Delta \mathbf{p}) be inverted before it is composed with the current estimate. The inverse compositional algorithm can therefore only be applied to sets of warps that form a group. Fortunately, most warps used in computer vision, including homographies and 3D rotations (Shum and Szeliski, 2000), do form groups. One notable exception are the piecewise affine warps used in Active Appearance Models
  • 3.3. Inverse Additive Image Alignment
  • 3.4. Empirical Validation
  • 3.5. Summary
  • 4. The Gradient Descent Approximation
  • 4.1. The Gauss-Newton Algorithm
  • 4.2. The Newton Algorithm
  • The Newton Inverse Compositional Algorithm
  • 4.3. Steepest Descent
  • 4.3.1. Derivation of the Steepest Descent Algorithm.
  • 4.3.2. Computational Cost of the Gauss-Newton Steepest Descent Algorithm.
  • The GN Steepest Descent Inverse Compositional Algorithm
  • 4.4. The Diagonal Approximation to the Hessian
  • The Diagonal Hessian Inverse Compositional Algorithm
  • 4.5. The Levenberg-Marquardt Algorithm
  • 4.5.1. Computational Cost of the Levenberg-Marquardt Inverse Compositional Algorithm.
  • 4.6. Empirical Validation
  • 4.7. Summary
  • 4.8. Other Algorithms
  • 5. Discussion
  • 6. Matlab Code, Test Images, and Scripts
  • Appendix A: Inverse Compositional Derivations for the Homography
  • A.1. Gauss-Newton Inverse Compositional Algorithm
  • A.2. Newton Inverse Compositional Algorithm

Knowls

  1. Knowl 1 — Gauss-Newton Inverse Compositional Image Alignment Algorithm

    algorithm

    The Gauss-Newton Inverse Compositional algorithm registers an input image I(x)I(\mathbf{x}) to a reference template image T(x)T(\mathbf{x}) by iteratively optimizing warp parameters p=(p1,,pn)TRn\mathbf{p} = (p_1, \dots, p_n)^T \in \mathbb{R}^n governing a parameterized coordinate transformation W(x;p)\mathbf{W}(\mathbf{x}; \mathbf{p}). The coordinate x=(x,y)T\mathbf{x} = (x, y)^T ranges over all NN pixels in the coordinate frame of TT, and W(x;0)=x\mathbf{W}(\mathbf{x}; \mathbf{0}) = \mathbf{x} represents the identity transformation.

    All computationally demanding steps—spatial template gradients T\nabla T, warp Jacobians evaluated at zero Wp(x;0)\left.\frac{\partial \mathbf{W}}{\partial \mathbf{p}}\right|_{(\mathbf{x}; \mathbf{0})}, steepest descent images, and the n×nn \times n Gauss-Newton Hessian matrix HH along with its inverse H1H^{-1}—are computed once during a pre-computation stage. Each iteration requires only image warping, image subtraction, image dot products to form the parameter gradient update vector, matrix multiplication with the precomputed H1H^{-1}, and warp parameter composition via the inverse increment W(x;Δp)1\mathbf{W}(\mathbf{x}; \Delta \mathbf{p})^{-1}.

    Input: Template image T(x)T(\mathbf{x}), input image I(x)I(\mathbf{x}), initial warp parameters p\mathbf{p}, convergence threshold ϵ>0\epsilon > 0
    Output: Converged warp parameters p\mathbf{p}
    Pre-computation:
    Evaluate gradient T(x)=(Tx,Ty)\nabla T(\mathbf{x}) = \left(\frac{\partial T}{\partial x}, \frac{\partial T}{\partial y}\right) for all pixels x\mathbf{x} in TT
    Evaluate warp Jacobian Wp\frac{\partial \mathbf{W}}{\partial \mathbf{p}} at (x;0)(\mathbf{x}; \mathbf{0})
    Compute steepest descent images TWp\nabla T \frac{\partial \mathbf{W}}{\partial \mathbf{p}} for all pixels x\mathbf{x}
    Compute Hessian matrix H=x[TWp]T[TWp]H = \sum_{\mathbf{x}} \left[\nabla T \frac{\partial \mathbf{W}}{\partial \mathbf{p}}\right]^T \left[\nabla T \frac{\partial \mathbf{W}}{\partial \mathbf{p}}\right]
    Compute inverse Hessian H1H^{-1}
    Iteration:
    repeat
        Warp input image II to compute I(W(x;p))I(\mathbf{W}(\mathbf{x}; \mathbf{p}))
        Compute error image E(x)=I(W(x;p))T(x)E(\mathbf{x}) = I(\mathbf{W}(\mathbf{x}; \mathbf{p})) - T(\mathbf{x})
        Compute steepest descent parameter updates v=x[TWp]TE(x)\mathbf{v} = \sum_{\mathbf{x}} \left[\nabla T \frac{\partial \mathbf{W}}{\partial \mathbf{p}}\right]^T E(\mathbf{x})
        Compute parameter update Δp=H1v\Delta \mathbf{p} = H^{-1} \mathbf{v}
        Invert incremental warp W(x;Δp)\mathbf{W}(\mathbf{x}; \Delta \mathbf{p}) to obtain W(x;Δp)1\mathbf{W}(\mathbf{x}; \Delta \mathbf{p})^{-1}
        Update current warp W(x;p)W(x;p)W(x;Δp)1\mathbf{W}(\mathbf{x}; \mathbf{p}) \leftarrow \mathbf{W}(\mathbf{x}; \mathbf{p}) \circ \mathbf{W}(\mathbf{x}; \Delta \mathbf{p})^{-1}
    until Δpϵ\|\Delta \mathbf{p}\| \le \epsilon
    return p\mathbf{p}

    The pre-computation has time complexity O(n2N)O(n^2 N). Each iteration has time complexity O(nN+n2)O(nN + n^2) (or O(nN+n3)O(nN + n^3) if H1H^{-1} is multiplied explicitly rather than pre-factored), representing a substantial speedup over classical Lucas-Kanade whose per-iteration complexity is O(n2N+n3)O(n^2 N + n^3).

  2. Knowl 2 — Objective Function and Warp Update of the Inverse Compositional Formulation

    equation

    The Inverse Compositional image alignment formulation reverses the roles of the template T(x)T(\mathbf{x}) and the input image I(x)I(\mathbf{x}) in the optimization objective by warping the template with an incremental warp W(x;Δp)\mathbf{W}(\mathbf{x}; \Delta \mathbf{p}):

    minΔpx[T(W(x;Δp))I(W(x;p))]2\min_{\Delta \mathbf{p}} \sum_{\mathbf{x}} \left[ T(\mathbf{W}(\mathbf{x}; \Delta \mathbf{p})) - I(\mathbf{W}(\mathbf{x}; \mathbf{p})) \right]^2

    where x=(x,y)T\mathbf{x} = (x, y)^T ranges over all pixels in the template TT, p=(p1,,pn)T\mathbf{p} = (p_1, \dots, p_n)^T is the vector of current warp parameters, Δp=(Δp1,,Δpn)T\Delta \mathbf{p} = (\Delta p_1, \dots, \Delta p_n)^T is the vector of incremental parameter updates, and W(x;0)=x\mathbf{W}(\mathbf{x}; \mathbf{0}) = \mathbf{x} is the identity warp.

    Performing a first-order Taylor series expansion of T(W(x;Δp))T(\mathbf{W}(\mathbf{x}; \Delta \mathbf{p})) around Δp=0\Delta \mathbf{p} = \mathbf{0} yields the closed-form Gauss-Newton solution:

    Δp=H1x[TWp]T[I(W(x;p))T(x)]\Delta \mathbf{p} = H^{-1} \sum_{\mathbf{x}} \left[ \nabla T \frac{\partial \mathbf{W}}{\partial \mathbf{p}} \right]^T \left[ I(\mathbf{W}(\mathbf{x}; \mathbf{p})) - T(\mathbf{x}) \right]

    where T=(Tx,Ty)\nabla T = \left(\frac{\partial T}{\partial x}, \frac{\partial T}{\partial y}\right) is the gradient of the template, Wp\frac{\partial \mathbf{W}}{\partial \mathbf{p}} is the 2×n2 \times n warp Jacobian evaluated at (x;0)(\mathbf{x}; \mathbf{0}), and the n×nn \times n Gauss-Newton Hessian matrix is independent of p\mathbf{p} and defined by:

    H=x[TWp]T[TWp]H = \sum_{\mathbf{x}} \left[ \nabla T \frac{\partial \mathbf{W}}{\partial \mathbf{p}} \right]^T \left[ \nabla T \frac{\partial \mathbf{W}}{\partial \mathbf{p}} \right]

    The warp estimate is updated by inverting the incremental warp and composing it with the current warp estimate:

    W(x;p)W(x;p)W(x;Δp)1\mathbf{W}(\mathbf{x}; \mathbf{p}) \leftarrow \mathbf{W}(\mathbf{x}; \mathbf{p}) \circ \mathbf{W}(\mathbf{x}; \Delta \mathbf{p})^{-1}

  3. Knowl 3 — First-Order Equivalence of Image Alignment Formulations

    theoretical result

    The four fundamental gradient-descent image alignment algorithms—Forwards Additive (classical Lucas-Kanade), Forwards Compositional (Shum-Szeliski), Inverse Additive (Hager-Belhumeur), and Inverse Compositional (Baker-Matthews)—are mathematically equivalent to first order in the parameter update Δp\Delta \mathbf{p}. Specifically, in each iteration, all four algorithms make identical updates to the parameterized warp W(x;p)\mathbf{W}(\mathbf{x}; \mathbf{p}) up to O(Δp2)O(\|\Delta \mathbf{p}\|^2).

    This equivalence holds under the following conditions:

    1. The set of allowed warps forms a mathematical group (satisfying identity W(x;0)=x\mathbf{W}(\mathbf{x}; \mathbf{0}) = \mathbf{x}, closure under composition W(x;p1)W(x;p2)W\mathbf{W}(\mathbf{x}; \mathbf{p}_1) \circ \mathbf{W}(\mathbf{x}; \mathbf{p}_2) \in \mathcal{W}, and invertibility W(x;p)1W\mathbf{W}(\mathbf{x}; \mathbf{p})^{-1} \in \mathcal{W}).
    2. The current parameter estimate p\mathbf{p} is in the neighborhood of convergence such that the intensity discrepancy between the template and warped image satisfies T(x)I(W(x;p))=O(Δp)T(\mathbf{x}) - I(\mathbf{W}(\mathbf{x}; \mathbf{p})) = O(\|\Delta \mathbf{p}\|).
    3. For the Inverse Additive formulation, the warp Jacobian product must additionally satisfy the factorization condition (Wx)1Wp=Γ(x)Σ(p)\left(\frac{\partial \mathbf{W}}{\partial \mathbf{x}}\right)^{-1} \frac{\partial \mathbf{W}}{\partial \mathbf{p}} = \Gamma(\mathbf{x}) \Sigma(\mathbf{p}).
  4. Knowl 4 — Taxonomy, Algebraic Requirements, and Complexity of Image Alignment Approaches

    model/method

    Image alignment algorithms can be systematically classified along two orthogonal axes: parameter update style (Additive vs. Compositional) and image-template role (Forwards vs. Inverse).

    Algorithm Primary Reference Pre-computation Per-Iteration Cost Warp Set Requirement
    Forwards Additive Lucas and Kanade (1981) None O(n2N+n3)O(n^2 N + n^3) Any differentiable warp
    Forwards Compositional Shum and Szeliski (2000) O(nN)O(nN) O(n2N+n3)O(n^2 N + n^3) Semi-group containing identity
    Inverse Additive Hager and Belhumeur (1998) O(k2N)O(k^2 N) O(nN+kN+k3)O(nN + kN + k^3) Factorable Jacobians
    Inverse Compositional Baker and Matthews (2001) O(n2N)O(n^2 N) O(nN+n3)O(nN + n^3) Lie group / group of warps

    Here nn denotes the number of warp parameters, NN is the number of template pixels, and knk \ge n is the column dimension of the factorized spatial matrix Γ(x)\Gamma(\mathbf{x}) in the Inverse Additive formulation.

    The Forwards Additive and Forwards Compositional methods recompute the Hessian at every iteration because image gradients must be evaluated on the warped input image. The Inverse Additive and Inverse Compositional methods achieve efficiency by evaluating gradients on the fixed template image, allowing the Hessian to be computed once. While the Inverse Additive formulation is restricted to a small family of warps where Jacobians factor analytically (such as 2D translations, similarity, and affine warps), the Inverse Compositional algorithm generalizes to any set of warps that form a group, including homographies and 3D projective transformations.

  5. Knowl 5 — Classical Forwards Additive Lucas-Kanade Algorithm

    algorithm

    The classical Lucas-Kanade algorithm minimizes the sum of squared differences between a template image T(x)T(\mathbf{x}) and an input image I(x)I(\mathbf{x}) warped by parameter vector pRn\mathbf{p} \in \mathbb{R}^n:

    minΔpx[I(W(x;p+Δp))T(x)]2\min_{\Delta \mathbf{p}} \sum_{\mathbf{x}} \left[ I(\mathbf{W}(\mathbf{x}; \mathbf{p} + \Delta \mathbf{p})) - T(\mathbf{x}) \right]^2

    Input: Template image T(x)T(\mathbf{x}), input image I(x)I(\mathbf{x}), initial warp parameters p\mathbf{p}, convergence threshold ϵ>0\epsilon > 0
    Output: Converged warp parameters p\mathbf{p}
    repeat
        Warp input image II to compute I(W(x;p))I(\mathbf{W}(\mathbf{x}; \mathbf{p}))
        Compute error image E(x)=T(x)I(W(x;p))E(\mathbf{x}) = T(\mathbf{x}) - I(\mathbf{W}(\mathbf{x}; \mathbf{p}))
        Warp image gradient to template frame I=(Ix,Iy)W(x;p)\nabla I = \left.\left(\frac{\partial I}{\partial x}, \frac{\partial I}{\partial y}\right)\right|_{\mathbf{W}(\mathbf{x}; \mathbf{p})}
        Evaluate warp Jacobian Wp\frac{\partial \mathbf{W}}{\partial \mathbf{p}} at (x;p)(\mathbf{x}; \mathbf{p})
        Compute steepest descent images IWp\nabla I \frac{\partial \mathbf{W}}{\partial \mathbf{p}}
        Compute Hessian matrix H=x[IWp]T[IWp]H = \sum_{\mathbf{x}} \left[\nabla I \frac{\partial \mathbf{W}}{\partial \mathbf{p}}\right]^T \left[\nabla I \frac{\partial \mathbf{W}}{\partial \mathbf{p}}\right]
        Compute steepest descent parameter updates v=x[IWp]TE(x)\mathbf{v} = \sum_{\mathbf{x}} \left[\nabla I \frac{\partial \mathbf{W}}{\partial \mathbf{p}}\right]^T E(\mathbf{x})
        Compute parameter update Δp=H1v\Delta \mathbf{p} = H^{-1} \mathbf{v}
        Update warp parameters pp+Δp\mathbf{p} \leftarrow \mathbf{p} + \Delta \mathbf{p}
    until Δpϵ\|\Delta \mathbf{p}\| \le \epsilon
    return p\mathbf{p}

    Because the gradient I\nabla I is evaluated at the moving coordinates W(x;p)\mathbf{W}(\mathbf{x}; \mathbf{p}) and the Jacobian Wp\frac{\partial \mathbf{W}}{\partial \mathbf{p}} depends on p\mathbf{p}, the Hessian HH must be computed and inverted in every iteration, resulting in a per-iteration cost of O(n2N+n3)O(n^2 N + n^3).

  6. Knowl 6 — Forwards Compositional Image Alignment Algorithm

    algorithm

    The Forwards Compositional algorithm (Shum and Szeliski) updates warp estimates by composing an incremental warp W(x;Δp)\mathbf{W}(\mathbf{x}; \Delta \mathbf{p}) with the current warp W(x;p)\mathbf{W}(\mathbf{x}; \mathbf{p}), solving:

    minΔpx[I(W(W(x;Δp);p))T(x)]2\min_{\Delta \mathbf{p}} \sum_{\mathbf{x}} \left[ I(\mathbf{W}(\mathbf{W}(\mathbf{x}; \Delta \mathbf{p}); \mathbf{p})) - T(\mathbf{x}) \right]^2

    Input: Template image T(x)T(\mathbf{x}), input image I(x)I(\mathbf{x}), initial warp parameters p\mathbf{p}, convergence threshold ϵ>0\epsilon > 0
    Output: Converged warp parameters p\mathbf{p}
    Pre-computation:
    Evaluate warp Jacobian Wp\frac{\partial \mathbf{W}}{\partial \mathbf{p}} at (x;0)(\mathbf{x}; \mathbf{0})
    Iteration:
    repeat
        Warp input image II to compute I(W(x;p))I(\mathbf{W}(\mathbf{x}; \mathbf{p}))
        Compute error image E(x)=T(x)I(W(x;p))E(\mathbf{x}) = T(\mathbf{x}) - I(\mathbf{W}(\mathbf{x}; \mathbf{p}))
        Compute spatial gradient of warped image I(W)=I(W(x;p))x\nabla I(\mathbf{W}) = \frac{\partial I(\mathbf{W}(\mathbf{x}; \mathbf{p}))}{\partial \mathbf{x}}
        Compute steepest descent images I(W)Wp\nabla I(\mathbf{W}) \frac{\partial \mathbf{W}}{\partial \mathbf{p}}
        Compute Hessian matrix H=x[I(W)Wp]T[I(W)Wp]H = \sum_{\mathbf{x}} \left[\nabla I(\mathbf{W}) \frac{\partial \mathbf{W}}{\partial \mathbf{p}}\right]^T \left[\nabla I(\mathbf{W}) \frac{\partial \mathbf{W}}{\partial \mathbf{p}}\right]
        Compute steepest descent parameter updates v=x[I(W)Wp]TE(x)\mathbf{v} = \sum_{\mathbf{x}} \left[\nabla I(\mathbf{W}) \frac{\partial \mathbf{W}}{\partial \mathbf{p}}\right]^T E(\mathbf{x})
        Compute parameter update Δp=H1v\Delta \mathbf{p} = H^{-1} \mathbf{v}
        Update warp W(x;p)W(x;p)W(x;Δp)\mathbf{W}(\mathbf{x}; \mathbf{p}) \leftarrow \mathbf{W}(\mathbf{x}; \mathbf{p}) \circ \mathbf{W}(\mathbf{x}; \Delta \mathbf{p})
    until Δpϵ\|\Delta \mathbf{p}\| \le \epsilon
    return p\mathbf{p}

    The warp Jacobian Wp\frac{\partial \mathbf{W}}{\partial \mathbf{p}} is evaluated at (x;0)(\mathbf{x}; \mathbf{0}) and is precomputed in O(nN)O(nN) time. However, the image gradient I(W)\nabla I(\mathbf{W}) changes at each iteration as p\mathbf{p} changes, requiring the Hessian HH to be formed and inverted every iteration with per-iteration complexity O(n2N+n3)O(n^2 N + n^3).

  7. Knowl 7 — Inverse Additive Image Alignment (Hager-Belhumeur Method)

    model/method

    The Inverse Additive algorithm (Hager and Belhumeur) approximates parameter updates in an additive framework while using the fixed template gradient T\nabla T instead of the moving input gradient I\nabla I. Using the first-order approximation IWxT\nabla I \frac{\partial \mathbf{W}}{\partial \mathbf{x}} \approx \nabla T, the linearized least-squares problem is:

    minΔpx[T(x)+T(Wx)1WpΔpI(W(x;p))]2\min_{\Delta \mathbf{p}} \sum_{\mathbf{x}} \left[ T(\mathbf{x}) + \nabla T \left(\frac{\partial \mathbf{W}}{\partial \mathbf{x}}\right)^{-1} \frac{\partial \mathbf{W}}{\partial \mathbf{p}} \Delta \mathbf{p} - I(\mathbf{W}(\mathbf{x}; \mathbf{p})) \right]^2

    To avoid recomputing the Hessian when p\mathbf{p} changes, the method requires the Jacobian product to factor into template-dependent and parameter-dependent matrices:

    (Wx)1Wp=Γ(x)Σ(p)\left(\frac{\partial \mathbf{W}}{\partial \mathbf{x}}\right)^{-1} \frac{\partial \mathbf{W}}{\partial \mathbf{p}} = \Gamma(\mathbf{x}) \Sigma(\mathbf{p})

    where Γ(x)\Gamma(\mathbf{x}) is a 2×k2 \times k matrix and Σ(p)\Sigma(\mathbf{p}) is a k×nk \times n matrix (with k=nk = n for affine warps). The constant modified Hessian matrix is defined and precomputed as:

    H=x[TΓ(x)]T[TΓ(x)]H_* = \sum_{\mathbf{x}} \left[ \nabla T \Gamma(\mathbf{x}) \right]^T \left[ \nabla T \Gamma(\mathbf{x}) \right]

    In each iteration, the parameter update vector is calculated in two steps:

    Δp=H1x[TΓ(x)]T[I(W(x;p))T(x)]\Delta \mathbf{p}_* = H_*^{-1} \sum_{\mathbf{x}} \left[ \nabla T \Gamma(\mathbf{x}) \right]^T \left[ I(\mathbf{W}(\mathbf{x}; \mathbf{p})) - T(\mathbf{x}) \right]

    ppΣ(p)1Δp\mathbf{p} \leftarrow \mathbf{p} - \Sigma(\mathbf{p})^{-1} \Delta \mathbf{p}_*

    This gives a per-iteration cost of O(nN+kN+k3)O(nN + kN + k^3), but limits the algorithm to the restricted family of warps that satisfy the Jacobian factorization condition (such as 2D translations, similarity, and affine warps).

  8. Knowl 8 — Inverse Compositional Levenberg-Marquardt Algorithm

    algorithm

    The Inverse Compositional Levenberg-Marquardt algorithm augments the Gauss-Newton inverse compositional algorithm with a diagonal damping factor δ>0\delta > 0 to dynamically adjust step size based on whether the alignment error improves.

    Input: Template image T(x)T(\mathbf{x}), input image I(x)I(\mathbf{x}), initial warp parameters p\mathbf{p}, initial damping δ=0.01\delta = 0.01, threshold ϵ>0\epsilon > 0
    Output: Converged warp parameters p\mathbf{p}
    Pre-computation:
    Warp II with initial parameters to compute I(W(x;p))I(\mathbf{W}(\mathbf{x}; \mathbf{p}))
    Compute initial error e=x[I(W(x;p))T(x)]2e = \sum_{\mathbf{x}} [I(\mathbf{W}(\mathbf{x}; \mathbf{p})) - T(\mathbf{x})]^2
    Evaluate template gradient T(x)\nabla T(\mathbf{x})
    Evaluate warp Jacobian Wp\frac{\partial \mathbf{W}}{\partial \mathbf{p}} at (x;0)(\mathbf{x}; \mathbf{0})
    Compute steepest descent images TWp\nabla T \frac{\partial \mathbf{W}}{\partial \mathbf{p}}
    Compute Gauss-Newton Hessian H=x[TWp]T[TWp]H = \sum_{\mathbf{x}} \left[\nabla T \frac{\partial \mathbf{W}}{\partial \mathbf{p}}\right]^T \left[\nabla T \frac{\partial \mathbf{W}}{\partial \mathbf{p}}\right]
    Iteration:
    repeat
        Compute parameter updates v=x[TWp]T[I(W(x;p))T(x)]\mathbf{v} = \sum_{\mathbf{x}} \left[\nabla T \frac{\partial \mathbf{W}}{\partial \mathbf{p}}\right]^T [I(\mathbf{W}(\mathbf{x}; \mathbf{p})) - T(\mathbf{x})]
        Form Levenberg-Marquardt Hessian HLM=H+δxdiag((TWp1)2,,(TWpn)2)H_{LM} = H + \delta \sum_{\mathbf{x}} \operatorname{diag}\left(\left(\nabla T \frac{\partial \mathbf{W}}{\partial p_1}\right)^2, \dots, \left(\nabla T \frac{\partial \mathbf{W}}{\partial p_n}\right)^2\right)
        Compute Δp=HLM1v\Delta \mathbf{p} = -H_{LM}^{-1} \mathbf{v}
        Tentatively update warp Wtent(x)=W(x;p)W(x;Δp)1\mathbf{W}_{tent}(\mathbf{x}) = \mathbf{W}(\mathbf{x}; \mathbf{p}) \circ \mathbf{W}(\mathbf{x}; \Delta \mathbf{p})^{-1}
        Warp image II with Wtent\mathbf{W}_{tent} and evaluate tentative error etent=x[I(Wtent(x))T(x)]2e_{tent} = \sum_{\mathbf{x}} [I(\mathbf{W}_{tent}(\mathbf{x})) - T(\mathbf{x})]^2
        if etent<ee_{tent} < e then
            W(x;p)Wtent(x)\mathbf{W}(\mathbf{x}; \mathbf{p}) \leftarrow \mathbf{W}_{tent}(\mathbf{x})
            eetente \leftarrow e_{tent}
            δδ/10\delta \leftarrow \delta / 10
        else
            δδ×10\delta \leftarrow \delta \times 10
    until Δpϵ\|\Delta \mathbf{p}\| \le \epsilon
    return p\mathbf{p}

    The algorithm retains the asymptotic per-iteration complexity of O(nN+n3)O(nN + n^3) while interpolating between Gauss-Newton (when δ1\delta \ll 1) and scaled steepest descent (when δ1\delta \gg 1).

  9. Knowl 9 — Second-Order Newton Approximation in Inverse Compositional Image Alignment

    model/method

    The full Newton Inverse Compositional algorithm uses a second-order Taylor series expansion of G(x;Δp)=12[T(W(x;Δp))I(W(x;p))]2G(\mathbf{x}; \Delta \mathbf{p}) = \frac{1}{2} [T(\mathbf{W}(\mathbf{x}; \Delta \mathbf{p})) - I(\mathbf{W}(\mathbf{x}; \mathbf{p}))]^2 with respect to Δp\Delta \mathbf{p}. Evaluated at Δp=0\Delta \mathbf{p} = \mathbf{0}, the exact Newton Hessian is:

    2Gp2=([Wp]T2Tx2[Wp]+T[2Wp2])[T(x)I(W(x;p))]+[TWp]T[TWp]\frac{\partial^2 G}{\partial \mathbf{p}^2} = \left( \left[ \frac{\partial \mathbf{W}}{\partial \mathbf{p}} \right]^T \frac{\partial^2 T}{\partial \mathbf{x}^2} \left[ \frac{\partial \mathbf{W}}{\partial \mathbf{p}} \right] + \nabla T \left[ \frac{\partial^2 \mathbf{W}}{\partial \mathbf{p}^2} \right] \right) \left[ T(\mathbf{x}) - I(\mathbf{W}(\mathbf{x}; \mathbf{p})) \right] + \left[ \nabla T \frac{\partial \mathbf{W}}{\partial \mathbf{p}} \right]^T \left[ \nabla T \frac{\partial \mathbf{W}}{\partial \mathbf{p}} \right]

    where 2Tx2=(2Tx22Txy2Txy2Ty2)\frac{\partial^2 T}{\partial \mathbf{x}^2} = \begin{pmatrix} \frac{\partial^2 T}{\partial x^2} & \frac{\partial^2 T}{\partial x \partial y} \\ \frac{\partial^2 T}{\partial x \partial y} & \frac{\partial^2 T}{\partial y^2} \end{pmatrix} is the 2×22 \times 2 spatial Hessian of template image TT, and 2Wp2\frac{\partial^2 \mathbf{W}}{\partial \mathbf{p}^2} is the second derivative tensor of the warp function.

    Because the first term contains the error image T(x)I(W(x;p))T(\mathbf{x}) - I(\mathbf{W}(\mathbf{x}; \mathbf{p})), which depends on the current parameter vector p\mathbf{p}, the full Newton Hessian cannot be precomputed. It must be recomputed in every iteration, raising the per-iteration complexity to O(n2N+n3)O(n^2 N + n^3). In addition, the numerical noise introduced when estimating second spatial derivatives on real template images degrades empirical convergence compared to the first-order Gauss-Newton Hessian.

  10. Knowl 10 — Empirical Performance of Gradient Descent Approximations in Image Alignment

    empirical result

    Comparing six gradient descent approximations (Gauss-Newton, Newton, Steepest Descent, Gauss-Newton Diagonal Hessian, Newton Diagonal Hessian, and Levenberg-Marquardt) on affine warps over 5000 random trials reveals substantial performance disparities:

    1. Convergence Rate and Frequency: Gauss-Newton and Levenberg-Marquardt achieve the highest frequency of convergence (>90% for initial canonical point perturbations 4.0\le 4.0 pixels) and fastest convergence speed (converging in 5 to 15 iterations). Levenberg-Marquardt provides no empirical advantage over Gauss-Newton in rate or frequency of convergence.
    2. Newton Approximation: The full Newton algorithm converges significantly slower than Gauss-Newton and fails to converge more often, because image noise amplified during second-derivative calculation overwhelms the theoretical benefits of the second-order model.
    3. Steepest Descent and Diagonal Hessian: Steepest descent and diagonal Hessian approximations perform poorly when used with naive parameterizations, frequently oscillating or diverging due to poor step-size selection.
    4. Sensitivity to Parameterization and Step-Size: Incorporating an explicit Gauss-Newton step-size estimation into diagonal approximations substantially improves convergence. Furthermore, switching from standard affine matrix parameters to a canonical point coordinate parameterization dramatically improves steepest descent and diagonal Hessian methods, whereas Gauss-Newton is essentially invariant to such linear re-parameterizations.
  11. Knowl 11 — Sensitivity of Forwards and Inverse Image Alignment to Image and Template Noise

    empirical result

    When additive white Gaussian intensity noise (standard deviation σ=8.0\sigma = 8.0 gray levels) is introduced into the image data, the exact equivalence between forwards and inverse algorithms breaks down because the theoretical assumption T(x)I(W(x;p))T(\mathbf{x}) \approx I(\mathbf{W}(\mathbf{x}; \mathbf{p})) is perturbed by noise:

    1. Noise on the Input Image II only: The inverse algorithms (Inverse Additive and Inverse Compositional) converge faster and with higher frequency than the forwards algorithms, because inverse methods compute spatial derivatives on the clean template TT rather than the noisy input image II.
    2. Noise on the Template TT only: The forwards algorithms (Forwards Additive and Forwards Compositional) outperform the inverse algorithms, because forwards methods compute image derivatives on the clean input image II.
    3. Equal Noise on both II and TT: The forwards algorithms perform marginally better than the inverse algorithms due to higher-order Taylor series truncation error in the inverse formulation.

    When the template TT is constructed offline by averaging across multiple aligned images (as in face modeling and active appearance models), the template has a much higher signal-to-noise ratio than the incoming video frames II, making inverse compositional alignment more noise-robust in addition to being faster.

  12. Knowl 12 — Warp Jacobian, Composition, and Inversion for Planar Homographies in Inverse Compositional Alignment

    equation

    A planar homography is parameterized by 8 parameters p=(p1,p2,p3,p4,p5,p6,p7,p8)T\mathbf{p} = (p_1, p_2, p_3, p_4, p_5, p_6, p_7, p_8)^T mapping template coordinates x=(x,y)T\mathbf{x} = (x, y)^T to:

    W(x;p)=11+p7x+p8y((1+p1)x+p3y+p5p2x+(1+p4)y+p6)\mathbf{W}(\mathbf{x}; \mathbf{p}) = \frac{1}{1 + p_7 x + p_8 y} \begin{pmatrix} (1 + p_1)x + p_3 y + p_5 \\ p_2 x + (1 + p_4)y + p_6 \end{pmatrix}

    The 2×82 \times 8 warp Jacobian evaluated at p=0\mathbf{p} = \mathbf{0} is:

    Wp(x;0)=(x0y010x2xy0x0y01xyy2)\left.\frac{\partial \mathbf{W}}{\partial \mathbf{p}}\right|_{(\mathbf{x}; \mathbf{0})} = \begin{pmatrix} x & 0 & y & 0 & 1 & 0 & -x^2 & -xy \\ 0 & x & 0 & y & 0 & 1 & -xy & -y^2 \end{pmatrix}

    The composition of current parameters p\mathbf{p} with incremental parameters Δp\Delta \mathbf{p} yields warp parameters p\mathbf{p}' for W(x;p)=W(x;p)W(x;Δp)\mathbf{W}(\mathbf{x}; \mathbf{p}') = \mathbf{W}(\mathbf{x}; \mathbf{p}) \circ \mathbf{W}(\mathbf{x}; \Delta \mathbf{p}) with normalizer K=1+p7Δp5+p8Δp6K = 1 + p_7 \Delta p_5 + p_8 \Delta p_6 given by:

    p=1K(p1+Δp1+p1Δp1+p3Δp2+p5Δp7p7Δp5p8Δp6p2+Δp2+p2Δp1+p4Δp2+p6Δp7p3+Δp3+p1Δp3+p3Δp4+p5Δp8p4+Δp4+p2Δp3+p4Δp4+p6Δp8p7Δp5p8Δp6p5+Δp5+p1Δp5+p3Δp6p6+Δp6+p2Δp5+p4Δp6p7+Δp7+p7Δp1+p8Δp2p8+Δp8+p7Δp3+p8Δp4)\mathbf{p}' = \frac{1}{K} \begin{pmatrix} p_1 + \Delta p_1 + p_1 \Delta p_1 + p_3 \Delta p_2 + p_5 \Delta p_7 - p_7 \Delta p_5 - p_8 \Delta p_6 \\ p_2 + \Delta p_2 + p_2 \Delta p_1 + p_4 \Delta p_2 + p_6 \Delta p_7 \\ p_3 + \Delta p_3 + p_1 \Delta p_3 + p_3 \Delta p_4 + p_5 \Delta p_8 \\ p_4 + \Delta p_4 + p_2 \Delta p_3 + p_4 \Delta p_4 + p_6 \Delta p_8 - p_7 \Delta p_5 - p_8 \Delta p_6 \\ p_5 + \Delta p_5 + p_1 \Delta p_5 + p_3 \Delta p_6 \\ p_6 + \Delta p_6 + p_2 \Delta p_5 + p_4 \Delta p_6 \\ p_7 + \Delta p_7 + p_7 \Delta p_1 + p_8 \Delta p_2 \\ p_8 + \Delta p_8 + p_7 \Delta p_3 + p_8 \Delta p_4 \end{pmatrix}

    The inverse warp W(x;p)1\mathbf{W}(\mathbf{x}; \mathbf{p})^{-1} is parameterized by pinv=1det[(1+p1)(1+p4)p2p3]u\mathbf{p}_{inv} = \frac{1}{\det \cdot [(1 + p_1)(1 + p_4) - p_2 p_3]} \mathbf{u}, where det=det(1+p1p3p5p21+p4p6p7p81)\det = \det\begin{pmatrix} 1 + p_1 & p_3 & p_5 \\ p_2 & 1 + p_4 & p_6 \\ p_7 & p_8 & 1 \end{pmatrix} and:

    u=(1+p4p6p8det[(1+p1)(1+p4)p2p3]p2+p6p7p3+p5p81+p1p5p7det[(1+p1)(1+p4)p2p3]p5p4p5+p3p6p6p1p6+p2p5p7p4p7+p2p8p8p1p8+p3p7)\mathbf{u} = \begin{pmatrix} 1 + p_4 - p_6 p_8 - \det \cdot [(1 + p_1)(1 + p_4) - p_2 p_3] \\ -p_2 + p_6 p_7 \\ -p_3 + p_5 p_8 \\ 1 + p_1 - p_5 p_7 - \det \cdot [(1 + p_1)(1 + p_4) - p_2 p_3] \\ -p_5 - p_4 p_5 + p_3 p_6 \\ -p_6 - p_1 p_6 + p_2 p_5 \\ -p_7 - p_4 p_7 + p_2 p_8 \\ -p_8 - p_1 p_8 + p_3 p_7 \end{pmatrix}

Coverage note — Omitted material includes intermediate algebraic derivations of Taylor series expansions, the 2nd-derivative tensor formulas for homography Newton Hessians, and forward-looking discussions of planned companion papers (appearance models, prior distributions, robust error norms, and multi-scale pyramids).

References

  1. 1.Baker, S. and Kanade, T. 2000. Limits on super-resolution and how to break them. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 372–379.
  2. 2.Baker, S. and Matthews, I. 2001. Equivalence and efficiency of image alignment algorithms. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, vol. 1, pp. 1090–1097.
  3. 3.Baker, S. and Matthews, I. 2002. Lucas-kande 20 years on: A unifying framework: Part 1. Technical Report CMU-RI-TR-02-16, Carnegie Mellon University Robotics Institute.
  4. 4.Bergen, J.R., Anandan, P., Hanna, K.J., and Hingorani, R. 1992. Hierarchical model-based motion estimation. In Proceedings of the European Conference on Computer Vision, pp. 237–252.
  5. 5.Black, M. and Jepson, A. 1998. Eigen-tracking: Robust matching and tracking of articulated objects using a view-based representation. International Journal of Computer Vision, 36(2):101–130.
  6. 6.La Cascia, M., Sclaroff, S., and Athitsos, V. 2000. Fast, reliable head tracking under varying illumination: An approach based on registration of texture-mapped 3D models. IEEE Transactions on Pattern Analysis and Machine Intelligence, 22(6):322–336.
  7. 7.Christensen, G.E. and Johnson, H.J. 2001. Image consistent registration. IEEE Transactions on Medical Imaging, 20(7):568–582.
  8. 8.Cootes, T.F., Edwards, G.J., and Taylor, C.J. 1998. Active appearance models. In Proceedings of the European Conference on Computer Vision, vol. 2, pp. 484–498.
  9. 9.Dellaert, F. and Collins, R. 1999. Fast image-based tracking by selective pixel integration. In Proceedings of the ICCV Workshop on Frame-Rate Vision, pp. 1–22.
  10. 10.Gill, P.E., Murray, W., and Wright, M.H. 1986. Practical Optimization. Academic Press.
  11. 11.Gleicher, M. 1997. Projective registration with difference decomposition. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 331–337.
  12. 12.Hager, G.D. and Belhumeur, P.N. 1998. Efficient region tracking with parametric models of geometry and illumination. IEEE Transactions on Pattern Analysis and Machine Intelligence, 20(10):1025–1039.
  13. 13.Lucas, B. and Kanade, T. 1981. An iterative image registration technique with an application to stereo vision. In Proceedings of the International Joint Conference on Artificial Intelligence, pp. 674–679.
  14. 14.Press, W.H., Flannery, B.P., Teukolsky, S.A., and Vetterling, W.T. 1992. Numerical Recipes in C: The Art of Scientific Computing, 2nd edn., Cambridge University Press.
  15. 15.Sclaroff, S. and Isidoro, J. 1998. Active blobs. In Proceedings of the 6th IEEE International Conference on Computer Vision, pp. 1146–1153.
  16. 16.Shum, H.-Y. and Szeliski, R. 2000. Construction of panoramic image mosaics with global and local alignment. International Journal of Computer Vision, 16(1):63–84.
  17. 17.Szeliski, R. and Golland, P. 1998. Stereo matching with transparency and matting. In Proceedings of the 6th IEEE International Conference on Computer Vision, pp. 517–524.

Citation

MLA
Baker, S., and I. Matthews. “Lucas-Kanade 20 Years On: A Unifying Framework”. International Journal of Computer Vision, vol. 56, no. 3, 2004, pp. 221–55, https://doi.org/10.1023/B:VISI.0000011205.11775.fd.
APA
Baker, S., & Matthews, I. (2004). Lucas-Kanade 20 Years On: A Unifying Framework. International Journal of Computer Vision, 56(3), 221–255. https://doi.org/10.1023/B:VISI.0000011205.11775.fd
Chicago
Baker, S., and I. Matthews. 2004. “Lucas-Kanade 20 Years On: A Unifying Framework”. International Journal of Computer Vision 56 (3): 221–55. https://doi.org/10.1023/B:VISI.0000011205.11775.fd.
Harvard
Baker, S. and Matthews, I. (2004) “Lucas-Kanade 20 Years On: A Unifying Framework”, International Journal of Computer Vision, 56(3), pp. 221–255. Available at: https://doi.org/10.1023/B:VISI.0000011205.11775.fd.
Vancouver
1. Baker S, Matthews I (2004) Lucas-Kanade 20 Years On: A Unifying Framework. International Journal of Computer Vision 56:221–255

BibTeX

@article{Baker_2004, title={Lucas-Kanade 20 Years On: A Unifying Framework}, volume={56}, ISSN={1573-1405}, url={http://dx.doi.org/10.1023/B:VISI.0000011205.11775.fd}, DOI={10.1023/b:visi.0000011205.11775.fd}, number={3}, journal={International Journal of Computer Vision}, publisher={Springer Science and Business Media LLC}, author={Baker, Simon and Matthews, Iain}, year={2004}, month=Feb, pages={221–255} }
Metadata:Crossref

Access the Paper

This paper is available from its original source. Click below to access the PDF.

Open PDF