mirror of
https://github.com/wassname/scikit-image.git
synced 2026-07-19 11:27:45 +08:00
Remove deprecated ratio keyword in SLIC
This commit is contained in:
@@ -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.')
|
||||
|
||||
Reference in New Issue
Block a user