Skip to content

Commit

Permalink
Actively filtering border keypoints on all scales
Browse files Browse the repository at this point in the history
  • Loading branch information
ankit-maverick committed Aug 15, 2013
1 parent c3e18b0 commit 4b0b342
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions skimage/feature/censure.py
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,22 @@ def censure_keypoints(image, n_scales=7, mode='DoB', non_max_threshold=0.15,
feature_mask[:, :, i] = _suppress_lines(feature_mask[:, :, i], image,
(1 + i / 3.0), line_threshold)

if mode == 'Octagon':
for i in range(1, n_scales - 1):
c = (OCTAGON_OUTER_SHAPE[i][0] - 1) / 2 + OCTAGON_OUTER_SHAPE[i][1]
feature_mask[:c, :, i] = False
feature_mask[:, :c, i] = False
feature_mask[-c:, :, i] = False
feature_mask[:, -c:, i] = False

elif mode == 'STAR':
for i in range(1, n_scales - 1):
c = STAR_SHAPE[STAR_FILTER_SHAPE[i][0]] + STAR_SHAPE[STAR_FILTER_SHAPE[i][0]] / 2
feature_mask[:c, :, i] = False
feature_mask[:, :c, i] = False
feature_mask[-c:, :, i] = False
feature_mask[:, -c:, i] = False

rows, cols, scales = np.nonzero(feature_mask[..., 1:n_scales - 1])
keypoints = np.column_stack([rows, cols])
scales = scales + 2
Expand Down

0 comments on commit 4b0b342

Please sign in to comment.