From 10934cfaff34e427481871c2ffa43939cb714896 Mon Sep 17 00:00:00 2001 From: Andreas Mueller Date: Sat, 4 Aug 2012 20:27:18 +0100 Subject: [PATCH] Fixed bug in SLIC smoothing --- skimage/segmentation/slic.pyx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/skimage/segmentation/slic.pyx b/skimage/segmentation/slic.pyx index 1430ba63..37c6b79c 100644 --- a/skimage/segmentation/slic.pyx +++ b/skimage/segmentation/slic.pyx @@ -19,7 +19,7 @@ def slic(image, n_segments=100, ratio=10., max_iter=10, sigma=1, convert2lab=Tru max_iter: int maximum number of iterations of k-means sigma: float - Width of Gaussian smoothing kernel for preprocessing. + Width of Gaussian smoothing kernel for preprocessing. Zero means no smoothing. convert2lab: bool Whether the input should be converted to Lab colorspace prior to segmentation. For this purpose, the input is assumed to be RGB. Highly recommended. @@ -43,7 +43,7 @@ def slic(image, n_segments=100, ratio=10., max_iter=10, sigma=1, convert2lab=Tru image = np.atleast_3d(image) if image.shape[2] != 3: ValueError("Only 3-channel 2d images are supported.") - image = ndimage.gaussian_filter(img_as_float(image), sigma) + image = ndimage.gaussian_filter(img_as_float(image), [sigma, sigma, 0]) if convert2lab: image = rgb2lab(image)