用法:
skimage.transform.downscale_local_mean(image, factors, cval=0, clip=True)
Down-sample N維圖像通過局部平均。
如果圖像不能被整數因子完全整除,則用 cval 填充圖像。
與插值相反skimage.transform.resize和skimage.transform.rescale此函數計算每個大小塊中元素的局部平均值因子在輸入圖像中。
- image:ndarray
N維輸入圖像。
- factors:array_like
包含沿每個軸的下采樣整數因子的數組。
- cval:浮點數,可選
如果圖像不能被整數因子完全整除,則為常量填充值。
- clip:布爾型,可選
未使用,但保留在此處以與此模塊中的其他轉換保持 API 一致性。 (假設提供的 cval 也在該範圍內,則局部平均值永遠不會超出輸入圖像中的值範圍。)
- image:ndarray
與輸入圖像具有相同維度的下采樣圖像。對於整數輸入,輸出 dtype 將為
float64
。有關詳細信息,請參閱numpy.mean()
參數:
返回:
例子:
>>> a = np.arange(15).reshape(3, 5) >>> a array([[ 0, 1, 2, 3, 4], [ 5, 6, 7, 8, 9], [10, 11, 12, 13, 14]]) >>> downscale_local_mean(a, (2, 3)) array([[3.5, 4. ], [5.5, 4.5]])
相關用法
- Python skimage.transform.hough_circle_peaks用法及代碼示例
- Python skimage.transform.hough_ellipse用法及代碼示例
- Python skimage.transform.resize用法及代碼示例
- Python skimage.transform.hough_line_peaks用法及代碼示例
- Python skimage.transform.integrate用法及代碼示例
- Python skimage.transform.frt2用法及代碼示例
- Python skimage.transform.estimate_transform用法及代碼示例
- Python skimage.transform.hough_circle用法及代碼示例
- Python skimage.transform.rotate用法及代碼示例
- Python skimage.transform.rescale用法及代碼示例
- Python skimage.transform.ifrt2用法及代碼示例
- Python skimage.transform.resize_local_mean用法及代碼示例
- Python skimage.transform.hough_line用法及代碼示例
- Python skimage.transform.warp_polar用法及代碼示例
- Python skimage.transform.warp_coords用法及代碼示例
- Python skimage.transform.warp用法及代碼示例
- Python skimage.feature.graycomatrix用法及代碼示例
- Python skimage.color.lab2lch用法及代碼示例
- Python skimage.draw.random_shapes用法及代碼示例
- Python skimage.feature.blob_doh用法及代碼示例
注:本文由純淨天空篩選整理自scikit-image.org大神的英文原創作品 skimage.transform.downscale_local_mean。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。