Example of a right floating element.
The project aims at implementing algorithms to identify features in different images of the same object. The implemented parts include:
The Harris corner detector is implemented to find the basic local features.
scale | 0.01 | 0.015 | 0.017 | 0.0175 | 0.018 | 0.02 | 0.03 | 0.04 | 0.05 |
wrong match | 16 | 15 | 11 | 11 | 11 | 11 | 11 | 13 | 14 |
correct match | 86 | 83 | 82 | 82 | 82 | 79 | 76 | 74 | 70 |
rate | 0.186 | 0.181 | 0.134 | 0.134 | 0.134 | 0.139 | 0.145 | 0.17 | 0.20 |
Set scale = 0.018. Similarily, set rate of distance to 0.77.
The default feature_width is 16. We need to calculate the gradient of the 16 * 16 matrix surrounding the feature point.
for p = 1:4
for q = 1:4
dy = aY(p,q);
dx = aX(p,q);
at = (pi + atan2(dy,dx))*4/pi;
index = ceil(at);
count(index) = count(index) + norm([dy dx]);
end
end
Find the two nearest neighbors to the target feature, and then store the ratio as confidences. The matlab built-in function sort is very efficient in finding the nearest neighbors. The following is how I implemented.
for j = 1 :num_features2
v = [v sqrt(sum((features1(i, :) - features2(j , :)).^2))];
end
[v ind] = sort(v);
d1 = v(1);
d2 = v(2);
minindex = ind(1);
if d1 / d2 < 0.77
matches = [matches ; [i minindex]];
confidences = [confidences ; d1 / d2];
end
![]() |
![]() |
![]() |
![]() |
![]() |