Matlab数字图像处理尝试之:[7]邻域中值
来源:网络收集 点击: 时间:2024-05-28计算去噪前后的峰值信噪比,做出主观和客观评价。
1),邻域平均化法:
clear all;
I=imread(C:\Users\zjy\Desktop\test1.tif);
subplot(2,3,1),imshow(I);
xlabel(a)原始图像);
J=imnoise(I,gaussian,0,0.025);
subplot(2,3,2),imshow(J);
xlabel(b)添加白噪声);
K=imnoise(I,salt pepper,0.025);
subplot(2,3,3),imshow(K);
xlabel(b)添加椒盐噪声);
subplot(2,3,4)
subplot(2,3,4),imshow(I);
xlabel(a)原始图像);
h=;
h=h/8;
J1=conv2(J,h);
subplot(2,3,5),imshow(J1,);
xlabel(邻域平均除白噪声);
K1=conv2(K,h);
subplot(2,3,6),imshow(K1,);
xlabel(邻域平均除椒盐噪声);
以上程序段实现了用邻域平均化去除高斯白噪声和椒盐噪声,效果如下图所示。

从上图可以看出,邻域平均法对高斯白噪声的消除效果比较好,对椒盐噪声的消除效果不理想。
3/42),中值滤波法:
clear all;
I=imread(C:\Users\zjy\Desktop\test1.tif);
subplot(2,3,1),imshow(I);
xlabel(a)原始图像);
J=imnoise(I,gaussian,0,0.025);
subplot(2,3,2),imshow(J);
xlabel(b)添加白噪声);
K=imnoise(I,salt pepper,0.025);
subplot(2,3,3),imshow(K);
xlabel(b)添加椒盐噪声);
subplot(2,3,4)
subplot(2,3,4),imshow(I);
xlabel(a)原始图像);
J1=medfilt2(J);
subplot(2,3,5),imshow(J1,);
xlabel(中值滤波除白噪声);
J2=medfilt2(K);
subplot(2,3,6),imshow(J2,);
xlabel(中值滤波除椒盐噪声);
以上程序段实现了用邻域平均化去除高斯白噪声和椒盐噪声,效果如下图所示。

从上图可以看出,中值滤波法对高斯白噪声如果用5*5窗口滤波效果好于3*3窗口滤波窗口,但图像模糊会加重。中值滤波法对椒盐噪声的消除效果很理想。
邻域中值版权声明:
1、本文系转载,版权归原作者所有,旨在传递信息,不代表看本站的观点和立场。
2、本站仅提供信息发布平台,不承担相关法律责任。
3、若侵犯您的版权或隐私,请联系本站管理员删除。
4、文章链接:http://www.1haoku.cn/art_851405.html