Motivation
Suppose two images contain recognizable points, such as the corners of a calibration target. Even when their intensities differ, corresponding point locations can suggest how one image should be aligned with the other. We will fit a translation, a rotation and one common scale. This is a similarity transform: it preserves angles and ratios of distances when the scale is positive. It cannot express shear or perspective distortion. Choosing a model is therefore already a claim about which geometric changes are plausible.
The correspondences are assumed given here. A wrong pair can seriously distort a least-squares fit, and a small residual on a few landmarks does not certify that the remaining image is aligned. The calculation below solves the stated finite problem globally; it does not solve the matching problem.
Definitions
Let be corresponding source and target landmarks, with fixed weights and . The objective is
Here vectors are columns. The group consists of real matrices satisfying and ; reflections are excluded. Allowing makes the feasible set include a collapsed configuration. If the physical model requires an invertible transformation, the requirement is instead , and the minimum need not then be attained.
Define weighted centroids and , and centered points , . Put
The sign of follows the convention . Reversing the mapping direction reverses the estimated rotation in the exact invertible case.
Theorem/proposition
Theorem 3.2.1
(Global weighted similarity fit)
Assume and set . If , the unique optimum for is
If , every rotation with and is optimal and . Under the stricter condition , this latter case has infimum but no minimizer. If , all positive-weight source landmarks coincide: translation can absorb any , so neither rotation nor scale is identifiable from these data.
Proof sketch or proof idea
Proof
(Centering, then a one-dimensional scale problem)
For fixed , write . Since the weighted sums of and vanish, the cross term disappears after summation. Consequently
The second term has the unique minimizing translation . Rotation preserves lengths, and , so expanding the remaining squares gives
For each , Cauchy–Schwarz bounds the last parenthesis above by ; equality, when , requires . Thus the global problem reduces to minimizing over . Completing the square, , which proves the formula and uniqueness when . If , is uniquely minimized in scale at zero, where the rotation disappears from the transform. When , every of positive weight vanishes, so the centered residual is for every scale and rotation; the stated translation achieves it. These arguments include all admissible rotations, not just a neighborhood of an initial guess.
Proof X-ray
Three exact eliminations
The proof removes the unknowns one at a time, and each removal is exact. First the translation: the weighted centroid identity makes the translation term orthogonal, in the weighted sum of squares, to every centered residual. The centroids must use the same weights as the objective; with unweighted centroids and unequal weights the cross term survives. Second the rotation: for fixed the objective is affine in the unit vector , so Cauchy–Schwarz finds the global maximizer on the whole circle, not a local one. Restricting to is what fixes the sign of ; admitting reflections would give a second candidate with its own correlations. Third the scale: a one-variable quadratic whose vertex is automatically feasible, because . The hypothesis is used only here, to make that quadratic strictly convex.
The argument also shows its limits. Changing the weights based on the residual after fitting changes the objective, so this one-shot proof does not prove convergence of an iteratively reweighted method.
Worked examples
Worked example 3.2.2
(A quarter-turn, enlargement, and shift)
Take equal weights and source points , paired respectively with target points . Their centroids are and . Direct substitution gives , , and . Hence , , and is the counterclockwise quarter-turn. The translation is . Substitution into all three original pairs verifies zero residual; the minimum formula also gives .
Worked example 3.2.3
(A stretch the model cannot express)
Give equal unit weights to the source points and the targets : the horizontal axis is doubled and the vertical one kept. Both centroids are , so and . Then , , and every term of vanishes, so . Hence , , , , and .
Direct check: the fitted points are and , with squared errors at each of the four landmarks, total . The fitted scale lies between the two true axis scales, and the error is shared evenly. A residual of this kind signals a model mismatch, not noise; Cauchy–Schwarz confirms .
Worked example 3.2.4
(A collapse has no positive-scale minimizer)
Give equal weight to source points and target points both equal to . Then , . The best nonnegative-scale fit collapses both source points to the target with and ; its rotation is arbitrary. If is required, the residual is , which approaches zero as but is always positive. Reporting a unique angle or an attained positive-scale solution would invent information.
Counterexample mode
A reflection cannot be repaired by rotation
Use the source triangle and reflected targets . Here , , , so the best orientation-preserving similarity has and residual . The reflection itself fits perfectly, but has determinant and is not in . A solver that silently permits reflections solves a different registration problem.
Common mistakes
Two misreadings of the formula are common in practice.
Common mistake
(Reading as a certificate of a good fit)
A nonzero only means that the positively weighted source points are not all identical. It does not ensure , correct correspondences, a good fit, or robust extrapolation. A large weight expresses greater influence in the objective; it is not automatically a probability or a proven measure of precision. Weights depending on target coordinates can also affect the statistical interpretation.
Common mistake
(Trusting least squares with a mismatched pair)
Least squares squares the effect of a large mismatch. For example, in a one-dimensional translation-only fit the offsets yield mean offset , although two offsets are zero. Inspect residuals and correspondences, and consider a separately specified robust estimator when outliers are plausible. The formula above is an exact solution of the weighted squared-error problem, not a guarantee against mismatched landmarks.
Both mistakes confuse a property of the computation with a property of the images.
Concept lensGeometric
Alignment and identifiability are separate questions
A computed transform can be unique yet fit the observed correspondences poorly. Conversely, collapsed or coincident points can give a small residual while leaving parameters undetermined. Evaluate both the residual in the original coordinate units and the geometry of the landmarks; neither number alone proves correct image alignment.
Summary
Weighted centering eliminates translation exactly. The two scalar correlations determine the rotation, and their magnitude relative to source spread gives the optimal scale. The global formula requires fixed correspondences and weights, an orientation-preserving similarity model, and the stated handling of zero scale. Its assumptions and residual must be checked against the actual imaging task.
Exercises
Exercise 3.2.5
(Source points have equal weights and correspond to . Find the optimal and minimum residual.)
Foundation
Solution(3)
- 1
Center the data
The centroids are and , so and .
- 2
Compute the correlations
, , , so .
- 3
Read off the transform
, and . Both landmarks map exactly, so the residual is zero.
Exercise 3.2.6
(Source points correspond to with equal weights. Compute and determine the mapping. What happens to the estimated angle if the target order is swapped?)
Foundation
Solution(3)
- 1
Compute the correlations
The centroids vanish. ; because each is perpendicular to its ; ; so .
- 2
Read off the transform
, , : the counterclockwise quarter-turn.
- 3
Swap the targets
Swapping the target order changes to and gives the clockwise quarter-turn. Correspondence order is part of the data.
Exercise 3.2.7
(All positive-weight source points equal ; targets are and with equal weights. Find the minimum error and exhibit two distinct optimal parameter triples.)
Core
Solution(3)
- 1
Compute the target spread
The target centroid is and .
- 2
Use the degenerate case
Key step
The minimum is , attained whenever the common source point is sent to .
Because: , so the centered residual equals for every and .
- 3
Exhibit two optima
and both map to . Neither scale nor rotation is identifiable.
Exercise 3.2.8
(For fixed centered landmarks suppose , , , . Find the optimum and residual. Can the residual be negative for genuine landmark data?)
Core
Solution(3)
- 1
Compute the optimum
, , , , and .
- 2
Compute the residual
.
- 3
Sign of the residual
It cannot be negative: it is a sum of weighted squares. Equivalently, Cauchy–Schwarz gives for actual landmarks, here ; arbitrary scalars violating this inequality do not describe such data.