Project 3: Camera Calibration and Fundamental Matrix Estimation with RANSAC

Introduction

In this project,we need to compute the camera projection matrix and estimate the fundamental matrix using SVD, and then implement RANSAC to find the best fundamental matrix.

Some details about my algorithm

For camera projection matrix, I set up the linear system A*m = 0 and perform SVD on matrix A, extract the eigenvector associated with the smalles eigenvalue and reshape the eigenvector to a matrix of size 3-by-3, and this will be our camera projection matrix. For the fundamental matrix estimation, I use a very similar method. Set up the linear system A*m = 0 (this A matrix is not the same A matrix from part i though) and then use SVD to find the eigenvector associated with the smallest eigenvalue. In the last part, for each iteration, I randomly choose 8 points from matched_points of image a and image b, and estimate the fundamental matrix using these points. Then I calculate the "accuracy" of this fundamental matrix by finding the number of inliers: check the value of product A*(F_estimate) has value within our threshold; keep the F matrix with the most number of inliers.

Results of my algorithm

Results of Camera Projection Matrix and Camera Center

The projection matrix is:
0.4583 -0.2947 -0.0140 0.0040
-0.0509 -0.0546 -0.5411 -0.0524
0.1090 0.1783 -0.0443 0.5968
The estimated location of camera is: <-1.5127, -2.3517, 0.2826>

Results of Estimated Fundamental Matrix

Results of RANSAC Fundamental Matrix

For a better visualization result, I randomly picked 30 points from inliers and show them on the arrow plot; and we see that all of them are matched correctly.

Extra Credit

To perform a better fundamental matrix estimation, we normalize the coordinates by multiplying the scale matrix and offset matrix to the original coordinates. Then we compute the fundamental matrix using the normalized coordinates. Finally we transform the F_matrix by using tb' * F * ta. The first pairs is the results before normalization. The second pairs is the results after the normalization.

We can observe that the normalization procedure greatly improves the result of Gaudi pair.