用法:
skimage.util.montage(arr_in, fill='mean', rescale_intensity=False, grid_shape=None, padding_width=0, multichannel=False, *, channel_axis=None)
創建多個單通道或多通道圖像的蒙太奇。
從一個輸入數組創建一個矩形蒙太奇,該數組表示一組形狀相同的單通道(灰色)或多通道(彩色)圖像。
例如,
montage(arr_in)
用以下方式調用arr_in1
2
3
將返回
1
2
3
其中“*”補丁將由填充參數確定。
- arr_in:(K, M, N[, C]) 數組
一個數組,表示 K 個形狀相同的圖像的集合。
- fill:float 或 array-like of float 或 ‘mean’,可選
填充輸出數組中的填充區域和/或額外圖塊的值。對於單通道集合,必須是浮點數的。對於多通道集合,必須是通道數形狀的array-like。如果均值,則使用所有圖像的平均值。
- rescale_intensity:布爾型,可選
是否將每張圖像的強度重新縮放為 [0, 1]。
- grid_shape:元組,可選
蒙太奇所需的網格形狀(ntiles_row、ntiles_column)。默認縱橫比是正方形。
- padding_width:int 可選
瓦片之間以及瓦片與邊框之間的間距大小。如果非零,則使單個圖像的邊界更容易感知。
- multichannel:布爾值,可選
如果為 True,則最後一個 arr_in 維度被威脅為顏色通道,否則為空間。此參數已棄用:改為指定 channel_axis。
- channel_axis:int 或無,可選
如果為 None,則假定圖像是灰度(單通道)圖像。否則,此參數指示數組的哪個軸對應於通道。
- arr_out:(K*(M+p)+p, K*(N+p)+p[, C])
輸入圖像粘合在一起的輸出數組(包括填充p)。
- multichannel:DEPRECATED
已棄用以支持channel_axis。
參數:
返回:
其他參數:
例子:
>>> import numpy as np >>> from skimage.util import montage >>> arr_in = np.arange(3 * 2 * 2).reshape(3, 2, 2) >>> arr_in array([[[ 0, 1], [ 2, 3]], [[ 4, 5], [ 6, 7]], [[ 8, 9], [10, 11]]]) >>> arr_out = montage(arr_in) >>> arr_out.shape (4, 4) >>> arr_out array([[ 0, 1, 4, 5], [ 2, 3, 6, 7], [ 8, 9, 5, 5], [10, 11, 5, 5]]) >>> arr_in.mean() 5.5 >>> arr_out_nonsquare = montage(arr_in, grid_shape=(1, 3)) >>> arr_out_nonsquare array([[ 0, 1, 4, 5, 8, 9], [ 2, 3, 6, 7, 10, 11]]) >>> arr_out_nonsquare.shape (2, 6)
相關用法
- Python skimage.util.view_as_windows用法及代碼示例
- Python skimage.util.regular_grid用法及代碼示例
- Python skimage.util.label_points用法及代碼示例
- 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.montage。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。