bundles / skimage 0.26.1rc0.dev0+git20260530.b607368ff / skimage / segmentation / _quickshift / quickshift
function
skimage.segmentation._quickshift:quickshift
source: /dev/scikit-image/src/skimage/segmentation/_quickshift.py :10
Signature
def quickshift ( image , ratio = 1.0 , kernel_size = 5 , max_dist = 10 , return_tree = False , sigma = 0 , convert2lab = True , rng = 42 , * , channel_axis = -1 ) Summary
Segment image using quickshift clustering in Color-(x,y) space.
Extended Summary
Produces an oversegmentation of the image using the quickshift mode-seeking algorithm.
Parameters
image: ndarray of shape (M, N, C)Input image. The axis corresponding to color channels can be specified via the
channel_axisargument.ratio: float, optional, between 0 and 1Balances color-space proximity and image-space proximity. Higher values give more weight to color-space.
kernel_size: float, optionalWidth of Gaussian kernel used in smoothing the sample density. Higher means fewer clusters.
max_dist: float, optionalCut-off point for data distances. Higher means fewer clusters.
return_tree: bool, optionalWhether to return the full segmentation hierarchy tree and distances.
sigma: float, optionalWidth for Gaussian smoothing as preprocessing. Zero means no smoothing.
convert2lab: bool, optionalWhether the input should be converted to Lab colorspace prior to segmentation. For this purpose, the input is assumed to be RGB.
rng: {`numpy.random.Generator`, int}, optionalPseudo-random number generator. By default, a PCG64 generator is used (see numpy.random.default_rng). If
rngis an int, it is used to seed the generator.The PRNG is used to break ties, and is seeded with 42 by default.
channel_axis: int, optionalThe axis of
imagecorresponding to color channels. Defaults to the last axis.
Returns
segment_mask: ndarray of shape (M, N) and dtype intInteger mask indicating segment labels.
Notes
The authors advocate to convert the image to Lab color space prior to segmentation, though this is not strictly necessary. For this to work, the image must be given in RGB format.
Aliases
-
skimage.segmentation.quickshift