The theory parts of the assignments, with solutions. They practice exactly the derivations the exam hints point to: SVD for homogeneous least squares, projecting onto a rotation matrix, and the epipolar constraint.
Why these matter
The tutor called epipolar geometry a βpopular exam topicβ. The recipe βsolve with SVD, then fix the constraints with a second SVDβ appears in pose estimation (here), in the 8-point algorithm, in triangulation and in Procrustes.
Assignment 1
Programming part: look_at (rotate the camera towards an object), perspective and orthographic projection, camera pose estimation. Related: Lecture 2.1, Lecture 2.2.
Exercise 1: 3D Transformations
In homogeneous coordinates, a projective 3D transformation is an invertible matrix . There is a hierarchy, each level less restrictive:
| Type | Matrix | Preserves | DoF |
|---|---|---|---|
| Rigid | lengths | 6 | |
| Similarity | angles | 7 | |
| Affine | parallelism | 12 | |
| Projective | straight lines | 15 |
, , , .
Affine = rotation + scaling + rotation + translation
From the SVD : an affine map is a rotation (or mirroring), a non-uniform scaling, another rotation (or mirroring) and a translation. Shearing is affine too.
The key step for (a). For and points with 4th coordinate 1, the translation cancels in the difference:
So every question reduces to the linear part.
(a) i) Rigid transformations preserve lengths
, because a rotation does not change the norm: .
(a) ii) Similarity transformations preserve angles
The cancels. A rotation preserves the inner product, , so the angle equals .
(a) iii) Affine transformations preserve parallelism
If , then for some . By linearity of :
So the images are parallel again.
(a) iv) Projective transformations preserve straight lines (bonus)
Not in the handed-in solution; a short argument. The points of a line are, in homogeneous coordinates, the linear combinations of two points. is linear, so : again the linear combinations of two homogeneous points, i.e. a line. The division by the last coordinate changes where on the line a point lands, but not that it is on the line.
(b) Length ratios under affine maps
i) Parallel segments: from (a) iii), , so the ratio of the lengths is preserved.
ii) Counterexample for non-parallel segments: non-uniform stretch , , segments from the origin to and to . Before: ratio 1. After: lengths 2 and 1, ratio 2.
(c) Degrees of freedom
- Rigid: 6. 3 for (e.g. axis-angle: 2 for the axis, 1 for the angle) + 3 for .
- Similarity: 7. Rigid + 1 for the scale.
- Affine: 12. 9 for + 3 for .
- Projective: 15. 16 entries minus 1, because and give the same transformation in homogeneous coordinates ().
Exercise 2: Camera Pose from 3D-2D Correspondences
Usually we know and 3D points and compute the image points . Here it is the other way around: given pairs , recover and . This is the Direct Linear Transform (DLT). Assume :
(a) From a known to the calibrated case
maps camera coordinates to pixels, so apply its inverse: (in homogeneous coordinates).
(b) One correspondence β linear equations
Write the with an unknown scale : . Three rows:
Substitute the third into the first two and move everything to one side:
(c) How many correspondences?
2 equations per correspondence, 12 unknowns β at least 6 correspondences. (Strictly 11 would do because of the free scale, i.e. 5.5 pairs.)
(d) Least squares with SVD
Why: is orthogonal, so . With (still ) the objective is . It is smallest when all weight is on the smallest singular value: , so = the last column of .
(e) Recover and from
has unit norm and a free sign, so is not a rotation: , .
- Reshape into .
- Fix the sign: if , multiply the whole by . (DLT only knows up to scale, so this is allowed. It keeps consistent with .)
- Fix the scale: the columns of a rotation have norm 1, so estimate and set , .
- Project onto the nearest rotation with a second SVD: , (drop ).
The determinant trick
Many groups (including the handed-in solution) forced with . The tutorial called this the βwrongβ way here: it flips one axis of but leaves with the wrong sign. In DLT we have the extra freedom of flipping the sign of the whole , and we should use it (step 2).
(f) Camera-to-world rotation and camera position
Assignment 2
Programming part: 8-point algorithm and relative pose, triangulation, image rectification and view morphing, stereo matching with cost functions and later a Siamese CNN, depth from disparity, linear triangulation and a simple bundle adjustment (fixed cameras). Related: Lecture 3, Lecture 4.
Exercise 1: Epipolar Geometry Conventions
Two cameras , ; is aligned with the world frame.
| Lecture | Hartley-Zisserman | |
|---|---|---|
| maps vectors from camera 1βs frame to camera 0βs frame | = rotation of camera 1βs extrinsics | |
| position of camera 1 in world (= camera 0) frame | = translation of camera 1βs extrinsics | |
| Cameras | , | |
| Constraint | (note: and swapped) |
Relation: , .
(a) Show
With and the hint :
using and that is skew-symmetric, .
(b) Derive the pose theorem for the lecture convention
Theorem (Hartley-Zisserman): for : , or .
Goal (lecture): for : , or .
Step 1, identify and . , so and .
Step 2, rotation. :
The two cases swap, but the set of candidates is the same.
Step 3, translation direction. is the left singular vector of the zero singular value: . With and invertible: . Transposing, , so : .
Step 4, length. and give , so . Hence and .
Intuition
Both conventions describe the same geometry. One uses where camera 1 is (, ), the other how to transform points into camera 1 (, ). The only visible difference is a transpose of and swapped roles of and . See Notation.