数字图像处理MATLAB程序.doc

上传人:rrsccc 文档编号:11040160 上传时间:2021-06-20 格式:DOC 页数:123 大小:851KB
返回 下载 相关 举报
数字图像处理MATLAB程序.doc_第1页
第1页 / 共123页
数字图像处理MATLAB程序.doc_第2页
第2页 / 共123页
数字图像处理MATLAB程序.doc_第3页
第3页 / 共123页
数字图像处理MATLAB程序.doc_第4页
第4页 / 共123页
数字图像处理MATLAB程序.doc_第5页
第5页 / 共123页
点击查看更多>>
资源描述

《数字图像处理MATLAB程序.doc》由会员分享,可在线阅读,更多相关《数字图像处理MATLAB程序.doc(123页珍藏版)》请在三一文库上搜索。

1、第一部分数字图像处理实验一 图像的点运算实验1.1 直方图一实验目的1熟悉matlab图像处理工具箱及直方图函数的使用;2理解和掌握直方图原理和方法;二实验设备1.PC机一台;2.软件matlab。三程序设计在matlab环境中,程序首先读取图像,然后调用直方图函数,设置相关参数,再输出处理后的图像。I=imread(cameraman.tif);%读取图像subplot(1,2,1),imshow(I) %输出图像title(原始图像) %在原始图像中加标题subplot(1,2,2),imhist(I) %输出原图直方图title(原始图像直方图) %在原图直方图上加标题四实验步骤1. 启

2、动matlab双击桌面matlab图标启动matlab环境;2. 在matlab命令窗口中输入相应程序。书写程序时,首先读取图像,一般调用matlab自带的图像,如:cameraman图像;再调用相应的直方图函数,设置参数;最后输出处理后的图像;3浏览源程序并理解含义;4运行,观察显示结果;5结束运行,退出;五实验结果观察图像matlab环境下的直方图分布。 (a)原始图像 (b)原始图像直方图六实验报告要求1、给出实验原理过程及实现代码;2、输入一幅灰度图像,给出其灰度直方图结果,并进行灰度直方图分布原理分析。实验1.2 灰度均衡一实验目的1熟悉matlab图像处理工具箱中灰度均衡函数的使用

3、;2理解和掌握灰度均衡原理和实现方法;二实验设备1.PC机一台;2.软件matlab;三程序设计在matlab环境中,程序首先读取图像,然后调用灰度均衡函数,设置相关参数,再输出处理后的图像。I=imread(cameraman.tif);%读取图像subplot(2,2,1),imshow(I) %输出图像title(原始图像) %在原始图像中加标题subplot(2,2,3),imhist(I) %输出原图直方图title(原始图像直方图) %在原图直方图上加标题a=histeq(I,256); %直方图均衡化,灰度级为256subplot(2,2,2),imshow(a) %输出均衡化后

4、图像title(均衡化后图像) %在均衡化后图像中加标题subplot(2,2,4),imhist(a) %输出均衡化后直方图title(均衡化后图像直方图) %在均衡化后直方图上加标题四实验步骤1. 启动matlab双击桌面matlab图标启动matlab环境;2. 在matlab命令窗口中输入相应程序。书写程序时,首先读取图像,一般调用matlab自带的图像,如:cameraman图像;再调用相应的灰度均衡函数,设置参数;最后输出处理后的图像;3浏览源程序并理解含义;4运行,观察显示结果;5结束运行,退出;五实验结果观察matlab环境下图像灰度均衡结果及直方图分布。 (a)原始图像 (b

5、)均衡化后图像 (c)原始图像直方图 (d)均衡化后图像直方图六实验报告要求1、给出实验原理过程及实现代码;2、输入一幅灰度图像,给出其灰度均衡结果,并进行灰度均衡化前后图像直方图分布对比分析。实验二 图像滤波实验2.1 3*3均值滤波一实验目的1熟悉matlab图像处理工具箱及均值滤波函数的使用;2理解和掌握3*3均值滤波的方法和应用;二实验设备1.PC机一台;2.软件matlab;三程序设计 在matlab环境中,程序首先读取图像,然后调用图像增强(均值滤波)函数,设置相关参数,再输出处理后的图像。I = imread(cameraman.tif);figure,imshow(I);J=f

6、ilter2(fspecial(average,3),I)/255;figure,imshow(J);四实验步骤1. 启动matlab双击桌面matlab图标启动matlab环境;2. 在matlab命令窗口中输入相应程序。书写程序时,首先读取图像,一般调用matlab自带的图像,如:cameraman图像;再调用相应的图像增强(均值滤波)函数,设置参数;最后输出处理后的图像;3浏览源程序并理解含义;4运行,观察显示结果;5结束运行,退出;五实验结果观察matlab环境下原始图像经3*3均值滤波处理后的结果。 (a)原始图像 (b)3*3均值滤波处理后的图像图(3)六实验报告要求输入一幅灰度图

7、像,给出其图像经3*3均值滤波处理后的结果,然后对每一点的灰度值和它周围24个点,一共25个点的灰度值进行均值滤波,看看对25个点取均值与对9个点取中值进行均值滤波有什么区别?有没有其他的算法可以改进滤波效果。实验2.2 3*3中值滤波一实验目的1熟悉matlab图像处理工具箱及中值滤波函数的使用;2理解和掌握中值滤波的方法和应用;二实验设备1.PC机一台;2.软件matlab;三程序设计在matlab环境中,程序首先读取图像,然后调用图像增强(中值滤波)函数,设置相关参数,再输出处理后的图像。I = imread(cameraman.tif);figure,imshow(I);J=medfi

8、lt2(I,5,5);figure,imshow(J);四实验步骤1. 启动matlab双击桌面matlab图标启动matlab环境;2. 在matlab命令窗口中输入相应程序。书写程序时,首先读取图像,一般调用matlab自带的图像,如:cameraman图像;再调用相应的图像增强(中值滤波)函数,设置参数;最后输出处理后的图像;3浏览源程序并理解含义;4运行,观察显示结果;5结束运行,退出;五实验结果观察matlab环境下原始图像经3*3中值滤波处理后的结果。 (a)原始图像 (b)3*3中值滤波处理后的图像图(4)六实验报告要求输入一幅灰度图像,给出其图像经3*3中值滤波处理后的结果,然

9、后对每一点的灰度值和它周围24个点,一共25个点的灰度值进行排序后取中值,然后该点的灰度值取中值。看看对25个点取中值与对9个点取中值进行中值滤波有什么区别?实验三 图像几何变换实验3.1 图像的缩放一实验目的1熟悉matlab图像处理工具箱及图像缩放函数的使用;2掌握图像缩放的方法和应用;二实验设备1.PC机一台;2.软件matlab;三程序设计在matlab环境中,程序首先读取图像,然后调用图像缩放函数,设置相关参数,再输出处理后的图像。I = imread(cameraman.tif);figure,imshow(I);scale = 0.5;J = imresize(I,scale);

10、figure,imshow(J);四实验步骤1. 启动matlab双击桌面matlab图标启动matlab环境;2. 在matlab命令窗口中输入相应程序。书写程序时,首先读取图像,一般调用matlab自带的图像,如:cameraman图像;再调用相应的图像缩放函数,设置参数;最后输出处理后的图像;3浏览源程序并理解含义;4运行,观察显示结果;5结束运行,退出;五实验结果观察matlab环境下图像缩放后的结果。 (a)原始图像 (b)缩放后的图像图(5)六实验报告要求 输入一幅灰度图像,给出其图像缩放后的结果,然后改变缩放比率,观察图像缩放后结果柄进行分析。实验3.2 图像旋转一实验目的1熟悉

11、matlab图像处理工具箱及图像旋转函数的使用;2理解和掌握图像旋转的方法和应用;二实验设备1.PC机一台;2.软件matlab;三程序设计在matlab环境中,程序首先读取图像,然后调用图像旋转函数,设置相关参数,再输出处理后的图像。I = imread(cameraman.tif);figure,imshow(I);theta = 30;K = imrotate(I,theta); % Try varying the angle, theta.figure, imshow(K)四实验步骤1. 启动matlab双击桌面matlab图标启动matlab环境;2. 在matlab命令窗口中输入相

12、应程序。书写程序时,首先读取图像,一般调用matlab自带的图像,如:cameraman图像;再调用相应的图像旋转函数,设置参数;最后输出处理后的图像;3浏览源程序并理解含义;4运行,观察显示结果;5结束运行,退出;五实验结果观察matlab环境下图像旋转后的结果。 (a)原始图像 (b)旋转后的图像图(7)六实验报告要求输入一幅灰度图像,给出其图像旋转后的结果,然后改变旋转角度,观察图像旋转后结果柄进行分析。实验四 图像边缘检测实验4.1 边缘检测(Sobel、Prewitt、Log边缘算子)一实验目的1熟悉matlab图像处理工具箱及图像边缘检测函数的使用;2理解和掌握图像边缘检测(Sob

13、el、Prewitt、Log边缘算子)的方法和应用;二实验设备1.PC机一台;2.软件matlab;三程序设计在matlab环境中,程序首先读取图像,然后调用图像边缘检测(Sobel、Prewitt、Log边缘算子)函数,设置相关参数,再输出处理后的图像。I = imread(cameraman.tif);J1=edge(I,sobel);J2=edge(I,prewitt);J3=edge(I,log);subplot(1,4,1),imshow(I);subplot(1,4,2),imshow(J1);subplot(1,4,3),imshow(J2);subplot(1,4,4),ims

14、how(J3);四实验步骤1. 启动matlab双击桌面matlab图标启动matlab环境;2. 在matlab命令窗口中输入相应程序。书写程序时,首先读取图像,一般调用matlab自带的图像,如:cameraman图像;再调用相应的边缘检测(Sobel边缘算子、Prewitt边缘算子、Log边缘算子)函数,设置参数;最后输出处理后的图像;3浏览源程序并理解含义;4运行,观察显示结果;5结束运行,退出;五实验结果观察经过图像边缘检测(Sobel、Prewitt、Log边缘算子)处理后的结果。 (a)原始图像 (b)Sobel边缘算子 (c)Prewitt边缘算子 (d)Log边缘算子图(7)

15、六实验报告要求输入一幅灰度图像,给出其图像边缘检测(Sobel、Prewitt、Log边缘算子)后的结果并进行分析对比。实验五 基于DSP的边缘检测实验5.1 边缘检测(Sobel边缘算子)一实验目的 1熟悉视频显示程序的运行过程、控制过程,搞清数据处理、传输途径;2结合实例学习如何在视频显示程序中增加图像处理算法;3. 熟悉CCS集成开发环境的使用;4了解边缘检测的算法和用途,学习利用Sobel算子进行边缘检测的程序设计方法;二实验设备1.SEED_DTK 教学实验系统一套;2.DSP 仿真器;3.PC机一台。三程序设计在视频显示任务的循环中,程序首先将视频数据从输入缓冲区读入自己开设的临时

16、图像处理缓冲区,再在临时图像处理缓冲区上进行处理,处理后的数据再输出到输出缓冲区。在屏幕中央开辟一个矩形区域,对这个区域内的图像进行处理。这里按模板(1)进行处理。DSP程序具体详见附录一。/*画矩形边框*/void drawRectangle();/*Sobel边缘检测处理*/void sobelEdge();四实验步骤1实验准备(1) 连接设备参见“第一部分 实验环境的建立”的“一 硬件连接”部分。(2) 开启设备 打开计算机电源(注意:连接设备时并不需要关闭计算机,但要关闭实验箱电源;如在连接设备前已经打开计算机,就不需要进行此步骤了)。 打开实验箱电源开关 打开显示器开关。(3) 设置

17、Code Composer Studio 为Emulator 方式参见“第一部分 实验环境的建立”的“二 软件的安装和配置”部分。如先前已经设置过,就不需再进行设置了。(4) 双击usb20emurst.exe,如果出现提示“SEED USB2.0 XDS510 CARD IS RESET,HARDWARE VERSION 1”,证明仿真器与目标系统连接正常。否则请检查电源是否打开,仿真器驱动是否安装正确以及硬件。(5) 启动Code Composer Studio双击桌面上“CCS 2(C6000)”图标,启动Code Composer Studio。成功后可看到CCS环境界面。2打开工程:

18、工程目录DM642Programs2.ImageProcessSEED401_SobelEdgeSobelEdgeloop2.pjt3浏览工程中源程序并理解含义。4编译、连接、下载程序并运行,观察显示。5结束运行,退出工程。五实验结果矩形框内外分别是用Sobel边缘算子处理和未处理的图像结果。六实验报告要求(1)简述DSP下实验步骤;(2)输入视频,观察Sobel边缘检测效果并经行分析;实验5.2 边缘检测(Prewitt边缘算子)一实验目的1熟悉视频显示程序的运行过程、控制过程,搞清数据处理、传输途径;2结合实例学习如何在视频显示程序中增加图像处理算法;3. 熟悉CCS集成开发环境的使用;4

19、了解边缘检测的算法和用途,学习利用Prewitt算子进行边缘检测的程序设计方法;二实验设备1.SEED_DTK 教学实验系统一套;2.DSP 仿真器;3.PC机一台。三程序设计在视频显示任务的循环中,程序首先将视频数据从输入缓冲区读入自己开设的临时图像处理缓冲区,再在临时图像处理缓冲区上进行处理,处理后的数据再输出到输出缓冲区。在屏幕中央开辟一个矩形区域,对这个区域内的图像进行处理。这里按模板(2)进行处理。DSP程序具体详见附录。/*画矩形边框*/void drawRectangle();/*Prewitt边缘检测处理*/void PrewittEdge();四实验步骤1实验准备(1) 连接

20、设备参见“第一部分 实验环境的建立”的“一 硬件连接”部分。(2) 开启设备 打开计算机电源(注意:连接设备时并不需要关闭计算机,但要关闭实验箱电源;如在连接设备前已经打开计算机,就不需要进行此步骤了)。 打开实验箱电源开关 打开显示器开关。(3) 设置Code Composer Studio 为Emulator 方式参见“第一部分 实验环境的建立”的“二 软件的安装和配置”部分。如先前已经设置过,就不需再进行设置了。(4) 双击usb20emurst.exe,如果出现提示“SEED USB2.0 XDS510 CARD IS RESET,HARDWARE VERSION 1”,证明仿真器与目

21、标系统连接正常。否则请检查电源是否打开,仿真器驱动是否安装正确以及硬件。(5) 启动Code Composer Studio双击桌面上“CCS 2(C6000)”图标,启动Code Composer Studio。成功后可看到CCS环境界面。2打开工程:工程目录DM642Programs2.ImageProcess SEED402_PrewittEdgePrewittEdgeloop2.pjt3浏览工程中源程序并理解含义。4编译、连接、下载程序并运行,观察显示。5结束运行,退出工程。五实验结果矩形框内外分别是用Prewitt边缘算子处理和未处理的图像结果。六实验报告要求(1)简述DSP环境下实

22、验步骤;(2)输入视频,观察Prewitt边缘检测效果并进行分析。实验5.3 边缘检测(Laplacian边缘算子)一实验目的1熟悉视频显示程序的运行过程、控制过程,搞清数据处理、传输途径;2结合实例学习如何在视频显示程序中增加图像处理算法;3. 熟悉CCS集成开发环境的使用;4了解边缘检测的算法和用途,学习利用Laplacian算子进行边缘检测的程序设计方法;二实验设备1.SEED_DTK 教学实验系统一套;2.DSP 仿真器;3.PC机一台。三程序设计在视频显示任务的循环中,程序首先将视频数据从输入缓冲区读入自己开设的临时图像处理缓冲区,再在临时图像处理缓冲区上进行处理,处理后的数据再输出

23、到输出缓冲区。在屏幕中央开辟一个矩形区域,对这个区域内的图像进行处理。这里按模板(3)进行处理。DSP程序具体详见附录三。/*画矩形边框*/void drawRectangle();/*Laplacian边缘检测处理*/void LaplacianEdge ();四实验步骤1实验准备(1) 连接设备参见“第一部分 实验环境的建立”的“一 硬件连接”部分。(2) 开启设备 打开计算机电源(注意:连接设备时并不需要关闭计算机,但要关闭实验箱电源;如在连接设备前已经打开计算机,就不需要进行此步骤了)。 打开实验箱电源开关 打开显示器开关。(3) 设置Code Composer Studio 为Emu

24、lator 方式参见“第一部分 实验环境的建立”的“二 软件的安装和配置”部分。如先前已经设置过,就不需再进行设置了。(4) 双击usb20emurst.exe,如果出现提示“SEED USB2.0 XDS510 CARD IS RESET,HARDWARE VERSION 1”,证明仿真器与目标系统连接正常。否则请检查电源是否打开,仿真器驱动是否安装正确以及硬件。(5) 启动Code Composer Studio双击桌面上“CCS 2(C6000)”图标,启动Code Composer Studio。成功后可看到CCS环境界面。2打开工程:工程目录DM642Programs2.ImageP

25、rocessSEED403_ LaplacianEdgeLaplacianEdgeloop2.pjt3浏览工程中源程序并理解含义。4编译、连接、下载程序并运行,观察显示。5结束运行,退出工程。五实验结果矩形框内外分别是用Laplacian边缘算子处理和未处理的图像结果。六实验报告要求(1)简述DSP环境下实验步骤;(2)输入视频,观察Laplacian边缘检测效果并进行分析。(英文版 ) easily blame, to prevent the broken window effect. Supervise the leading cadres to play an exemplary rol

26、e, take the lead in the strict implementation of the and , lead to safeguard the solemnity and authority of the party discipline, ensure that the party discipline and the laws and regulations for implementation in place. Throughout the discipline in the daily supervision and management, strengthen s

27、upervision and inspection, from the thorough investigation of violations of discipline behavior. Strengthen to key areas, key departments and key projects as well as the masses reflect the concentration of the units and departments for supervision. - strengthening supervision, discipline inspection

28、and supervision of cadres to set an example for compliance with the and is a man must be hexyl, blacksmith needs its own hardware. Discipline inspection organs as the executor of the party discipline, and supervisor of the defenders, for its supervision must be more strictly, discipline inspection a

29、nd supervision of cadres to firmly establish the awareness of Party Constitution, sense of discipline and rules consciousness, politics loyalty, sense obey. Action speak Ji Ordinance to set an example of the regulations of the rule of law, strengthen supervision and accept the supervision of the fir

30、mness and consciousness, do comply with and . To firmly establish the discipline must first be disciplined, the supervisor will be subject to the supervision of concept, and consciously safeguard and implement party compasses party, take the lead in practicing three strict real strict, so loyal, cle

31、an, play. To be good at learning, the Constitution and the as morality, politics and brought to fruition; to implement , do not want to, dare not, not with disciplinary ruler to supervision; to discipline a ruler, often the control inspection, and consciously in the ideological red line to draw the

32、row Ming Good accumulation is indeed the bottom line, so that the heart has fear, said to have quit, the line has ended. Attached: indifferent to heart, calmly to the table in our life, there are many unpredictable things will happen, some good, some bad things, we cannot control is powerless to sto

33、p, but with time, you will find in life sometimes turns out to be not good, some bad things finally turned out to be a good thing, but then we muddy however did not know, this is the life teach us things. 1, life can be complex, can also be simple. Want simple life of precipitation, to have enough t

34、ime to reflect, to make Become more perfect. Life is the most important thing is not to win, but the struggle; not to have conquered, but to have fought well. 2, the plain is the background of life. Live a plain life, give up on themselves is not a coward, but the wise answers; not disillusioned aft

35、er the heart, such as ashes, but experience the storm after the enlightenment; not unrewarding perfunctorily, but calm attitude of life of unrestrained self-confidence. Plain living, there is no noise noisy, no earthly troubles, more did not fill in the discontent of desire, some just a calm, a calm

36、. 3, memory of heart will not good things to erase the, life is a When no movie, pain is a beginning, the struggle is a kind of process, death is a kind of ending. Give up this giving up is the helpless, do not give up the abandoned, do not give up this giving up is ignorance, do not give up should

37、not give up is persistent. 4, a thing figured is heaven, think impassability is hell. Since the living, to live better. Sometimes we because of too narrow-minded, too care around the chores and penny wise and pound foolish, not worth the candle. Some things to attract trouble and worry, completely d

38、epends on how we look at and deal with it. Dont always take everything back to things, and dont get into a blind alley, dont want to face, dont be narrow-minded. Poke to care, is a kind of open-minded, a free and easy. 5, I am not afraid of others behind me a knife, I afraid to look back and see sta

39、b me, is my intention to treat people; I am not afraid of the truth to tell the best friend, Im afraid he turned to it as a joke to tell dont 6, when we are in a positive frame of mind, you will find many good things; and when we are in a negative state of mind, you will find many depressed things;

40、life happy and worry, all is you of life attitude, optimistic, good luck; loss of sink, Eritrea company. When you are in adversity, may wish to change a point of view to think everything over to the good Think, because good mentality decided the fate of the! 7, people are tired, rest; heart tired, c

41、alm. Grow up, mature, this society read. Tired and sad, squat down, to their a hug. Because the world no one can sympathize with you, have mercy on you. You cry, tears is your own; you pain, no one can understand. Then you only tears to smile. 8, each people have youth,Each youth are a story, the li

42、fe of the world never gets easier, I want what, wish the world all know, as has been the same; now want anything, for fear that others know, or like to lose the same. 9, the heart move, everything in the world is followed by birth, Rangrang, important thing is often the most difficult to open ones m

43、outh, because words will reduce its importance; to let strangers people care about your life in the good things, the original is not easy 10, do not blame, do not laugh at who, also dont envy who. Like a person is a kind of feeling, not like a person is true. The truth is easy to explain, I feel Is

44、unspeakable. The best travel life is that you in a strange place found a long lost touched. 11, happy life not in the bustling in, and in the peace of mind; no matter how many grievances, how uncomfortable, and ultimately to heal themselves or their own, others may got you to comfort, but never know your heart is how wanjianchuanxin. 12, maam, like a movie, learn to appreciate, learn to be grateful, learn tolerance, and goodness, helping others. Instead of accusing the society, as into one; and an excep

展开阅读全文
相关资源
猜你喜欢
相关搜索

当前位置:首页 > 社会民生


经营许可证编号:宁ICP备18001539号-1