From d9e64b43e6c3d3434ba49fef971a33b301436407 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20Sch=C3=B6nberger?= Date: Tue, 3 Sep 2013 08:40:18 +0200 Subject: [PATCH] Make image C-contiguous --- skimage/segmentation/slic_superpixels.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/skimage/segmentation/slic_superpixels.py b/skimage/segmentation/slic_superpixels.py index 5a6d4506..4f10e75f 100644 --- a/skimage/segmentation/slic_superpixels.py +++ b/skimage/segmentation/slic_superpixels.py @@ -131,7 +131,7 @@ def slic(image, n_segments=100, compactness=10., max_iter=20, sigma=1, # we do the scaling of ratio in the same way as in the SLIC paper # so the values have the same meaning ratio = float(max((step_z, step_y, step_x))) / compactness - image = image * ratio + image = np.ascontiguousarray(image * ratio) labels = _slic_cython(image, clusters, max_iter)