本文簡要介紹 python 語言中 scipy.ndimage.standard_deviation
的用法。
用法:
scipy.ndimage.standard_deviation(input, labels=None, index=None)#
計算N-D 圖像數組的值的標準偏差,可選地在指定的sub-regions。
- input: array_like
N-D 要處理的圖像數據。
- labels: 數組,可選
在輸入中標識sub-regions 的標簽。如果不是無,則必須與輸入的形狀相同。
- index: int 或整數序列,可選
要包含在輸出中的標簽。如果無(默認),則使用標簽非零的所有值。
- standard_deviation: 浮點數或 ndarray
如果指定了標簽和索引,則為每個 sub-region 的標準偏差值。
參數 ::
返回 ::
例子:
>>> import numpy as np >>> a = np.array([[1, 2, 0, 0], ... [5, 3, 0, 4], ... [0, 0, 0, 7], ... [9, 3, 0, 0]]) >>> from scipy import ndimage >>> ndimage.standard_deviation(a) 2.7585095613392387
可以使用標簽和索引指定要處理的特征:
>>> lbl, nlbl = ndimage.label(a) >>> ndimage.standard_deviation(a, lbl, index=np.arange(1, nlbl+1)) array([ 1.479, 1.5 , 3. ])
如果沒有給出索引,則處理非零標簽:
>>> ndimage.standard_deviation(a, lbl) 2.4874685927665499
相關用法
- Python SciPy ndimage.spline_filter用法及代碼示例
- Python SciPy ndimage.shift用法及代碼示例
- Python SciPy ndimage.sum_labels用法及代碼示例
- Python SciPy ndimage.sobel用法及代碼示例
- Python SciPy ndimage.spline_filter1d()用法及代碼示例
- Python SciPy ndimage.spline_filter1d用法及代碼示例
- Python SciPy ndimage.correlate用法及代碼示例
- Python SciPy ndimage.morphological_gradient用法及代碼示例
- Python SciPy ndimage.variance用法及代碼示例
- Python SciPy ndimage.correlate1d用法及代碼示例
- Python SciPy ndimage.binary_dilation用法及代碼示例
- Python SciPy ndimage.distance_transform_bf用法及代碼示例
- Python SciPy ndimage.find_objects用法及代碼示例
- Python SciPy ndimage.label用法及代碼示例
- Python SciPy ndimage.maximum_filter1d用法及代碼示例
- Python SciPy ndimage.iterate_structure用法及代碼示例
- Python SciPy ndimage.map_coordinates()用法及代碼示例
- Python SciPy ndimage.generic_laplace用法及代碼示例
- Python SciPy ndimage.generate_binary_structure用法及代碼示例
- Python SciPy ndimage.binary_opening用法及代碼示例
- Python SciPy ndimage.binary_fill_holes用法及代碼示例
- Python SciPy ndimage.maximum_filter用法及代碼示例
- Python SciPy ndimage.minimum_position用法及代碼示例
- Python SciPy ndimage.labeled_comprehension用法及代碼示例
- Python SciPy ndimage.grey_erosion用法及代碼示例
注:本文由純淨天空篩選整理自scipy.org大神的英文原創作品 scipy.ndimage.standard_deviation。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。