Skip matched keypoints.
@@ -473,6 +473,7 @@ static kp_t *find_best_match(kp_t *kp1, array_t *kpts, int *dist_out)
int dist = 0;
kp_t *kp2 = array_at(kpts, i);
+ if (kp2->matched == 0) {
for (int m=0; m<(KDESC_SIZE/4); m++) {
uint32_t v = ((uint32_t*)(kp1->desc))[m] ^ ((uint32_t*)(kp2->desc))[m];
while (v) {
@@ -488,6 +489,7 @@ static kp_t *find_best_match(kp_t *kp1, array_t *kpts, int *dist_out)
min_dist = dist;
}
}
+ }
*dist_out = min_dist;
return min_kp;
