用法:
skimage.restoration.cycle_spin(x, func, max_shifts, shift_steps=1, num_workers=None, multichannel=False, func_kw={}, *, channel_axis=- 1)
循環旋轉(重複將 func 應用於 x 的移位版本)。
- x:array-like
輸入到
func
的數據。- func:函數
適用於
x
的循環移位版本的函數。應該將x
作為它的第一個參數。可以通過func_kw
提供任何其他參數。- max_shifts:int 或元組
如果是整數,將沿
x
的每個軸使用range(0, max_shifts+1)
中的移位。如果是元組,range(0, max_shifts[i]+1)
將沿著 i 軸。- shift_steps:int 或元組,可選
沿軸 i 應用的移位的步長為::
range((0, max_shifts[i]+1, shift_steps[i]))
。如果提供整數,則所有軸使用相同的步長。- num_workers:int 或無,可選
在循環旋轉期間使用的並行線程數。如果設置為
None
,則使用完整的可用內核集。- multichannel:布爾型,可選
是否將最終軸視為通道(在通道軸上不執行循環移位)。不推薦使用此參數:改為指定 channel_axis。
- func_kw:字典,可選
要提供給
func
的其他關鍵字參數。- channel_axis:int 或無,可選
如果為 None,則假定圖像是灰度(單通道)圖像。否則,此參數指示數組的哪個軸對應於通道。
- avg_y:np.ndarray
func(x, **func_kw)
的輸出對指定軸偏移的所有組合進行平均。
- multichannel:DEPRECATED
已棄用以支持channel_axis。
參數:
返回:
其他參數:
注意:
循環旋轉被提議作為一種通過執行 shift-variant 變換 [1] 的幾個循環移位來接近移位不變性的方法。
對於 n-level 離散小波變換,可能希望執行所有移位直到
max_shifts = 2**n - 1
。在實踐中,很多好處通常可以通過每個軸的少量移位來實現。對於諸如逐塊離散餘弦變換之類的變換,人們可能希望將移位評估為變換使用的塊大小。
參考:
- 1
R.R. Coifman and D.L. Donoho. “Translation-Invariant De-Noising”. Wavelets and Statistics, Lecture Notes in Statistics, vol.103. Springer, New York, 1995, pp.125-150. DOI:10.1007/978-1-4612-2544-7_9
例子:
>>> import skimage.data >>> from skimage import img_as_float >>> from skimage.restoration import denoise_wavelet, cycle_spin >>> img = img_as_float(skimage.data.camera()) >>> sigma = 0.1 >>> img = img + sigma * np.random.standard_normal(img.shape) >>> denoised = cycle_spin(img, func=denoise_wavelet, ... max_shifts=3)
相關用法
- Python skimage.restoration.calibrate_denoiser用法及代碼示例
- Python skimage.restoration.denoise_wavelet用法及代碼示例
- Python skimage.restoration.wiener用法及代碼示例
- Python skimage.restoration.unwrap_phase用法及代碼示例
- Python skimage.restoration.estimate_sigma用法及代碼示例
- Python skimage.restoration.inpaint_biharmonic用法及代碼示例
- Python skimage.restoration.denoise_tv_chambolle用法及代碼示例
- Python skimage.restoration.denoise_bilateral用法及代碼示例
- Python skimage.restoration.richardson_lucy用法及代碼示例
- Python skimage.restoration.unsupervised_wiener用法及代碼示例
- Python skimage.restoration.rolling_ball用法及代碼示例
- Python skimage.restoration.denoise_nl_means用法及代碼示例
- Python skimage.registration.optical_flow_tvl1用法及代碼示例
- Python skimage.registration.optical_flow_ilk用法及代碼示例
- 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用法及代碼示例
注:本文由純淨天空篩選整理自scikit-image.org大神的英文原創作品 skimage.restoration.cycle_spin。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。