用法:
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。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。