Image Alignment with Least Squares

We look for a rotation/transform matrix A ∈ ℝ2×2 and a translation b ∈ ℝ2 so that y(k) ≈ A x(k) + b for the marked point pairs. "Run" fits (Â, b̂) minimizing ∑k ‖ y(k) − (A x(k) + b) ‖22 using the method selected below: the normal equation (exact) or gradient descent (iterative).

 | 

Source (click)

Click to add a marker x(k)
Resize: 100%

Target (drag and rotate)

y(k) = A x(k) + b
30°

Fitted Image

(k) = Â x(k) + b̂
(click "Run")

Pixel-wise Difference

|ŷ(k) − y(k)|.
mean |Δpx|: —