bundles / skimage 0.26.1rc0.dev0+git20260530.b607368ff / skimage / util / _label / label_points
function
skimage.util._label:label_points
source: /dev/scikit-image/src/skimage/util/_label.py :6
Signature
def label_points ( coords , output_shape ) Summary
Assign unique integer labels to coordinates on an image mask
Parameters
coords: ndarrayAn array of N coordinates with dimension D
output_shape: tupleThe shape of the mask on which
coordsare labelled
Returns
labels: ndarray of dtype intA mask of zeroes containing unique integer labels at the
coords.
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
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✓
Aliases
-
skimage.util.label_points