From 3e99079107291e956e387981578ace4f18e479cd Mon Sep 17 00:00:00 2001 From: Juan Nunez-Iglesias Date: Thu, 25 Jul 2013 00:24:04 +1000 Subject: [PATCH] Precision issues appear to have vanished --- skimage/segmentation/_slic.pyx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/skimage/segmentation/_slic.pyx b/skimage/segmentation/_slic.pyx index 055907e9..d4121721 100644 --- a/skimage/segmentation/_slic.pyx +++ b/skimage/segmentation/_slic.pyx @@ -78,8 +78,7 @@ def _slic_cython(double[:, :, :, ::1] image_zyx, # squaring itself. mine can't (with O2) tmp = image_zyx[z, y, x, c] - means[k, c] dist_mean += tmp * tmp - # some precision issue here. Doesnt work if testing ">" - if distance[z, y, x] - dist_mean > 1e-10: + if distance[z, y, x] > dist_mean: nearest_mean[z, y, x] = k distance[z, y, x] = dist_mean changes = 1