用法:
skimage.util.label_points(coords, output_shape)
為圖像蒙版上的坐標分配唯一的整數標簽
- coords: ndarray:
維度為 D 的 N 個坐標數組
- output_shape: tuple:
標記坐標的掩碼的形狀
- 標簽: ndarray
在坐標處包含唯一整數標簽的零掩碼
參數:
返回:
注意:
- 標簽分配給轉換為整數並被認為從 0 開始的坐標。
- 超出掩碼範圍的坐標會引發 IndexError
- 負坐標引發ValueError
例子:
>>> 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)
相關用法
- Python skimage.util.view_as_windows用法及代碼示例
- Python skimage.util.montage用法及代碼示例
- Python skimage.util.regular_grid用法及代碼示例
- Python skimage.util.regular_seeds用法及代碼示例
- Python skimage.util.view_as_blocks用法及代碼示例
- Python skimage.util.unique_rows用法及代碼示例
- Python skimage.util.invert用法及代碼示例
- Python skimage.feature.graycomatrix用法及代碼示例
- Python skimage.color.lab2lch用法及代碼示例
- Python skimage.draw.random_shapes用法及代碼示例
- Python skimage.feature.blob_doh用法及代碼示例
- Python skimage.feature.blob_dog用法及代碼示例
- Python skimage.filters.unsharp_mask用法及代碼示例
- Python skimage.registration.optical_flow_tvl1用法及代碼示例
- Python skimage.filters.rank.noise_filter用法及代碼示例
- Python skimage.exposure.histogram用法及代碼示例
- Python skimage.filters.gaussian用法及代碼示例
- Python skimage.feature.graycoprops用法及代碼示例
- Python skimage.segmentation.active_contour用法及代碼示例
- Python skimage.feature.corner_orientations用法及代碼示例
注:本文由純淨天空篩選整理自scikit-image.org大神的英文原創作品 skimage.util.label_points。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。