数字图像处理实验报告——图像复原实验

上传人:cn****1 文档编号:567429283 上传时间:2024-07-20 格式:PDF 页数:21 大小:832.93KB
返回 下载 相关 举报
数字图像处理实验报告——图像复原实验_第1页
第1页 / 共21页
数字图像处理实验报告——图像复原实验_第2页
第2页 / 共21页
数字图像处理实验报告——图像复原实验_第3页
第3页 / 共21页
数字图像处理实验报告——图像复原实验_第4页
第4页 / 共21页
数字图像处理实验报告——图像复原实验_第5页
第5页 / 共21页
点击查看更多>>
资源描述

《数字图像处理实验报告——图像复原实验》由会员分享,可在线阅读,更多相关《数字图像处理实验报告——图像复原实验(21页珍藏版)》请在金锄头文库上搜索。

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

2、加入噪声图像选用不同的平滑(低通)模板做运算,对比不同模板所形成的效果,要求在同一窗口中显示。3.使 用 函 数imfilter时 , 分 别 采 用 不 同 的 填 充 方 法 ( 或 边 界 选 项 , 如 零 填充、replicate、symmetric、circular)进行低通滤波,显示处理后的图像。4.运用 for 循环,将加有椒盐噪声的图像进行 10 次,20 次均值滤波,查看其特点,显示均值处理后的图像(提示:利用 fspecial 函数的average类型生成均值滤波器) 。5.对加入椒盐噪声的图像分别采用均值滤波法,和中值滤波法对有噪声的图像做处理,要求在同一窗口中显示结果

3、。6.自己设计平滑空间滤波器,并将其对噪声图像进行处理,显示处理后的图像。三实验具体实现三实验具体实现1.读出(自己选定.tif)这幅图像,给这幅图像分别加入椒盐噪声和高斯噪声后并与前一张图显示在同一图像窗口中。I=imread();subplot(1,3,1)imshow(I);title( Original Image );J = imnoise(I,salt & pepper,; %noise density=subplot(1,3,2)imshow(J);title( salt & pepper );K= imnoise(I,gaussian,;subplot(1,3,3)imshow

4、(K);title( gaussian )2.对加入噪声图像选用不同的平滑(低通)模板做运算,对比不同模板所形成的效果,要求在同一窗口中显示。I=imread();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,;lap = imfilter(I,H,replicate);subplot(2,2,3)im

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

6、ow(originalRGB);title( Qriginal 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-P

7、adding);boundary0RGB = imfilter(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)imsho

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

9、lter(J,h);subplot(1,3,2)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();J = imnoise(I,salt & pepper,;subplot(1,3,1)imshow(J);title( Origi

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

11、 0 0;I=imread();J = imnoise(I,salt & pepper,;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)读出这幅图像,给这幅图像分别加入椒盐噪声和高斯噪声后并与前一张图显示在同一图像窗口中。I=imread();subplo

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

13、;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,;lap = imfilter(I,H,replicate);subplot(2,2,3)imshow(lap);title( Laplacian Image )H = fspecial(gaussian,3 3,;gaussian = imfilter(I,H,replicate);subpl

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

15、riginalRGB, 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,2,4)imshow(boundary0RGB);title(Replicate);bounda

16、rysymmetricRGB = 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);图 原图像及运动模糊图像图 函数imfilter各填充方式处理图像4)运用 for 循环,将加有椒盐噪声的图像进行10 次,20 次均值滤

17、波,查看其特点,显示均值处理后的图像。I=imread();J = imnoise(I,salt & pepper,;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 Averaging Filtering);endJ2=imfilter(J,h);for i=1:20J2=imfilter(J,h);s

18、ubplot(1,3,3)imshow(J2);title( 20 Averaging Filtering);end图 椒盐噪声污染图像经10次、20次均值滤波图像由图可得,20次滤波后的效果明显好于10次滤波,但模糊程度也更强。5)对加入椒盐噪声的图像分别采用均值滤波法, 和中值滤波法对有噪声的图像做处理,要求在同一窗口中显示结果I=imread();J = imnoise(I,salt & pepper,;subplot(1,3,1)imshow(J);title( Original Image );h=fspecial(average); %Averaging FilteringJ1=i

19、mfilter(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

20、; 8 8 8 8 8; 0 0 8 0 0; 0 0 8 0 0;I=imread();J = imnoise(I,salt & pepper,;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);图 椒盐噪声污染图像及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图 椒盐噪声污染图像及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

展开阅读全文
相关资源
正为您匹配相似的精品文档
相关搜索

最新文档


当前位置:首页 > 建筑/环境 > 施工组织

电脑版 |金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号