Projection matrix M has 9 variables but combining intrinsic and extrinsic matrices leads to 8 DoF. I set the last parameter of M to 1 and solve for M in an iterative code below:
nps = size(Points_2D,1);
A = zeros(nps*2,11);
A(1:2:nps*2,1:3) = Points_3D;
A(1:2:nps*2,4) = 1;
A(1:2:nps*2,9:11) = -Points_3D.*repmat(Points_2D(:,1),[1,3]);
A(2:2:nps*2,5:7) = Points_3D;
A(2:2:nps*2,8) = 1;
A(2:2:nps*2,9:11) = -Points_3D.*repmat(Points_2D(:,2),[1,3]);
b = zeros(nps*2,1);
b(1:2:nps*2) = Points_2D(:,1);
b(2:2:nps*2) = Points_2D(:,2);
M = A\b;
M = [M;1];
M = reshape(M,[],3)';
Above code results in:
>> proj3_part1
The projection matrix is:
-2.0466 1.1874 0.3889 243.7330
-0.4569 -0.3020 2.1472 165.9325
-0.0022 -0.0011 0.0006 1.0000
The total residual is: <15.6217>
The estimated location of camera is: <303.0967, 307.1842, 30.4223>
Given in the project by the following relation: "M_norm_A = -0.5970* M"
the center is:
Center =
-1.5126 -2.3517 0.2827
Figures below show the projections and center of the camera respctively.
|
|
Without normalization 1 |
Without normalization 2 |
With normalization 1 |
With normalization 2 |
I uses VL_feat SIFT to find 800+ interest point. RANSAC
will lead to calculate the best option or solution for fundamental matrix. I used 8 points in RANSAC. Figure below show the results in Mount rushmore.
Image 1 without normalization |
And here is the correspondence:
Corespondence without normalization |
Image 1 with normalization |
Image 2 with normalization |
Correspondence with normalization |