Mount Rushmore match points.
The project is divided into 3 parts. The first one is to find camera projection matrix. The specific steps are as follows:
The second part of the project is to estimate the fundamental matrix, which is used to map the points from one image to corresponding points in the other image
Initially when doing the normalized patch as feature descriptions, the accuracy jumped from nearly 0% to 42%. When SIFT-life feature is implemented, the accuracy rose up to 66% for Notre Dame pair.
In this part, we are going to combine the fundamental matrix evaluation function with RANSAC algorithm
for i = 1:iterations
sample = randsample(row,8);
samples_matches_a = matches_a(sample,:);
samples_matches_b = matches_b(sample,:);
temp_F_matrix = estimate_fundamental_matrix(samples_matches_a,samples_matches_b);
temp_inliers_a = [];
temp_inliers_b = [];
num_matches = 0;
for j=1:row
if abs([matches_b(j, :) 1] * temp_F_matrix * [matches_a(j, :) 1]') < inlier_distance_threshold
temp_inliers_a = [temp_inliers_a;matches_a(j,:)];
temp_inliers_b = [temp_inliers_b;matches_b(j,:)];
num_matches = num_matches + 1;
end
end
if (num_matches / row) >= threshold
max_a = temp_inliers_a;
max_b = temp_inliers_b;
break
elseif max_inlines < num_matches
max_inlines = num_matches;
max_a = temp_inliers_a;
max_b = temp_inliers_b;
end
end
inliers_a = max_a;
inliers_b = max_b;
Best_Fmatrix = estimate_fundamental_matrix(inliers_a,inliers_b);
For RANSAC algorithm, I found it's very hard to get over certain thresholds, say 60 or 70 percent. Therefore, the code returns the matrix that returns most agreeable points. When threshold gets too big,for example, above 0.1, there will be obvious mismatch pairs get selected.