Quiz: from matches to a transform
Before this unit: Matching descriptors: nearest, ratio and mutual (previous unit); Day 2: Edges, blobs and ridges.
See also: Hypothesise and verify: RANSAC (day 21); Day 21: Hough transform; Day 23: FFT registration; Day 20: Point detection.
Short questions to test your understanding. Try each on paper first, then open the answer.
Q1. How many numbers and how many point pairs does each model need: translation, rigid, similarity, affine, homography?
Each pair gives two equations.
Translation 2 numbers, 1 pair; rigid 3, 2; similarity 4, 2; affine 6, 3; homography 8, 4.
Q2. Why not always fit a homography, since it contains all the simpler models?
Noise, samples, extrapolation.
Extra freedom fits noise as well as signal, and extrapolates badly outside the matched area; RANSAC needs 4 pairs per sample, so many more iterations at the same inlier fraction (567 instead of 49 for a similarity at w = 0.3). Choose the simplest model the physics allows.
Q3. Why does least squares on all matches fail, even when 80 % of them are correct?
How much does one squared residual of 100 px weigh?
Least squares minimises the sum of squared residuals, so a single wrong match far away contributes as much as hundreds of good ones and pulls the transform towards it. RANSAC instead counts how many matches agree, so wrong ones simply do not count.
Q4. The inlier fraction is 0.5. How many RANSAC iterations does a similarity need for 99 % success, and a homography?
N = \log(1 - p)/\log(1 - w^s).
Similarity (s = 2): \log 0.01/\log 0.75 = 16.0 → 17. Homography (s = 4): \log 0.01/\log(1 - 0.0625) = 71.4 → 72.
Q5. RANSAC returns a transform with 6 inliers out of 300 matches. What do you report?
How many inliers would a random transform get?
“No reliable alignment.” Six agreeing matches out of 300 can happen by chance (and a homography is fixed by 4); a real alignment of textured images gives tens to hundreds of inliers. Report the count and the residual; never silently use such a result.
Q6. Why does chaining pairwise transforms along a row of tiles drift, and what fixes it?
Small errors, multiplied.
Each pairwise estimate has a small error, and the chain composes them: a rotation error of 0.2° per pair becomes about 0.6° after three steps, which is tens of pixels at the far end of a mosaic. A global least squares over all overlapping pairs (including diagonal ones) uses the redundant measurements and spreads the errors.
Q7. Two photographs of a plant are taken from different positions. Why does no 2D transform align them?
Near and far leaves.
Parallax: points at different depths move by different amounts between the views, so no single map of the plane fits all matches. The matches obey epipolar geometry instead (fundamental matrix, two-view unit). Only a flat scene or a camera turning about its centre gives a homography.
Q8. (math) Derive N = \log(1 - p)/\log(1 - w^s).
Probability that all N samples contain an outlier.
A sample of s pairs is all inliers with probability w^s; it fails with 1 - w^s; all N independent samples fail with (1 - w^s)^N. Require 1 - (1 - w^s)^N \ge p, i.e. N\log(1 - w^s) \le \log(1 - p); dividing by the negative \log(1 - w^s) gives N \ge \log(1 - p)/\log(1 - w^s).