Skip to content

Commit

Permalink
apply symmetric check when computing repeatability
Browse files Browse the repository at this point in the history
  • Loading branch information
lzx551402 committed Apr 10, 2020
1 parent eb25000 commit 0df33b7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion hseq_eval.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ def matcher(consumer_queue, sess, evaluator, config):
gt_homo)
cov_ref_coord, cov_test_coord = ref_kpts[ref_mask], test_kpts[test_mask]
cov_ref_feat, cov_test_feat = ref_descs[ref_mask], test_descs[test_mask]
num_cov_feat = min(cov_ref_coord.shape[0], cov_test_coord.shape[0])
num_cov_feat = (cov_ref_coord.shape[0] + cov_test_coord.shape[0]) / 2
# get gt matches
gt_num = evaluator.get_gt_matches(cov_ref_coord, cov_test_coord, gt_homo, scaling)
# establish putative matches
Expand Down
7 changes: 5 additions & 2 deletions utils/evaluator.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,11 @@ def get_gt_matches(self, ref_coord, test_coord, gt_homo, scaling=1.):
pt0 = np.expand_dims(proj_ref_coord, axis=1)
pt1 = np.expand_dims(test_coord, axis=0)
norm = np.linalg.norm(pt0 - pt1, ord=None, axis=2)
min_dist = np.min(norm, axis=1)
gt_num = np.sum(min_dist <= self.err_thld)
min_dist0 = np.min(norm, axis=1)
min_dist1 = np.min(norm, axis=0)
gt_num0 = np.sum(min_dist0 <= self.err_thld)
gt_num1 = np.sum(min_dist1 <= self.err_thld)
gt_num = (gt_num0 + gt_num1) / 2
return gt_num

def print_stats(self, key):
Expand Down

0 comments on commit 0df33b7

Please sign in to comment.