用法:
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。非经特殊声明,原始代码版权归原作者所有,本译文未经允许或授权,请勿转载或复制。