用法:
skimage.restoration.denoise_tv_chambolle(image, weight=0.1, eps=0.0002, max_num_iter=200, multichannel=False, *, channel_axis=None)
对 n 维图像执行 total-variation 去噪。
- image:整数、单位或浮点数的 ndarray
输入要降噪的数据。 image 可以是任何数字类型,但它被转换为浮点数的 ndarray 以计算去噪图像。
- weight:浮点数,可选
去噪权重。权重越大,去噪越多(以牺牲输入的保真度为代价)。
- eps:浮点数,可选
确定停止标准的成本函数值的相对差异。算法在以下情况下停止:
(E_(n-1) - E_n) < 每股收益 * E_0
- max_num_iter:int 可选
用于优化的最大迭代次数。
- multichannel:布尔型,可选
对每个通道分别应用total-variation 去噪。这个选项应该适用于彩色图像,否则去噪也适用于通道维度。此参数已弃用:改为指定 channel_axis。
- channel_axis:int 或无,可选
如果为 None,则假定图像是灰度(单通道)图像。否则,此参数指示数组的哪个轴对应于通道。
- out:ndarray
去噪图像。
- multichannel:DEPRECATED
已弃用以支持channel_axis。
- n_iter_max:DEPRECATED
已弃用以支持max_num_iter。
参数:
返回:
其他参数:
注意:
确保为彩色图像设置适当的多通道参数。
全变差去噪的原理在https://en.wikipedia.org/wiki/Total_variation_denoising
全变差去噪的原理是使图像的总变差最小化,可以粗略地说明为图像梯度范数的积分。全变差去噪倾向于产生“cartoon-like”图像,即piecewise-constant图像。
此代码是 Chambolle 在[1] 中提出的 Rudin、Fatemi 和 Osher 算法的实现。
参考:
- 1
A. Chambolle, An algorithm for total variation minimization and applications, Journal of Mathematical Imaging and Vision, Springer, 2004, 20, 89-97.
例子:
宇航员图像上的 2D 示例:
>>> from skimage import color, data >>> img = color.rgb2gray(data.astronaut())[:50, :50] >>> rng = np.random.default_rng() >>> img += 0.5 * img.std() * rng.standard_normal(img.shape) >>> denoised_img = denoise_tv_chambolle(img, weight=60)
合成数据的 3D 示例:
>>> x, y, z = np.ogrid[0:20, 0:20, 0:20] >>> mask = (x - 22)**2 + (y - 20)**2 + (z - 17)**2 < 8**2 >>> mask = mask.astype(float) >>> rng = np.random.default_rng() >>> mask += 0.2 * rng.standard_normal(mask.shape) >>> res = denoise_tv_chambolle(mask, weight=100)
相关用法
- Python skimage.restoration.denoise_wavelet用法及代码示例
- Python skimage.restoration.denoise_bilateral用法及代码示例
- Python skimage.restoration.denoise_nl_means用法及代码示例
- Python skimage.restoration.wiener用法及代码示例
- Python skimage.restoration.cycle_spin用法及代码示例
- Python skimage.restoration.unwrap_phase用法及代码示例
- Python skimage.restoration.estimate_sigma用法及代码示例
- Python skimage.restoration.inpaint_biharmonic用法及代码示例
- Python skimage.restoration.richardson_lucy用法及代码示例
- Python skimage.restoration.calibrate_denoiser用法及代码示例
- Python skimage.restoration.unsupervised_wiener用法及代码示例
- Python skimage.restoration.rolling_ball用法及代码示例
- 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.denoise_tv_chambolle。非经特殊声明,原始代码版权归原作者所有,本译文未经允许或授权,请勿转载或复制。