From d1629aec0f1a861106d54cb015b238e7fe542936 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20Sch=C3=B6nberger?= Date: Sat, 6 Oct 2012 19:05:11 +0200 Subject: [PATCH] Fix polygon approximation for 0 or less tolerance --- skimage/measure/_polygon.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/skimage/measure/_polygon.py b/skimage/measure/_polygon.py index add4b5fb..7b9b920b 100644 --- a/skimage/measure/_polygon.py +++ b/skimage/measure/_polygon.py @@ -28,7 +28,7 @@ def approximate_polygon(coords, tolerance): ---------- .. [1] http://en.wikipedia.org/wiki/Ramer-Douglas-Peucker_algorithm """ - if tolerance == 0: + if tolerance <= 0: return coords chain = np.zeros(coords.shape[0], 'bool')