P
from 2D-3D correspondences[[ 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]]
Surface Points | Bounding Box |
---|---|
![]() |
![]() |
Method:
We model the constraint as follows:
From the equation above, a single point correspondence gives us 2 constraints. We use 12 such constraints from 6 points to make matrix A
of size (12 x 12)
A
(using SVD) gives us the best solution for the elements of the projection matrix.(P @ X)
projects a homogenized 3D point to the image plane. Converting to unit scale gives us the pixel location of that point. Using this, we are able to plot points and lines[[ 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]]
Input Image | Annotated 2D points | Example Result |
---|---|---|
![]() |
![]() |
![]() |
[0, 0, 0]
. The following corners are annotated assuming a side length of 100
as shown in the annotation image.6
corners gives us 6
homogenized 3D-to-2D point correspondences and 12 constraints, similar to the equation used in Q1(a)A
(using SVD) gives us the best solution for the elements of the projection matrix.[50, 80] [35, 50] [65, 50]
and [50, 20]
gives us a pattern in the shape of a lightning bolt on the cube's face! The other lines are formed using the cube's corners.(P @ X)
projects a homogenized 3D point to the image plane. Converting to unit scale gives us the pixel location of that point. Using this, we are able to plot lines.K
from annotationsInput Image | Annotated Parallel Lines | Vanishing points and principal point |
---|---|---|
![]() |
![]() |
![]() |
[[ 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]]
[[-1204.64633052 1425.62820743]
[ 559.88532351 -935.83692793]
[ 1859.40405616 1391.62090484]]
[575.06600499 431.93909042]
Method:
Using SVD to solve for the set of linear constraints, we get the image of the absolute conic (IAC)
The intrinsics K can be obtained by first doing a Cholesky decomposition of the IAC, and then taking the inverse of it.
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.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]]
Method:
[[0, 0], [0, 1], [1, 1], [1, 0]]
to the annotated points on the image. This is done using Direct Linear Transformation and SVD.Thus, each homography gives us 2 constraints on the IAC. Since the IAC is symmetric (as shown in Q2(a)), we can find its elements by solving for the 6 constraints obtained from the 3 homographies we have. This is done using SVD.
The intrinsics K can be obtained by first doing a Cholesky decomposition of the IAC, and then taking the inverse of it.
K.T
with the vanishing line.arccos(dot_product(normal_1, normal_2))
, given that the normal vectors have unit magnitude.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 |
[[ 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]]
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
.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 |
---|---|---|---|---|
![]() |
![]() |
![]() |
![]() |
![]() |
Method:
K.T
with the vanishing line.Relevant equations given below:
Input Image | Annotations | Visualization |
---|---|---|
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |