显微镜图像处理(优化)-图像去噪算法比对

本篇文章介绍三种图像去噪算法,分别为:高斯滤波去噪、中值滤波去噪、非局部均值滤波器去噪
在显微镜图像处理技术中,去噪是非常重要的图像优化手段,不管我们是用何种电子显微镜拍摄出来的图像,都会或多或少的存在图像噪声,需要一种技术,能够将拍摄出来的图像去除噪声,并且在去除噪声的同时能够保留或者优化图像纹理细节。

噪声图像

高斯滤波去噪

代码

python 复制代码
from skimage import img_as_ubyte, img_as_float
from scipy import ndimage as nd
from matplotlib import pyplot as plt
img = img_as_float(io.imread("images/denoising/noisy_img.jpg"))
gaussian_img = nd.gaussian_filter(img, sigma=3)
plt.imsave("images/gaussian.jpg", gaussian_img)

效果

高斯滤波去噪效果

中值滤波去噪

代码

python 复制代码
from skimage import img_as_ubyte, img_as_float
from scipy import ndimage as nd
from matplotlib import pyplot as plt
img = img_as_float(io.imread("images/denoising/noisy_img.jpg"))
median_img = nd.median_filter(img, size=3)
plt.imsave("images/median.jpg", median_img)

效果

中值滤波去噪效果

非局部均值去噪

代码

python 复制代码
from skimage.restoration import denoise_nl_means, estimate_sigma
from skimage import img_as_ubyte, img_as_float
from skimage import io
from scipy import ndimage as nd
from matplotlib import pyplot as plt
img = img_as_float(io.imread("images/denoising/noisy_img.jpg"))
sigma_est = np.mean(estimate_sigma(img, multichannel=True))
patch_kw = dict(patch_size=5,      
                patch_distance=3,  
                multichannel=True)
denoise_img = denoise_nl_means(img, h=1.15 * sigma_est, fast_mode=False,
                               patch_size=5, patch_distance=3, multichannel=True)
# denoise_img_as_8byte = img_as_ubyte(denoise_img)
plt.imsave("images/NLM.jpg",denoise_img)

效果

非局部均值去噪效果

核型分析随堂小测

下面是使用非局部均值的去噪效果

原图

去噪图

可以看到细节提升非常的明显,就像原图上蒙了一层布,去噪算法将这层布给移除掉了。并且保留了条带细节,需要后续多传一些图进入去噪函数,看这种针对原图细节优化的算法是否对所有核型图都具有普遍性。

相关推荐
YuTaoShao3 小时前
【LeetCode 热题 100】141. 环形链表——快慢指针
java·算法·leetcode·链表
小小小新人121234 小时前
C语言 ATM (4)
c语言·开发语言·算法
你的冰西瓜4 小时前
C++排序算法全解析(加强版)
c++·算法·排序算法
এ᭄画画的北北5 小时前
力扣-31.下一个排列
算法·leetcode
绝无仅有6 小时前
企微审批对接错误与解决方案
后端·算法·架构
用户5040827858396 小时前
1. RAG 权威指南:从本地实现到生产级优化的全面实践
算法
Python×CATIA工业智造8 小时前
详细页智能解析算法:洞悉海量页面数据的核心技术
爬虫·算法·pycharm
无聊的小坏坏8 小时前
力扣 239 题:滑动窗口最大值的两种高效解法
c++·算法·leetcode
黎明smaly8 小时前
【排序】插入排序
c语言·开发语言·数据结构·c++·算法·排序算法