From 9ad7c78c8e8cea70a8c27c66e5292e281f0d2d16 Mon Sep 17 00:00:00 2001 From: Ankit Agrawal Date: Thu, 15 Aug 2013 19:14:47 +0530 Subject: [PATCH] Documenting the choice of filter sizes --- doc/examples/plot_censure_keypoints.py | 4 ++-- skimage/feature/censure.py | 7 +++++++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/doc/examples/plot_censure_keypoints.py b/doc/examples/plot_censure_keypoints.py index eb6f2a16..fbba4e1b 100644 --- a/doc/examples/plot_censure_keypoints.py +++ b/doc/examples/plot_censure_keypoints.py @@ -40,8 +40,8 @@ for col, mode in enumerate(['dob', 'octagon', 'star']): # Plotting Censure features at all the scales for row, scale in enumerate(range(min_scale + 1, max_scale)): mask = scales == scale - x = keypoints[mask][:, 1] - y = keypoints[mask][:, 0] + x = keypoints[mask, 1] + y = keypoints[mask, 0] s = 0.5 * 2 ** (scale + min_scale + 1) ax[row, col].imshow(img) ax[row, col].scatter(x, y, s, facecolors='none', edgecolors='b') diff --git a/skimage/feature/censure.py b/skimage/feature/censure.py index dee2c81c..00be16a8 100644 --- a/skimage/feature/censure.py +++ b/skimage/feature/censure.py @@ -10,11 +10,18 @@ from skimage.feature.util import _mask_border_keypoints from skimage.feature.censure_cy import _censure_dob_loop +# The paper(Reference [1]) mentions the sizes of the Octagon shaped filter +# kernel for the first seven scales only. The sizes of the later scales +# have been extrapolated based on the following statement in the paper. +# "These octagons scale linearly and were experimentally chosen to correspond +# to the seven DOBs described in the previous section." OCTAGON_OUTER_SHAPE = [(5, 2), (5, 3), (7, 3), (9, 4), (9, 7), (13, 7), (15, 10), (15, 11), (15, 12), (17, 13), (17, 14)] OCTAGON_INNER_SHAPE = [(3, 0), (3, 1), (3, 2), (5, 2), (5, 3), (5, 4), (5, 5), (7, 5), (7, 6), (9, 6), (9, 7)] +# The sizes for the STAR shaped filter kernel for different scales have been +# taken from the OpenCV implementation. STAR_SHAPE = [1, 2, 3, 4, 6, 8, 11, 12, 16, 22, 23, 32, 45, 46, 64, 90, 128] STAR_FILTER_SHAPE = [(1, 0), (3, 1), (4, 2), (5, 3), (7, 4), (8, 5), (9, 6), (11, 8), (13, 10), (14, 11), (15, 12), (16, 14)]