Module Import alias identifier ImportFrom alias ImportFrom alias FunctionDef arguments args NameParam NameParam NameParam NameParam defaults Num Num Num body Expr Str If CompareEq AttributeLoad NameLoad attr Num body Return Call NameLoad NameLoad keyword NameLoad keyword NameLoad keyword NameLoad orelse If CompareNotEq AttributeLoad NameLoad attr Num body Raise Call NameLoad BinOpMod Str AttributeLoad NameLoad attr Assign NameStore SubscriptLoad AttributeLoad NameLoad attr Index Num If CompareNotEq NameLoad Num body Expr Call NameLoad BinOpMod Str SubscriptLoad AttributeLoad NameLoad attr Index Num Assign NameStore ListLoad For NameStore Call NameLoad NameLoad body Assign NameStore Call AttributeLoad NameLoad attr SubscriptLoad NameLoad ExtSlice Slice Slice Index NameLoad Assign NameStore Call NameLoad NameLoad keyword NameLoad keyword NameLoad keyword NameLoad Expr Call AttributeLoad NameLoad attr NameLoad Assign NameStore BinOpAdd Call AttributeLoad SubscriptLoad NameLoad Index Num attr Num Assign NameStore BinOpAdd Call AttributeLoad SubscriptLoad NameLoad Index Num attr Num Assign NameStore BinOpAdd BinOpAdd SubscriptLoad NameLoad Index Num BinOpMult SubscriptLoad NameLoad Index Num NameLoad BinOpMult BinOpMult SubscriptLoad NameLoad Index Num NameLoad NameLoad Assign NameStore SubscriptLoad Call AttributeLoad NameLoad attr NameLoad keyword NameLoad Index Num Return Call AttributeLoad NameLoad attr SubscriptLoad AttributeLoad NameLoad attr Slice Num decorator_list
N/A N/A numpy np _shared.utils warn _felzenszwalb_cy _felzenszwalb_grey felzenszwalb N/A N/A image scale sigma min_size N/A 1 0.8 20 N/A N/A Computes Felsenszwalb's efficient graph based image segmentation.

    Produces an oversegmentation of a multichannel (i.e. RGB) image
    using a fast, minimum spanning tree based clustering on the image grid.
    The parameter ``scale`` sets an observation level. Higher scale means
    less and larger segments. ``sigma`` is the diameter of a Gaussian kernel,
    used for smoothing the image prior to segmentation.

    The number of produced segments as well as their size can only be
    controlled indirectly through ``scale``. Segment size within an image can
    vary greatly depending on local contrast.

    For RGB images, the algorithm computes a separate segmentation for each
    channel and then combines these. The combined segmentation is the
    intersection of the separate segmentations on the color channels.

    Parameters
    ----------
    image : (width, height, 3) or (width, height) ndarray
        Input image.
    scale : float
        Free parameter. Higher means larger clusters.
    sigma : float
        Width of Gaussian kernel used in preprocessing.
    min_size : int
        Minimum component size. Enforced using postprocessing.

    Returns
    -------
    segment_mask : (width, height) ndarray
        Integer mask indicating segment labels.

    References
    ----------
    .. [1] Efficient graph-based image segmentation, Felzenszwalb, P.F. and
           Huttenlocher, D.P.  International Journal of Computer Vision, 2004
     N/A N/A N/A image ndim 2 N/A N/A N/A _felzenszwalb_grey image scale scale sigma sigma min_size min_size N/A N/A N/A N/A image ndim 3 N/A N/A N/A ValueError N/A Felzenswalb segmentation can only operate on RGB and grey images, but input array of ndim %d given. N/A image ndim N/A n_channels N/A N/A image shape N/A 2 N/A N/A n_channels 3 N/A N/A N/A warn N/A Got image with %d channels. Is that really what you wanted? N/A N/A image shape N/A 2 N/A segmentations N/A N/A c N/A range n_channels N/A N/A channel N/A N/A np ascontiguousarray N/A image N/A N/A N/A N/A c N/A s N/A _felzenszwalb_grey channel scale scale sigma sigma min_size min_size N/A N/A N/A segmentations append s N/A n0 N/A N/A N/A N/A segmentations N/A 0 max 1 N/A n1 N/A N/A N/A N/A segmentations N/A 1 max 1 N/A segmentation N/A N/A N/A segmentations N/A 0 N/A N/A segmentations N/A 1 n0 N/A N/A N/A segmentations N/A 2 n0 n1 N/A labels N/A N/A N/A np unique segmentation return_inverse True N/A 1 N/A N/A N/A labels reshape N/A N/A image shape N/A 2 N/A