用法:
skimage.transform.resize_local_mean(image, output_shape, grid_mode=True, preserve_range=False, *, channel_axis=None)
使用局部均值/雙線性縮放調整數組大小。
- image:ndarray
輸入圖像。如果這是多通道圖像,則應使用 channel_axis 指定通道對應的軸
- output_shape:可迭代的
生成的輸出圖像的大小。什麽時候channel_axis不是無,channel_axis應該從output_shape或者
output_shape[channel_axis]
必須匹配image.shape[channel_axis]
.如果長度為output_shape超過 image.ndim 額外的單例維度將被附加到輸入image
如所須。- grid_mode:布爾型,可選
定義
image
像素位置:如果為真,則假定像素位於網格交叉點,否則位於單元格中心。因此,例如,長度為 5 的一維信號在以下情況下被認為具有長度 4grid_mode為 False,但長度為 5 時grid_mode是真的。請參見以下視覺示例:| pixel 1 | pixel 2 | pixel 3 | pixel 4 | pixel 5 | |<-------------------------------------->| vs. |<----------------------------------------------->|
上圖中箭頭的起點對應於每種模式下的坐標位置 0。
- preserve_range:布爾型,可選
是否保持原來的取值範圍。否則,輸入圖像將根據以下約定進行轉換img_as_float.另見https://scikit-image.org/docs/dev/user_guide/data_types.html
- resized:ndarray
輸入的調整大小的版本。
參數:
返回:
注意:
此方法有時稱為“area-based” 插值或“pixel mixing” 插值[1].什麽時候grid_mode為 True,相當於使用 OpenCV 的 resize withINTER_AREA插值模式。它通常用於圖像縮小。如果縮小因子是整數,那麽skimage.transform.downscale_local_mean應該是首選。
參考:
例子:
>>> from skimage import data >>> from skimage.transform import resize_local_mean >>> image = data.camera() >>> resize_local_mean(image, (100, 100)).shape (100, 100)
相關用法
- Python skimage.transform.resize用法及代碼示例
- Python skimage.transform.rescale用法及代碼示例
- Python skimage.transform.rotate用法及代碼示例
- Python skimage.transform.hough_circle_peaks用法及代碼示例
- Python skimage.transform.hough_ellipse用法及代碼示例
- 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.ifrt2用法及代碼示例
- Python skimage.transform.hough_line用法及代碼示例
- Python skimage.transform.warp_polar用法及代碼示例
- Python skimage.transform.warp_coords用法及代碼示例
- Python skimage.transform.downscale_local_mean用法及代碼示例
- 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.resize_local_mean。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。