




版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
1、图片去噪:对一幅图像加入不同的噪声(随机点噪声、椒盐噪声等),选取不同的方法去噪,比如说邻域平均、中值滤波、图像迭加等,比较对于不同的噪声,不同的方法哪种更好。A加入随机点噪声进行邻域平均、中值滤波、图像迭加邻域平均>> I=imread('D:gem.bmp');>> snoise=0.1*randn(size(I);>> J1=imadd(I,im2uint8(snoise); % 受随机噪声干扰>> M4=0 1 0; 1 0 1; 0 1 0;>> M4=M4/4; % 4邻域平均滤波>> I_fi
2、lter1=filter2(M4,J1);>> M8=1 1 1; 1 0 1; 1 1 1; % 8邻域平均滤波>> M8=M8/8;>> I_filter2=filter2(M8,J1);>> subplot(2,2,1),imshow(I);title('原始图像 Gem');>> subplot(2,2,2),imshow(J1);title('加随机噪声后图像');>> subplot(2,2,3),imshow(I_filter1,map);title('4邻域平均滤波&
3、#39;);>> subplot(2,2,4),imshow(I_filter2,map);title('8邻域平均滤波');均值滤波>> G=imread('D:gem.bmp');>> I=rgb2gray(G);>> snoise=0.1*randn(size(I);>> A=imadd(I,im2uint8(snoise);>> B1=filter2(fspecial('average',3),A)/255;>> B2=filter2(fspecial(&
4、#39;average',5),A)/255;>> B3=filter2(fspecial('average',10),A)/255;>> subplot(2,2,1),imshow(A);title('加随机噪声后图像');>> subplot(2,2,2),imshow(B1);title('平均3后图像');>> subplot(2,2,3),imshow(B2);title('平均5后图像');>> subplot(2,2,4),imshow(B3);ti
5、tle('平均10后图像'); 原图B .加入椒盐噪声进行邻域平均、中值滤波、图像迭加邻域平均>>I=imread('moon.tif');>>J=imnoise(I,'salt & pepper',0.02); >>subplot(1,2,1),imshow(I);title('原图');>>subplot(1,2,2),imshow(J);title('加噪');>>K1=filter2(fspecial('average',7
6、),J);>>K2=filter2(fspecial('average',9),J);>>figure,subplot(1,2,1),imshow(uint8(K1);title('3x3');>> subplot(1,2,2),imshow(uint8(K1);title('5x5')>>subplot(1,2,1),imshow(uint8(K1);title('7x7');>>subplot(1,2,2),imshow(uint8(K1);title('9x
7、9')中值滤波>>I=imread('moon.tif');>>J=imnoise(I,'salt & pepper',0.02);>>K1=medfilt2(J);>> K2=medfilt2(J,5 5);>> K3=medfilt2(J,7 7);>>K4=medfilt2(J,9 9);>> subplot(1,2,1),imshow(K1);title('3x3');>> subplot(1,2,2),imshow(K2);t
8、itle('5x5');>>subplot(1,2,1),imshow(K3);title('7x7');>>subplot(1,2,2),imshow(K4);title('9x9');C.加入高斯噪声进行邻域平均、中值滤波、图像迭加邻域平均>> G=imread('D:gem.bmp');>> I=rgb2gray(G);>> J1=imnoise(I,'gaussian',0,0.02); % 受高斯噪声干扰>> M4=0 1 0; 1
9、0 1; 0 1 0;>> M4=M4/4; % 4邻域平均滤波>> I_filter1=filter2(M4,J1);>> M8=1 1 1; 1 0 1; 1 1 1; % 8邻域平均滤波>> M8=M8/8;>> I_filter2=filter2(M8,J1);>> subplot(2,2,1),imshow(I);title('原始图像 Gem');>> subplot(2,2,2),imshow(J1);title('加高斯噪声后图像');>> subpl
10、ot(2,2,3),imshow(I_filter1,map);title('4邻域平均滤波');>> subplot(2,2,4),imshow(I_filter2,map);title('8邻域平均滤波');>> subplot(2,2,3),imshow(B2);title('平均5后图像');>> subplot(2,2,4),imshow(B3);title('平均7后图像');均值滤波>> I=imread('D:gem.bmp');>> A=
11、imnoise(I,'gaussian',0.01);>> B1=filter2(fspecial('average',3),A)/255;>> B2=filter2(fspecial('average',5),A)/255;>> B3=filter2(fspecial('average',7),A)/255;>> subplot(2,2,1),imshow(A);title('加高斯噪声后图像');>> subplot(2,2,2),imshow(B1)
12、;title('平均3后图像');>> subplot(2,2,3),imshow(B2);title('平均5后图像');>> subplot(2,2,4),imshow(B3);title('平均7后图像');D.图像迭加滤波 >>I=imread('pout.tif');>> m n=size(I);>>J1(m,n)=0;J2(m,n)=0;J3(m,n)=0;>>for i=1:10 temp=imnoise(I,'gaussian',0,0.01); J1=J1+double(temp)/10;end>>for i=1:20 temp=imnoise(I,'gaussian',0,0.01); J2=J2+double(temp)/20;end>>for i=1:50 temp=imnoise(I,'gaussian',0,0.01); J3=J3+double(temp)/50;end>>figure;subplot(2,2,1),imshow(I),title('原图象');
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 如何有效记录工作进度计划
- 仓库货物拆零与分拣管理策略计划
- 2025年路面清洁装备合作协议书
- 如何制定品牌宣传计划
- 2025年优良动植物新品种项目合作计划书
- 班主任与学科教师协作计划
- 2025年钴粉系列合作协议书
- 2025年中国页岩气行业市场现状及投资态势分析报告(智研咨询)
- 2025年气体掺混设备合作协议书
- 2025年动叶可调轴流电站用风机项目发展计划
- 铁路专用线设计规范(试行)(TB 10638-2019)
- 潍坊环境工程职业学院单招职业技能测试参考试题库(含答案)
- 《初三毕业班开学第一课:收心及中考冲刺》班会课件
- 2024年山东司法警官职业学院高职单招(英语/数学/语文)笔试历年参考题库含答案解析
- 新生儿转运护理安全管理课件
- 华为公司煤矿智能化远景培训课件2024
- 物业客服课件培训模板
- 人教版PEP四年级英语下册全册教学设计表格教案
- 制造业面临的挑战与发展对策
- 医院智慧病房信息化建设
- 中考语文一轮专题复习:《现代文阅读的命题特点及教学策略》课件
评论
0/150
提交评论