数字图像处理实验报告——图像复原实验(共17页).doc

上传人:飞****2 文档编号:15107877 上传时间:2022-05-11 格式:DOC 页数:17 大小:902.50KB
返回 下载 相关 举报
数字图像处理实验报告——图像复原实验(共17页).doc_第1页
第1页 / 共17页
数字图像处理实验报告——图像复原实验(共17页).doc_第2页
第2页 / 共17页
点击查看更多>>
资源描述

《数字图像处理实验报告——图像复原实验(共17页).doc》由会员分享,可在线阅读,更多相关《数字图像处理实验报告——图像复原实验(共17页).doc(17页珍藏版)》请在得力文库 - 分享文档赚钱的网站上搜索。

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. 读出(自己选定.

3、tif)这幅图像,给这幅图像分别加入椒盐噪声和高斯噪声后并与前一张图显示在同一图像窗口中。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( L

5、aplacian Image )H = 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( Qrigin

6、al Image );h = fspecial(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 = imfilt

7、er(originalRGB, h, 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(

8、 Circular);4. 运用for循环,将加有椒盐噪声的图像进行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

9、)imshow(J1);title( 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 Ima

10、ge );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 );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

11、=imread(trees.tif);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);sub

12、plot(1,3,1)imshow(I);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

13、=imread(trees.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 = fspecial(gaussian,3 3

14、,0.5);gaussian = imfilter(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

15、= fspecial(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(originalRG

16、B, h, 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); 图

17、2.3 原图像及运动模糊图像 图2.4 函数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)imsh

18、ow(J1);title( 10 Averaging 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

19、& 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 ); 图2.6 椒盐噪声污染图像及均值、中值滤波图像 从图2.6中可以看出,对于椒盐噪

20、声污染的图像处理,中值滤波效果要明显好于均值滤波。经均值滤波器处理后的图像比均值滤波器中结果图像更加模糊。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(kids.tif);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); 图2.7 椒盐噪声污染图像及5*5平滑滤波器掩模 掩模值为w=1/25*1 1 1 1 1;1 1 1 1 1;1 1 1 1 1;1 1 1 1 1;1 1 1 1 1 图2.8 椒盐噪声污染图像及5*5平滑滤波器掩模掩模值为w= 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

展开阅读全文
相关资源
相关搜索

当前位置:首页 > 教育专区 > 教案示例

本站为文档C TO C交易模式,本站只提供存储空间、用户上传的文档直接被用户下载,本站只是中间服务平台,本站所有文档下载所得的收益归上传人(含作者)所有。本站仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。若文档所含内容侵犯了您的版权或隐私,请立即通知得利文库网,我们立即给予删除!客服QQ:136780468 微信:18945177775 电话:18904686070

工信部备案号:黑ICP备15003705号-8 |  经营许可证:黑B2-20190332号 |   黑公网安备:91230400333293403D

© 2020-2023 www.deliwenku.com 得利文库. All Rights Reserved 黑龙江转换宝科技有限公司 

黑龙江省互联网违法和不良信息举报
举报电话:0468-3380021 邮箱:hgswwxb@163.com