数字图像处理实验报告图像复原实验_第1页
数字图像处理实验报告图像复原实验_第2页
数字图像处理实验报告图像复原实验_第3页
数字图像处理实验报告图像复原实验_第4页
数字图像处理实验报告图像复原实验_第5页
已阅读5页,还剩13页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

1、课程名称 专业班级:字像处理导论名 号 电气与信息学陵和谐勤奋求是创新实验题目图像复原实验-空域滤波复原实验室dsp室&信号室实验时间2015 年 10 月 13 口实验类别设计同组人数2成绩指导教师签字:一. 实验目的1. 掌握图像滤波的基本定义及0的。2. 理解空间域滤波的基本原理及方法。3. 掌握进行图像的空域滤波的方法。二. 实验内容1. 读岀eighltif这幅图像,给这幅图像分别加入椒盐噪声和高斯噪声后并与前一张图显示在同一图 像窗口中。2. 对加入噪声图像选用不同的平滑(低通)模板做运算,对比不同模板所形成的效果,要求在同 一窗口中显示。3. 使用函数imfdter时,分

2、别采用不同的填充方法(或边界选项,如零填 充、replicate、symmetric、circular)进行低通滤波,显示处理后的图像。4. 运用for循环,将加有椒盐噪声的图像进行10次,20次均值滤波,查看其特点,显示均值处理后 的图像(提示:利用fspecial函数的average类型生成均值滤波器)。5. 对加入椒盐噪声的图像分别采用均值滤波法,和中值滤波法对有噪声的图像做处理,要求在同 一窗口中显示结果。6. 自己设计平滑空间滤波器,并将其对噪声阁像进行处理,显示处理后的阁像。三. 实验具体实现1. 读出(自己选定.tif)这幅图像,给这幅图像分别加入椒盐噪声和高斯噪声后并与前一张图

3、显示 在同一阁像窗口屮。i=imread(,trees, tif); subplot (1,3, 1) inishow(t);title( original image );j = imnoised, * salt & pepper,0. 05) ; %noise density=0. 05 subplot (1, 3, 2) imshow(j);titlesalt & pepper );k= imnoise(i, gaussian,0. 01, 0. 01); subplot (1, 3, 3)imshow(k);title( gaussian )2. 对加入噪声图像选用不同

4、的平滑(低通)模板做运算,对比不同模板所形成的效果,要求在同 一'窗口中显不。i=imread(,moon, tif);h = fspecial ( sobel); subplot (2, 2, 1) imshow(t);titlec original image );sobel 二 imfilter(i, h, replicate); subplot (2, 2, 2)imshow(sobel); title( sobel image )ii = fspecial c lapla.cian,, 0. 4); lap = imfilter(i,h,replicate); subplot

5、 (2, 2, 3) imshow(lap);titlec laplacian image )h 二 fspecial ( gaussian,3 3, 0. 5); gaussian = imfiiter(i, h,' replicate'); subplot (2, 2, 4)imshow(gaussian); titlec gaussian tmage )3. 使用函数imfilter时,分别采用不同的填充方法(或边界选项,如零填 充、replicate、symmetric、circular)进行低通滤波,显示处理后的图像。originalrgb = imread(ftre

6、es.tif); subplot(3,2,l) imshow(originalrgb); title( qriginal image );h = fspecial(motion,50, 45); %motion blurred filteredrgb = imfilter(originalrgb, h); subplot(3,2,2)imshow(filteredrgb);title( motion blurred image );boundaryreplicatergb = imfilter(originalrgb,h, replicate); subplot(3,2,3)imshow(bo

7、undaryreplicatergb); title(' o-padding*);boundaryorgb = imfilter(originalrgb, h, 0);subplot(3,2,4)imshow(boundaryorgb);title(replicate);boundarysymmetricrgb = imfilter(originalrgb, h,symmetric); subplot(3,2,5)imshow(boundarysymmetricrgb); title( symmetric r);boundarycircularrgb = imfilter(origin

8、alrgb,h,'circular); subplot(3,2,6)imshow(boundarycircularrgb); title( circular);4. 运用for循环,将加有椒盐噪声的图像进行10次,20次均值滤波,查看其特点,s示均值处理后 的图像(提示:利用fspecial函数的average类型生成均值滤波器)。i=imreadc kids. tifj);j = imnoise(t,' salt & pepper,0. 05); subplot (1, 3, 1) imshow(j);titlec salt & pepper noise);

9、h二fspecial( average); %averaging filtering jl=imfil ter (j, h);for i=l:10 jl=imfilter (j, h); subplot (1, 3, 2) imshow(jl);titlec 10 averaging filtering); endj2=imfilter(j, h); for i=l:20 j2=imfilter(j, h); subplot (1, 3, 3) imshow(j2);titlec 20 averaging filtering); end5. 对加入椒盐噪声的图像分別采用均值滤波法,和屮值滤波法

10、对有噪声的图像做处理,要求在同 一窗口中显示结果。i=imread(,trees, tif);j = imnoised,' salt & pepper,0. 05); subplot (1,3, 1) imshow(j);titleoriginal tmage );h=fspecial( average); %averaging filtering jl=imfilter(j, h); subplot (1, 3, 2) imshow(jl);titlec averaging filtering );j2=medfiit2(j);%median filteringsubplot

11、 (1, 3, 3)imshow(j2);titlec median filtering );6. 自己设计平滑空间滤波器,并将其对噪声图像进行处理,显示处理后的图像。domain=0 0 8 0 0;0 0 8 0 0;8 8 8 8 8;0 0 8 0 0;0 0 8 0 0;l=jmread('trees.tif);j = imnoise(l,salt & pepper*,0.05); subplot(1,2,1)imshow(j);title(* original image ');k1= ordfilt2(j,5,domain); subplot(1,2,2)

12、 imshow(k1);titlef 5*5 smoothing fitered image');附录:可能用到的函数和参考结果*报告里不能用参考结果中的图像1) 读岀eight.tif这幅图像,给这幅图像分别加入椒盐噪声和高斯噪声后并与前一张 图显示在同一图像窗口中。l=imread(fcameraman.tif); subplot(1,3,1) imshow(l);titlef original image );j = imnoise(l/salt & pepper0.05); %noise density=0.05subplot(1,3,2)imshow(j);title

13、( salt & pepperf);k= imnoise(l/gaussian0.01,0.01);subplot(1,3,3)imshow(k);titlef gaussian );original imagesalt&pepper noisegaussian noise图2.1初始图像及椒盐噪声图像、高斯噪声污染图2) 对加入噪声图像选用不同的平滑(低通)模板做运算,对比不同模板所形成的效 果,要求在同一窗口屮显示。|=imread(trees.tif);h = fspecial(.sobel);subplot(2,2,1)imshow(l);titlef original

14、 image ');sobel = imfilter(l,h,'replicate*);subplot(2,2,2)imshow(sobel);titlef sobel image )h = fspecial(flaplacian0.4);lap = imfilter(l,h,*replicate*);subplot(2,2,3)imshow(lap);title(f laplacian image )h = fspecial(.gaussianf,3 3,0.5);gaussian = imfilter(l,h/replicate,);subplot(2,2,4)imshow

15、(gaussian);titlef gaussian image f)图2. 2原图像及各类低通滤波处理图像3) 使用函数imfiltei时,分别采用不同的填充方法(或边界选项,如零填 充、replicate、symmetric、circular)进行低通滤波,显示处理后的图像。originalrgb = imread(sedemo_onion.png,);subplot(3,2,1)imshow(originalrgb);title( original image );h = fspecial(motion,50, 45); %motion blurredfilteredrgb = imfi

16、lter(originalrgb, h);subplot(3,2,2)imshow(filteredrgb);titlec motion blurred image );boundaryreplicatergb = imfilter(originalrgb, h, replicate);subplot(3,2,3)imshow(boundaryreplicatergb);title(. o-padding*);boundaryorgb = imfilter(originalrgb, h, 0);subplot(3,2,4)imshow(boundaryorgb);title(replicate

17、);boundarysymmetricrgb = imfilter(originalrgb, h, 'symmetric*);subplot(3,2,5)imshow(boundarysymmetricrgb);titlef symmetric );boundarycircularrgb = imfilter(originalrgb, h, circular);subplot(3,2,6)imshow(boundarycircularrgb);title( circular);图2. 3原图像及运动模糊图像o-paddingreplicate图2. 4函数imfilter各填充方式处理

18、图像4) 运用for循环,将加有椒盐噪声的图像进行10次,20次均值滤波,查看其特点, 显示均值处理后的图像。l=jmread(kids.tif);j = imnoise(l/salt & pepper1,0.05);subplot(1,3,1)imshow(j);titlec salt & pepper noise1);h=fspecial(,average1);%averaging filteringj1=imfilter(j,h);for i=1:10j1=imfilter(j,h);subplot(1,3,2)imshow(j1);titlec 10 averaging

19、 filtering); endj2=imfilter(j,h);for i=1:20j2=imfilter(j,h);subplot(1,3,3)imshow(j2);titlec 20 averaging filtering1); end图2. 5椒盐噪声污染图像经10次、20次均值滤波图像由图2.5可得,20次滤波后的效果明显好于10次滤波,但模糊程度也更强。5)对加入椒盐噪声的阁像分别采用均伉滤波法,和屮伉滤波法对有噪声的阁像做处理,要求在同一窗口中显示结果l=imread(kids.tif);j = imnoise(l,salt & pepper.,0.05);subplot(1,3,1)imshow(j);title(. original image ');h=fspecial(average); %averaging filteringj1=imfilter(j,h);subplot(1,3,2)imshow(j1);title( averaging filtering );j2=medfilt2(j);%median filteringsubplot(1,3,3)imshow(j2);title( median filtering );

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论