From 02bf7130172655a4beaf3129fd3c2715eb37d77f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20Sch=C3=B6nberger?= Date: Wed, 15 Aug 2012 09:08:20 +0200 Subject: [PATCH] add some more comments to subdivision of polygons code --- skimage/measure/_polygon.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/skimage/measure/_polygon.py b/skimage/measure/_polygon.py index 2d938af7..c1eaa9d5 100644 --- a/skimage/measure/_polygon.py +++ b/skimage/measure/_polygon.py @@ -136,10 +136,13 @@ def subdivide_polygon(coords, degree=2): method = 'valid' if circular: + # remove last coordinate because of wrapping coords = coords[:-1, :] + # circular convolution by wrapping boundaries method = 'same' mask_even, mask_odd = SUBDIVISION_DEGREES[degree] + # divide by total weight mask_even = np.array(mask_even, 'float') / 2 ** degree mask_odd = np.array(mask_odd, 'float') / 2 ** degree