From 4816d2ed0fc187cf8f18037613db98e1f9457fd0 Mon Sep 17 00:00:00 2001 From: Juan Nunez-Iglesias Date: Sat, 17 Oct 2015 13:16:39 +1100 Subject: [PATCH 1/2] Refine docstring for 'compactness' kwarg in SLIC Addresses #1745 --- skimage/segmentation/slic_superpixels.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/skimage/segmentation/slic_superpixels.py b/skimage/segmentation/slic_superpixels.py index ed06272a..f54f0193 100644 --- a/skimage/segmentation/slic_superpixels.py +++ b/skimage/segmentation/slic_superpixels.py @@ -25,10 +25,13 @@ def slic(image, n_segments=100, compactness=10., max_iter=10, sigma=0, n_segments : int, optional The (approximate) number of labels in the segmented output image. compactness : float, optional - Balances color-space proximity and image-space proximity. Higher - values give more weight to image-space. As `compactness` tends to - infinity, superpixel shapes become square/cubic. In SLICO mode, this - is the initial compactness. + Balances color proximity and space proximity. Higher values give + more weight to space proximity, making superpixel shapes more + square/cubic. In SLICO mode, this is the initial compactness. + This parameter depends strongly on image contrast and on the + shapes of objects in the image; we recommend exploring possible + values on a log scale, e.g., 0.01, 0.1, 1, 10, 100, before + refining around a chosen value. max_iter : int, optional Maximum number of iterations of k-means. sigma : float or (3,) array-like of floats, optional From 7212fe3e82a19a3dea7c29a77726cf0c9f76512f Mon Sep 17 00:00:00 2001 From: Juan Nunez-Iglesias Date: Sun, 18 Oct 2015 11:41:54 +1100 Subject: [PATCH 2/2] Replace semicolon with full stop --- 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 f54f0193..3eca9401 100644 --- a/skimage/segmentation/slic_superpixels.py +++ b/skimage/segmentation/slic_superpixels.py @@ -29,7 +29,7 @@ def slic(image, n_segments=100, compactness=10., max_iter=10, sigma=0, more weight to space proximity, making superpixel shapes more square/cubic. In SLICO mode, this is the initial compactness. This parameter depends strongly on image contrast and on the - shapes of objects in the image; we recommend exploring possible + shapes of objects in the image. We recommend exploring possible values on a log scale, e.g., 0.01, 0.1, 1, 10, 100, before refining around a chosen value. max_iter : int, optional