Assignment 3
Q1: 8-point and 7-point algorithm
(A1) F matrix using 8-point algorithm
Epipolar Lines
Methodology:
- Load the points and normalize them
- If the correspondence consists of points and then:
where f is the flattened F vector
So each correspondence gives one constraint, constraints from 8 such points can be stacked together to give a matrix of form
Here A is 8x8 matrix, f can be found out by performing SVD decomposition of A and choosing the right singular vector
- Denormalize the obtained F
- Say F is the fundamental matrix found in step 3, then rank 2 constraint can be imposed by
(A2) E matrix using 8-point algorithm (5 points)
Results:
Bench:
E matrix using 8 point algorithm is:
[ -0.4152 -8.8175 -2.1506]
[ -1.3804 0.7907 69.0827]
[ -3.5889 -68.4744 1. ]
Remote:
E matrix using 8 point algorithm is:
[ 2.5298 -0.6706 7.3309]
[ -6.6203 -3.0277 -28.2986]
[-14.5007 26.4182 1. ]
Methodology:
- Once F is found, E can be found using
- Enforce low rank constraint by
(B) 7-point algorithm (20 points)
Epipolar Lines:
Methodology:
- Load the points and normalize them
- If the correspondence consists of points and then:
where f is the flattened F vector
So each correspondence gives one constraint, constraints from 7 such points can be stacked together to give a matrix of form
Where A is 7x8 matrix
We can find the basis of null space of A as the last 2 right singular vectors. Say those vectors are
- Denormalize the obtained F’s.
- Any F that satisfies Af=0 can be written in terms of f1 and f2 as
- Since F is not full rank ⇒ determinant (F) = 0; This is a cubic equation in F
- Solve the equation to find possible values of and hence F . Out of real solutions, choose the one that minimises epipolar error. The epipolar error is defined by:
- Say F is the fundamental matrix found in step 6, then rank 2 constraint can be imposed by
Q2: RANSAC with 7-point and 8-point algorithm (20 points)
Methodology
The criterion for selecting inliers is the epipolar error.
For a given correspondence the epipolar error is defined as the distance of each point from the epipolar line. Mathematically
Points with epipolar error < tolerance are considered inliers, otherwise outliers
The RANSAC approach is as follows:
- Randomly sample 7 or 8 points (depending on the algorithm) without replacement
- Find F matrix using the code from previous questions.
- Find number of inliers while keeping a track of max number of inliers so far
- Repeat above multiple times and choose F that leads to max number of inliers
- Find F using all the inliers for best F
Results
Q3: Triangulation
Methodology
- For each correspondence (x, X) we can write
- Similarly compute 3D point X for each correspondence
- Assign color to each point based on the images
- Plot the points using matplotlib
Visualizations
Q4: Reconstruct your own scene! (20 points)
Scenario 1:
Lab Images
https://drive.google.com/drive/folders/16fzRD1p4BhL05mD7Dge1sWKWIAUE9rN3?usp=sharing
Reconstruction

Scenario 2:
Robotic arms on tabletop:
Images Link : https://drive.google.com/drive/folders/1-5b1NlHhiVevm0cqkBNXTKvZGCyPiE59?usp=sharing

Q5: Bonus 1 - Fundamental matrix estimation on your own images. (10 points)
Methodology:
- Extract SIFT features
- Find top 2 matches for each feature
- Perform ratio test - keep a feature only if the ratio of descriptor distance between best match and 2nd best match is < 0.75
- Use ransac with 8 point algorithm to get F

