Welcome To Our Shell

Mister Spy & Souheyl Bypass Shell

Current Path : /proc/thread-self/root/usr/local/lib/python3.8/dist-packages/skimage/util/

Linux ift1.ift-informatik.de 5.4.0-216-generic #236-Ubuntu SMP Fri Apr 11 19:53:21 UTC 2025 x86_64
Upload File :
Current File : //proc/thread-self/root/usr/local/lib/python3.8/dist-packages/skimage/util/_label.py

import numpy as np

__all__ = ["label_points"]


def label_points(coords, output_shape):
    """Assign unique integer labels to coordinates on an image mask

    Parameters
    ----------
    coords: ndarray
        An array of N coordinates with dimension D
    output_shape: tuple
        The shape of the mask on which `coords` are labelled

    Returns
    -------
    labels: ndarray
        A mask of zeroes containing unique integer labels at the `coords`

    Examples
    --------
    >>> import numpy as np
    >>> from skimage.util._label import label_points
    >>> coords = np.array([[0, 1], [2, 2]])
    >>> output_shape = (5, 5)
    >>> mask = label_points(coords, output_shape)
    >>> mask
    array([[0, 1, 0, 0, 0],
           [0, 0, 0, 0, 0],
           [0, 0, 2, 0, 0],
           [0, 0, 0, 0, 0],
           [0, 0, 0, 0, 0]], dtype=uint64)

    Notes
    -----
    - The labels are assigned to coordinates that are converted to
      integer and considered to start from 0.
    - Coordinates that are out of range of the mask raise an IndexError.
    - Negative coordinates raise a ValueError
    """
    if coords.shape[1] != len(output_shape):
        raise ValueError("Dimensionality of points should match the "
                         "output shape")

    if np.any(coords < 0):
        raise ValueError("Coordinates should be positive and start from 0")

    np_indices = tuple(np.transpose(np.round(coords).astype(int, copy=False)))
    labels = np.zeros(output_shape, dtype=np.uint64)
    labels[np_indices] = np.arange(1, coords.shape[0] + 1)
    return labels

bypass 1.0, Devloped By El Moujahidin (the source has been moved and devloped)
Email: contact@elmoujehidin.net bypass 1.0, Devloped By El Moujahidin (the source has been moved and devloped) Email: contact@elmoujehidin.net