Q1: Camera matrix P from 2D-3D correspondences

(a) Stanford Bunny

  1. Computed P matrix:
[[ 6.12468612e-01 -2.80769806e-01  1.09185025e-01  2.12092927e-01]
 [-8.90197009e-02 -6.43243106e-01  1.93261536e-01  1.73520830e-01]
 [ 5.51654830e-05 -1.35588807e-04 -7.00171505e-05  9.52266452e-05]]
  1. Table of Surface points and Bounding Box line plots
Surface Points Bounding Box
  1. Method:

(b) Cuboid

  1. Computed P matrix
[[ 5.13165835e-03  7.24544382e-04 -1.12942559e-03  6.74930025e-01]
 [-1.93022997e-04  5.00213348e-04 -4.55849392e-03  7.37848188e-01]
 [ 8.61715030e-07 -9.99251293e-07 -6.38565796e-07  5.58604817e-04]]
  1. Table of image, points annotated, and lines projected.
Input Image Annotated 2D points Example Result
  1. Method:

Q2: Camera calibration K from annotations

(a) Camera calibration from vanishing points

Input Image Annotated Parallel Lines Vanishing points and principal point
  1. Intrinsics 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]]
  1. Vanishing points in pixel coordinates (x, y):
[[-1204.64633052  1425.62820743]
 [  559.88532351  -935.83692793]
 [ 1859.40405616  1391.62090484]]
  1. Principal point in pixel coordinates (x, y):
[575.06600499 431.93909042]
  1. Method:

(b) Camera calibration from metric planes

Input Image Annotated Square 1 Annotated Square 2 Annotated Square 3
Angle between planes(degree) 180 - angle
Plane 1 & Plane 2 112.42 67.58
Plane 1 & Plane 3 92.25 87.75
Plane 2 & Plane 3 85.22 94.78
  1. Intrinsics Matrix K
[[ 1.08447642e+03 -1.35121131e+01  5.20013594e+02]
 [-0.00000000e+00  1.07900526e+03  4.02544642e+02]
 [-0.00000000e+00  0.00000000e+00  1.00000000e+00]]
  1. Method:

(c) Camera calibration from rectangles with known sizes

Input Image Annotated Squares Annotated Plane 1 Annotated Plane 2 Annotated Plane 3
Angle between planes(degree) 180 - angle
Plane 1 & Plane 2 124.67 55.33
Plane 1 & Plane 3 94.52 85.48
Plane 2 & Plane 3 86.37 93.63
  1. Intrinsics Matrix K
[[ 2.87309221e+03 -9.72158050e+00  2.03083377e+03]
 [-0.00000000e+00  2.89135314e+03  1.28359857e+03]
 [ 3.84542836e-19 -6.13569008e-19  1.00000000e+00]]
  1. We use the exact same algorithm here as in Q2(b). The only difference is that we replace the corner points being mapped by the homography. Considering the ratio Rx:Ry between the x and y axes, we replace the corner points with [[0, 0], [0, Ry], [Rx, Ry], [Rx, 0]]. The rest of the algorithm is the same as Q2(b). In fact, Q2(b) is a special case of this where Rx:Ry = 1:1.

Q3: Single View Reconstruction

Note: I am using Open3D for just visualizing the 3D RGB points. This is because the matplotlib scatter plot window throws a "not responding" error when plotting a high number of points. Compared to this, Open3D has a much smoother visualizer for debugging and recording results.

Input Image Annotations Reconstruction View 1 Reconstruction View 2 Visualization
  1. Method:

(b) Similarly, we can use the same function for different images:

Input Image Annotations Visualization