Remove deprecated ratio keyword in SLIC

This commit is contained in:
Juan Nunez-Iglesias
2014-04-09 17:55:35 +10:00
parent 27bd239f17
commit 9510c03ce5
+1 -8
View File
@@ -11,7 +11,7 @@ from skimage.color import rgb2lab
def slic(image, n_segments=100, compactness=10., max_iter=10, sigma=None,
spacing=None, multichannel=True, convert2lab=True, ratio=None,
spacing=None, multichannel=True, convert2lab=True,
enforce_connectivity=False, min_size_factor=0.5, max_size_factor=3,
slic_zero=False):
"""Segments image using k-means clustering in Color-(x,y,z) space.
@@ -48,8 +48,6 @@ def slic(image, n_segments=100, compactness=10., max_iter=10, sigma=None,
Whether the input should be converted to Lab colorspace prior to
segmentation. For this purpose, the input is assumed to be RGB. Highly
recommended.
ratio : float, optional
Synonym for `compactness`. This keyword is deprecated.
enforce_connectivity: bool, optional (default False)
Whether the generated segments are connected or not
min_size_factor: float, optional
@@ -112,11 +110,6 @@ def slic(image, n_segments=100, compactness=10., max_iter=10, sigma=None,
warnings.warn('Default value of keyword `sigma` changed from ``1`` '
'to ``0``.')
sigma = 0
if ratio is not None:
warnings.warn('Keyword `ratio` is deprecated. Use `compactness` '
'instead.')
compactness = ratio
if enforce_connectivity is None:
warnings.warn('Deprecation: enforce_connectivity will default to'
' True in future versions.')