HW3: 3D Reconstruction

Andrew ID: pengliaj

Q1: 8-Point and 7-Point Algorithm (40 points)

(A1) F Matrix Using 8-Point Algorithm (15 points)

Explanation of Implementation
Epipolar Lines
Viewpoint 1 (Points) Viewpoint 2 (Epipolar Lines)
Viewpoint 1 - Image 1
Viewpoint 2 - Epipolar Lines 1
Viewpoint 1 - Image 2
Viewpoint 2 - Epipolar Lines 2

(A2) E Matrix Using 8-Point Algorithm (5 points)

Explanation of Implementation
Estimated E

Estimated E Matrix 1

Estimated E Matrix 2

(B) 7-Point Algorithm (20 points)

Explanation of Implementation
  1. Matrix Construction: For each matched point pair, create a matrix row that captures their geometric relationship, setting up for solving the fundamental matrix.
  2. Compute Fundamental Matrices: Apply SVD to find special vectors, reshape them into preliminary matrices, and combine these with an adjustable factor to satisfy required properties.
  3. Solve the Polynomial: Use the combination’s condition to form a cubic equation. Solve it to get values for the factor, yielding potential fundamental matrices.
  4. Denormalize the Fundamental Matrix: Convert each candidate matrix back to the original coordinates, providing matrices that capture the true image relationship.
Epipolar Lines
Viewpoint 1 Viewpoint 2
Viewpoint 1 - Ball
Viewpoint 2 - Ball Epipolar Lines
Viewpoint 1 - Hydrant
Viewpoint 2 - Hydrant Epipolar Lines
Fundamental Matrices

Fundamental Matrix 1

Fundamental Matrix 2

Q2: RANSAC with 7-Point and 8-Point Algorithm (20 points)

Explanation of Implementation
  1. Random Sampling and Model Fitting: Each iteration:

  2. Error Calculation and Inlier Counting: For each calculated F:

  3. Dynamic Threshold and Early Stopping: The threshold tightens every 10% of iterations. If inlier counts stabilize for a set number of rounds, iterations stop early.

Epipolar Lines
Viewpoint 1 (Points)
(8 points)
Viewpoint 2 (Epipolar Lines)
(8 points)
Viewpoint 1 (Points)
(7 points)
Viewpoint 2 (Epipolar Lines)
(7 points)
% of Inliers vs. # of Iterations
Ball - Viewpoint 1 (8 points)
Ball - Viewpoint 2 (8 points)
Ball - Viewpoint 1 (7 points)
Ball - Viewpoint 2 (7 points)
Ball - Inlier Comparison
Hydrant - Viewpoint 1 (8 points)
Hydrant - Viewpoint 2 (8 points)
Hydrant - Viewpoint 1 (7 points)
Hydrant - Viewpoint 2 (7 points)
Hydrant - Inlier Comparison
Bench - Viewpoint 1 (8 points)
Bench - Viewpoint 2 (8 points)
Bench - Viewpoint 1 (7 points)
Bench - Viewpoint 2 (7 points)
Bench - Inlier Comparison
Remote - Viewpoint 1 (8 points)
Remote - Viewpoint 2 (8 points)
Remote - Viewpoint 1 (7 points)
Remote - Viewpoint 2 (7 points)
Remote - Inlier Comparison
Fundamental Matrices
Object 8 Points 7 Points
Ball
Ball - 8 Points
Ball - 7 Points
Hydrant
Hydrant - 8 Points
Hydrant - 7 Points
Bench
Bench - 8 Points
Bench - 7 Points
Remote
Remote - 8 Points
Remote - 7 Points

Q3: Triangulation (20 points)

Explanation of Implementation
  1. Skew-Symmetric Matrix Construction: Convert each 2D point to a skew-symmetric matrix, enabling cross product representation as matrix multiplication, which aids in building constraints.
  2. Constraint Matrix Calculation: For each point pair, compute constraints using the skew-symmetric matrices and camera projections for both images. These constraints are key to solving the 3D point.
  3. Triangulating 3D Points: Stack the constraints into a system and solve using SVD to find the 3D point in homogeneous coordinates, then normalize to get the final (X, Y, Z) values.
  4. Color Extraction: For visualization, retrieve RGB color values from each 2D point in the first image, storing these colors with the corresponding 3D points.
Point Cloud

3D Point Cloud

Q4: Reconstruct Your Own Scene! (20 points)

Example Multi-View Images Output
Multi-View Image Set 1
Reconstruction Output 1
Multi-View Image Set 2
Reconstruction Output 2

Q5: Bonus 1 - Fundamental Matrix Estimation on Your Own Images (10 points)

Description of Implementation
  1. Keypoint Detection and Matching: The SIFT detector finds distinctive features in each image. A brute-force matcher then matches descriptors between the two images, and matches are sorted by distance to prioritize closer matches.
  2. Homogeneous Coordinates Conversion: The matched keypoints are converted into homogeneous coordinates, a requirement for epipolar geometry computations.
  3. Fundamental Matrix Estimation using RANSAC: The RANSAC algorithm estimates the fundamental matrix while minimizing the impact of outliers. Only inliers are retained, which improves the robustness of the estimation.
  4. Epipolar Line Visualization: Epipolar lines corresponding to the estimated fundamental matrix are drawn on both images, illustrating the geometric relationship between the matched points.
Epipolar Lines
Viewpoint 1 (Points) Viewpoint 2 (Epipolar Lines)
Building - Viewpoint 1
Building - Viewpoint 2
Monument - Viewpoint 1
Monument - Viewpoint 2

Q6: Bonus 2 - Stress Test the Hyperparameters of COLMAP (10 points)

Question 1: What happens if we reduce the number of input images in COLMAP?


Question 2: How does adjusting tolerance parameters affect the COLMAP reconstruction pipeline?