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

下载本文档

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

文档简介

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

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

3、盐噪声和高斯噪声后并与前一张图显示在同一图像窗口中。I=imread(trees.tif);subplot(1,3,1)imshow(I);title( Original Image );J = imnoise(I,salt & pepper,0.05); %noise density=0.05subplot(1,3,2)imshow(J);title( salt & 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(I);title( Qriginal Image );Sobel = imfilter(I,H,replicate);subplot(2,2,2)imshow(Sobel);title( Sobel Image )H = fspecial(laplacian,0.4);lap = imfilter(I,H,replicate);subplot(2,2,3)imshow(lap);title( Laplacian Image )H =

5、 fspecial(gaussian,3 3,0.5);gaussian = imfilter(I,H,replicate);subplot(2,2,4)imshow(gaussian);title( Gaussian Image )3. 使用函数imfilter时,分别采用不同的填充方法(或边界选项,如零填充、replicate、symmetric、circular)进行低通滤波,显示处理后的图像。originalRGB = imread(trees.tif);subplot(3,2,1)imshow(originalRGB);title( Qriginal Image );h = fspe

6、cial(motion, 50, 45); %motion blurredfilteredRGB = imfilter(originalRGB, h);subplot(3,2,2)imshow(filteredRGB);title( Motion Blurred Image );boundaryReplicateRGB = imfilter(originalRGB, h, replicate);subplot(3,2,3)imshow(boundaryReplicateRGB);title( 0-Padding);boundary0RGB = imfilter(originalRGB, h,

7、0);subplot(3,2,4)imshow(boundary0RGB);title(Replicate);boundarysymmetricRGB = imfilter(originalRGB, h, symmetric);subplot(3,2,5)imshow(boundarysymmetricRGB);title( Symmetric );boundarycircularRGB = imfilter(originalRGB, h, circular);subplot(3,2,6)imshow(boundarycircularRGB);title( Circular);4. 运用for

8、循环,将加有椒盐噪声的图像进行10次,20次均值滤波,查看其特点,显示均值处理后的图像(提示:利用fspecial函数的average类型生成均值滤波器)。I=imread(kids.tif);J = imnoise(I,salt & pepper,0.05);subplot(1,3,1)imshow(J);title( salt & pepper Noise);h=fspecial(average); %Averaging FilteringJ1=imfilter(J,h);for i=1:10J1=imfilter(J,h);subplot(1,3,2)imshow(J1);title(

9、10 Averaging Filtering);endJ2=imfilter(J,h);for i=1:20J2=imfilter(J,h); subplot(1,3,3)imshow(J2);title( 20 Averaging Filtering);end5. 对加入椒盐噪声的图像分别采用均值滤波法,和中值滤波法对有噪声的图像做处理,要求在同一窗口中显示结果。I=imread(trees.tif);J = imnoise(I,salt & pepper,0.05);subplot(1,3,1)imshow(J);title( Original Image );h=fspecial(ave

10、rage); %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 );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;I=imread(trees.tif);

11、J = imnoise(I,salt & pepper,0.05);subplot(1,2,1)imshow(J);title( Original Image );K1= ordfilt2(J,5,domain);subplot(1,2,2)imshow(K1);title( 5*5 Smoothing Fitered Image);附录:可能用到的函数和参考结果*报告里不能用参考结果中的图像1) 读出eight.tif这幅图像,给这幅图像分别加入椒盐噪声和高斯噪声后并与前一张图显示在同一图像窗口中。 I=imread(cameraman.tif);subplot(1,3,1)imshow(I

12、);title( Qriginal Image );J = imnoise(I,salt & pepper,0.05); %noise density=0.05subplot(1,3,2)imshow(J);title( salt & pepper );K= imnoise(I,gaussian,0.01,0.01); subplot(1,3,3)imshow(K);title( gaussian ); 图2.1 初始图像及椒盐噪声图像、高斯噪声污染图 2) 对加入噪声图像选用不同的平滑(低通)模板做运算,对比不同模板所形成的效果,要求在同一窗口中显示。I=imread(trees.tif);

13、H = fspecial(sobel);subplot(2,2,1)imshow(I);title( Qriginal Image );Sobel = imfilter(I,H,replicate);subplot(2,2,2)imshow(Sobel);title( Sobel Image )H = fspecial(laplacian,0.4);lap = imfilter(I,H,replicate);subplot(2,2,3)imshow(lap);title( Laplacian Image )H = fspecial(gaussian,3 3,0.5);gaussian = im

14、filter(I,H,replicate);subplot(2,2,4)imshow(gaussian);title( Gaussian Image ) 图2.2 原图像及各类低通滤波处理图像 3) 使用函数imfilter时,分别采用不同的填充方法(或边界选项,如零填充、replicate、symmetric、circular)进行低通滤波,显示处理后的图像。originalRGB = imread(sedemo_onion.png);subplot(3,2,1)imshow(originalRGB);title( Original Image );h = fspecial(motion,

15、50, 45); %motion blurredfilteredRGB = imfilter(originalRGB, h);subplot(3,2,2)imshow(filteredRGB);title( Motion Blurred Image );boundaryReplicateRGB = imfilter(originalRGB, h, replicate);subplot(3,2,3)imshow(boundaryReplicateRGB);title( 0-Padding);boundary0RGB = imfilter(originalRGB, h, 0);subplot(3,

16、2,4)imshow(boundary0RGB);title(Replicate);boundarysymmetricRGB = imfilter(originalRGB, h, symmetric);subplot(3,2,5)imshow(boundarysymmetricRGB);title( Symmetric );boundarycircularRGB = imfilter(originalRGB, h, circular);subplot(3,2,6)imshow(boundarycircularRGB);title( Circular); 图2.3 原图像及运动模糊图像 图2.4

17、 函数imfilter各填充方式处理图像 4) 运用for循环,将加有椒盐噪声的图像进行10次,20次均值滤波,查看其特点,显示均值处理后的图像。I=imread(kids.tif);J = imnoise(I,salt & pepper,0.05);subplot(1,3,1)imshow(J);title( salt & pepper Noise);h=fspecial(average); %Averaging FilteringJ1=imfilter(J,h);for i=1:10J1=imfilter(J,h);subplot(1,3,2)imshow(J1);title( 10 Av

18、eraging Filtering);endJ2=imfilter(J,h);for i=1:20J2=imfilter(J,h); subplot(1,3,3)imshow(J2);title( 20 Averaging Filtering);end 图2.5 椒盐噪声污染图像经10次、20次均值滤波图像 由图2.5可得,20次滤波后的效果明显好于10次滤波,但模糊程度也更强。5) 对加入椒盐噪声的图像分别采用均值滤波法,和中值滤波法对有噪声的图像做处理,要求在同一窗口中显示结果I=imread(kids.tif);J = imnoise(I,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

温馨提示

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

评论

0/150

提交评论