Make image C-contiguous

This commit is contained in:
Johannes Schönberger
2013-09-03 08:40:18 +02:00
parent 80ed875147
commit d9e64b43e6
+1 -1
View File
@@ -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)