In this project we had to implement a harris corner detector, the SIFT pipeline, and the Nearrest Nieghbor Distance Ratio (NNDR) feature matching algorithm.
I implemented the harris corner detector to find interest points. The algorithm is as follows:
I implemented the SIFT pipeline. The pseudo code is as follows:
for i = 1:size(x,1)
dx = (x(i)-feature_width/2):(x(i)-1+feature_width/2);
dy = (y(i)-feature_width/2):(y(i)-1+feature_width/2);
descriptor = zeros(cell_width, cell_width, 8);
for j=1:8
g = grads(dx,dy) .* gaussian;
o = orien(dx,dy);
for k1=1:cell_width
for k2=1:cell_width
cx = ((k1-1)*cell_width+1):(k1*cell_width);
cy = ((k2-1)*cell_width+1):(k2*cell_width);
cg = g(cx,cy);
co = o(cx,cy);
c = cg(co == j);
descriptor(k1,k2,j) = sum(c(:));
end
end
end
descriptor = descriptor./max(descriptor(:));
descriptor(descriptor > 0.2) = 0.2;
descriptor = descriptor./max(descriptor(:));
features(i,:) = descriptor(:);
end
I implemented the NNDR algorithm. The algorithm is as follows:
Notre Dame. 82% accuracy for top 100 most confident matches. |
Mt. Rushmore. 95% accuracy for top 100 most confident matches. |
Episcopal Gaudi. 4% accuracy for top 100 most confident matches. |