-
10/03: Reference annotations released for q2a, q2b & q3.
Explanation of format and example code for visualization can be found in annotations.py. It's not mandatory to use the reference annotations; you may use your annotations instead.
- Late Submission Policy: See the late submission policy here.
- Submitting your work: Check the instructions for submission here.
- There are
3
questions in this assignment. Make sure you follow the instructions and submit the answers as required.
In this question, your goal is to compute P
from 2D-3D point correspondences.
We provide a picture of stanford bunny data/q1/bunny.jpeg
and 2D-3D point correspondences in data/q1/bunny.txt
. The text file contains multiple rows. Each row represents a pair of 2D-3D correspondences, where the first 2 numbers are the 2D coordinates on the image while the next 3 numbers are the corresponding 3D coordinates.
Input Image | Annotated 2D points |
---|---|
![]() |
![]() |
Instructions
- Compute the camera matrix
P
using the provided 2D-3D correspondences. - We provide a set of 3D surface points in
data/q1/bunny_pts.npy
. Project these points to the image using your calculatedP
. See the example below. - We provide the 12 edges of the bounding box in
data/q1/bunny_bd.npy
. Each line contains 6 numbers, where every 3 numbers denote 1 point. Project these points to the image and draw the cuboid. See the example below.
Surface Points | Bounding Box |
---|---|
![]() |
![]() |
Instructions
- Find (or capture) 1 image of a cuboid. Come up with a 3D coordinate system (by measuring relative dimensions of the cuboid) and annotate 6 pairs of point correspondences.
- Compute the camera matrix
P
using your annotated 2D-3D correspondences. - Draw the edges of the cuboid using your calculated
P
or do something fun!
Input Image | Annotated 2D points | Example Result |
---|---|---|
![]() |
![]() |
![]() |
In this question, your goal is to compute K
from a triad of orthogonal vanishing points, assuming that the camera has zero skew, and that the pixels are square.
Dataset
- Run your code on
data/q2a.png
. Annotate 3 pairs of parallel lines that are orthogonal to each other.
Submission
- Output plots of the vanishing points and the principal point. Also include visualizations of the annotations that you used. See the following figures:
Input Image | Annotated Parallel Lines | Vanishing points and principal point |
---|---|---|
![]() |
![]() |
![]() |
- Report
K
for the input image. - Brief description of your implementation (i.e., the algorithm followed with relevant equations).
In this question, your goal is to compute K
from image of three squares. Different from (a), you will not make any additional assumption on K
(except that it is a projective camera).
Dataset
- Run your code on
data/q2b.png
. Annotate 3 squares in the image.
Submission
- Visualizations of annotations that you used. See the following figure as an example:
Input Image | Annotated Square 1 | Annotated Square 2 | Annotated Square 3 |
---|---|---|---|
![]() |
![]() |
![]() |
![]() |
- Evaluate angles between each pair of planes. This will reflect the correctness of your calibration result.
Angle between planes(degree) | |
---|---|
Plane 1 & Plane 2 | 67.40 |
Plane 1 & Plane 3 | 92.22 |
Plane 2 & Plane 3 | 94.70 |
- Report
K
for the input image. - Brief description of your implementation (i.e., the algorithm followed with relevant equations).
In part (b), you computed K
from image of three squares (based on the algorithm described in the lectures). In this question, the goal is to modify this approach by relaxing the assumption of imaging squares, and instead computing K
from image of three rectangles, each with known height-to-width ratios.
Dataset Preparation
- Find (or capture)
1
image of three rectangles, where the height:width ratios are known. Make sure that the three rectangles are not on the same plane.
Submission
- Input image.
- Visualizations of annotations that you used.
- Evaluate angles between each pair of planes. This will reflect the correctness of your calibration result.
- Report
K
for your input image. - Brief description of your implementation (i.e., the algorithm followed with relevant equations, and in particular emphasizing the differences compared to part b).
Example Input Image | Annotated Squares |
---|---|
![]() |
![]() |
Angle between planes(degree) | |
---|---|
Plane 1 & Plane 2 | 62.99 |
Plane 1 & Plane 3 | 84.11 |
Plane 2 & Plane 3 | 86.88 |
In this question, your goal is to reconstruct a colored point cloud from a single image.
Dataset
- Run your code on
data/q3.png
. You may assume zero skew and square pixels fordata/q3.png
.
Submissions
- Output reconstruction from at least two different views. Also include visualizations of annotations that you used. See the following figure as an example:
Input Image | Annotations | Reconstruction View 1 | Reconstruction View 2 |
---|---|---|---|
![]() |
![]() |
![]() |
![]() |
- Brief description of your implementation (i.e., the algorithm followed with relevant equations).
Hints
-
For visualization, consider using 3D scatter plot from
matplotlib
. -
Consider following these steps for your implementation:
- Use Q2a to compute
K
. - Annotate plane boundaries with corner points.
- Compute plane normals.
- Compute rays for each point. Pick one point as reference and set its depth.
- Compute plane equation given the known 3D point.
- Compute 3D coordinate of all points on the plane via ray-plane intersection.
- Repeat the above two steps to obtain equations for all planes (and all 3D points).
- Use Q2a to compute
For this part, you will run your implementation in part (a) on 3
more images. For each image, submit a gif of the reconstructed 3d structure from different views.
Submissions
- Input images.
- For each input image, include a gif to visualize the reconstruction at different views.
Example Input Image | Output |
---|---|
![]() |
![]() |
- Download any code.
- Use any predefined routines except linear algebra functions, image interpolation, and image warping.
- It is a good idea to
assert
with sanity checks regularly during debugging. - Start Early and Have Fun!