用法:
skimage.restoration.calibrate_denoiser(image, denoise_function, denoise_parameters, *, stride=4, approximate_loss=True, extra_output=False)
校准去噪函数并返回最佳J-invariant版本。
使用为输入图像去噪设置的最佳参数值对返回的函数进行部分评估。
- image:ndarray
要降噪的输入数据(使用img_as_float 转换)。
- denoise_function:函数
要校准的去噪函数。
- denoise_parameters:列表的字典
denoise_function 要校准的参数范围。
- stride:int 可选
用于将denoise_function 转换为J-invariance 的屏蔽过程中使用的步幅。
- approximate_loss:布尔型,可选
是否通过仅在图像的一个蒙版版本上计算来近似用于评估降噪器的 self-supervised 损失。如果为 False,运行时间将是 stride**image.ndim 的一个因子。
- extra_output:布尔型,可选
如果为 True,则返回除校准去噪函数之外的参数和损失
- best_denoise_function:函数
denoise_function 的最佳 J-invariant 版本。
- 如果extra_output为 True,还返回以下元组:
- (parameters_tested, losses):元组(dict 列表,int 列表)
为denoise_function 测试的参数列表,作为parameters_tested 中每组参数的kwargs Self-supervised 损失的字典。
参数:
返回:
注意:
校准过程使用self-supervised mean-square-error 损失来评估denoise_function 的J-invariant 版本的性能。 self-supervised 损失的最小化器也是ground-truth 损失的最小化器(即真正的 MSE 误差)[1]。返回的函数可用于原始噪声图像或具有相似特征的其他图像。
- 增加步幅可以提高性能best_denoise_function
以增加其运行时间为代价。它对校准的运行时间没有影响。
参考:
- 1
J. Batson & L. Royer. Noise2Self: Blind Denoising by Self-Supervision, International Conference on Machine Learning, p. 524-533 (2019).
例子:
>>> from skimage import color, data >>> from skimage.restoration import denoise_wavelet >>> import numpy as np >>> img = color.rgb2gray(data.astronaut()[:50, :50]) >>> rng = np.random.default_rng() >>> noisy = img + 0.5 * img.std() * rng.standard_normal(img.shape) >>> parameters = {'sigma': np.arange(0.1, 0.4, 0.02)} >>> denoising_function = calibrate_denoiser(noisy, denoise_wavelet, ... denoise_parameters=parameters) >>> denoised_img = denoising_function(img)
相关用法
- Python skimage.restoration.cycle_spin用法及代码示例
- 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.calibrate_denoiser。非经特殊声明,原始代码版权归原作者所有,本译文未经允许或授权,请勿转载或复制。