HW2: Single-view Reconstruction

Katerina Nikiforova | knikifor

Q1: Camera Matrix P from 2D-3D Correspondences

(a) Stanford Bunny

Q1a: Stanford Bunny Result

(b) Cuboid

Q1b: Cuboid Result

Q2: Camera Calibration K from Annotations

(a) Vanishing Points

Computed Calibration Matrix K:

        [[1.15417802e+03 0.00000000e+00 5.75066005e+02]
         [0.00000000e+00 1.15417802e+03 4.31939090e+02]
         [0.00000000e+00 0.00000000e+00 1.00000000e+00]]
        
Q2a: Vanishing Points Q2a: Vanishing Points

The algorithm is as follows:
1. Compute vanishing points from pairs of parallel lines l1 and l2 by finding their intersection at l1 x l2
2. Using 3 such points, create a constraint matrix A representing

d1^T w d2 = Aw = 0
for orthogonal directions
- Enforce constraints that f1=f2 in w and s=0 by formatting constraints with only 4 unknowns:
[x1*x2+y1*y2, z1*x2+x1*z2, z1*y2+y1*z2, z1*z2]
3. Solve for w using SVD 4. Use Cholesky composition to obtain K^-1, and invert to get K.

(b) Metric Planes

Computed Calibration Matrix \( K \):

        [[4.14317649e+03 8.83843584e+02 5.66086890e+02]
         [0.00000000e+00 1.28857021e+03 3.10005832e+02]
         [0.00000000e+00 0.00000000e+00 1.00000000e+00]]
        

Angles Between Planes:

Plane Pair Angle (degrees)
Plane 1 & Plane 2 89.92
Plane 1 & Plane 3 89.92
Plane 2 & Plane 3 89.73
Q2b: Square 2

The algorithm is as follows:
1. Compute homography for imaged plane using four labeled pixel annotations and PNP w.r.t. coordinate system defined for plane.
2. Using 3 such homographies, create two constraints in matrix A where each H = [h1 | h2 | h3]
- The constraints will represent each plane's imaged circular points, which lie on the absolute conic. The constraints are

h1^T w h2 = A[2i]w = 0
for each plane, as well as
h1^T w h1 - h2^T w h2 = A[2i+1]w = 0

3. Solve for w using SVD, this time with no constraints on the intrinsics, and reshape the 6 variables to obtain a full positive-definite 3x3 matrix
4. Use Cholesky composition to obtain K^-1, and invert to get K