scikit-image库--图像去噪(八)

偏执的太偏执、 2021-10-18 17:28 653阅读 0赞

图像去噪

在本例中,使用总变化、双边和小波去噪滤波器对图像的噪声版本进行去噪。
全变分法和双边算法通常产生“后验”图像,其平面域由锐边分隔。通过控制去噪和对原始图像的忠实之间的权衡,可以改变后验的程度。

总变化滤波器(Total variation filter)

该滤波器的结果是一个具有最小总变化范数的图像,同时尽可能接近初始图像。总变化是图像梯度的l1范数。

双边滤波器(Bilateral filter)

双边滤波器是一种边缘保持和降噪滤波器。它根据像素的空间相似性和辐射相似性来平均像素。

小波去噪滤波器(Wavelet denoising filter)

小波去噪滤波器依赖于图像的小波表示。在小波域中,噪声用小值表示,小值设为0。
在彩色图像中,小波去噪通常在YCBCR颜色空间中进行,因为在单独的颜色通道中去噪可能会导致更明显的噪声。

  1. import matplotlib.pyplot as plt
  2. from skimage.restoration import (denoise_tv_chambolle, denoise_bilateral,
  3. denoise_wavelet, estimate_sigma)
  4. from skimage import data, img_as_float
  5. from skimage.util import random_noise
  6. original = img_as_float(data.chelsea()[100:250, 50:300])
  7. sigma = 0.155
  8. noisy = random_noise(original, var=sigma**2)
  9. fig, ax = plt.subplots(nrows=2, ncols=4, figsize=(18, 8),
  10. sharex=True, sharey=True)
  11. plt.gray()
  12. # Estimate the average noise standard deviation across color channels.
  13. sigma_est = estimate_sigma(noisy, multichannel=True, average_sigmas=True)
  14. # Due to clipping in random_noise, the estimate will be a bit smaller than the
  15. # specified sigma.
  16. print("Estimated Gaussian noise standard deviation = {}".format(sigma_est))
  17. ax[0, 0].imshow(noisy)
  18. ax[0, 0].axis('off')
  19. ax[0, 0].set_title('Noisy')
  20. ax[0, 1].imshow(denoise_tv_chambolle(noisy, weight=0.1, multichannel=True))
  21. ax[0, 1].axis('off')
  22. ax[0, 1].set_title('TV')
  23. ax[0, 2].imshow(denoise_bilateral(noisy, sigma_color=0.05, sigma_spatial=15,
  24. multichannel=True))
  25. ax[0, 2].axis('off')
  26. ax[0, 2].set_title('Bilateral')
  27. ax[0, 3].imshow(denoise_wavelet(noisy, multichannel=True))
  28. ax[0, 3].axis('off')
  29. ax[0, 3].set_title('Wavelet denoising')
  30. ax[1, 1].imshow(denoise_tv_chambolle(noisy, weight=0.2, multichannel=True))
  31. ax[1, 1].axis('off')
  32. ax[1, 1].set_title('(more) TV')
  33. ax[1, 2].imshow(denoise_bilateral(noisy, sigma_color=0.1, sigma_spatial=15,
  34. multichannel=True))
  35. ax[1, 2].axis('off')
  36. ax[1, 2].set_title('(more) Bilateral')
  37. ax[1, 3].imshow(denoise_wavelet(noisy, multichannel=True, convert2ycbcr=True))
  38. ax[1, 3].axis('off')
  39. ax[1, 3].set_title('Wavelet denoising\nin YCbCr colorspace')
  40. ax[1, 0].imshow(original)
  41. ax[1, 0].axis('off')
  42. ax[1, 0].set_title('Original')
  43. fig.tight_layout()
  44. plt.show()

在这里插入图片描述

发表评论

表情:
评论列表 (有 0 条评论,653人围观)

还没有评论,来说两句吧...

相关阅读

    相关 多种滤波器实现图像

    多种滤波器实现图像去噪 图像去噪是数字图像处理中非常重要的一个问题,因为图像中噪声会影响到图像的质量和信息的提取。为了解决这个问题,研究人员提出了很多的去噪算法,其中最常用的

    相关 自编码器图像

    自编码器(AutoEncoder)是深度学习中的一类无监督学习模型,由 encoder 和 decoder 两部分组成。 • encoder 将原始表示编码成隐层表示;

    相关

    平滑去噪(低通滤波器) 噪声的产生是因为图像中的某些像素的灰度值发生了突变,使得和周围区域不和谐。除噪其实去除高频噪声,使得图像中的噪声像素的灰度值不那么突兀。 噪声去

    相关 数字图像MATLAB

    图像去噪是数字图像处理中的重要环节和步骤。去噪效果的好坏直接影响到后续的图像处理工作如图像分割、边缘检测等。图像信号在产生、传输过程中都可能会受到噪声的污染,一般数字图像系统中