當前位置: 首頁>>編程示例 >>用法及示例精選 >>正文


Python skimage.util.regular_seeds用法及代碼示例

用法:

skimage.util.regular_seeds(ar_shape, n_points, dtype=<class 'int'>)

返回具有 ~`n_points` regularly-spaced 非零像素的圖像。

參數

ar_shapeint 的元組

所需輸出圖像的形狀。

n_pointsint

所需的非零點數。

dtypenumpy 數據類型,可選

所需的輸出數據類型。

返回

seed_imgint 或布爾數組

所需的圖像。

例子

>>> regular_seeds((5, 5), 4)
array([[0, 0, 0, 0, 0],
       [0, 1, 0, 2, 0],
       [0, 0, 0, 0, 0],
       [0, 3, 0, 4, 0],
       [0, 0, 0, 0, 0]])

相關用法


注:本文由純淨天空篩選整理自scikit-image.org大神的英文原創作品 skimage.util.regular_seeds。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。