版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
1、Experiment 3 : Edge DetectionClass: 电子 1203班Student ID: 1210910322 Name: 王影I . AimThe aim of this laboratory sessi on is to lear n to deal with image data by Matlab. By the end of this sessi on, you should be able to perform image preprocess ing of edge detect ion in spatial doma in and freque ncy d
2、oma in.n . Knowledge required in the Experimenti .You are supposed to have learned the basic skills of using Matlab;ii .You need to review Matlab programming Ianguage and M-file format.iii . You should have studied edge detection methods.川.Experiment ContentsDema nd: Please show the figure on the le
3、ft and list the codes on the right respectively bellow eachquestion.(请将运行结果(图片)和程序代码贴在每题下方)i .Read “ar.jpg” file (to do this by imread function), convert the color image into grayscale image, and then perform edge detection using Roterts, Prewitt, Sobel operator separately in spatial domain and disp
4、lay the results in a Matlab win dow.程序:clear;im=imread( car.jpg);I=rgb2gray(im);subplot(3,2,1);imshow(I);title(Gray image);Y,X=size(l);im_edge=zeros(Y,X);T=30;for k=2:Y-1for kk=2:X-1im_edge(k,kk)=abs(l(k+1,kk+1)-l(k,kk)+abs(l(k,kk+1)-l(k+1,kk);if (im_edge(k,kk)T)im_edge(k,kk)=1;整理范本e-seimledge(k-kkH
5、qendendendsubp_2.(3-2-2)-imshowumledgeew 口 e 7 e y7Y X 77 77 7 卞 702255 卞 7 77 0 7 口 7 出s-e(-Robell image)-Y xHsNe (三imedgeHzeros(Y-xfor k2Y1for kk2x1imedge(k-kkHabs(-?1 -kk+1)(k?kk1)+abs(-(Kkk+1)m(Kkk1) +abs (一 (k+1 - kk+1 )(k+1 - kka)+ -abs (一 (k+1-kka(k?kka)+abs (一 (k+1- kk)(k?kk)+abs (一 (k+1-kk+
6、1)(k?kk+1)二 endendsubp_2.(3-2-3)-imshow(imedge-ss-e(-prewifimage)-Y xHsNe (三i mledge zeros (Y-xxfor k2Y1for kk2x1imledge(k-kkllabs(-(k?kk+v-?1 -kka)+2*abs(-(k-kk+1T-(Kkk1) +abs (- (k+1 - kk+1 )(k+1 - kk1)+ : abs(-(k+1-kk1T-(k?kka)+2*abs(-(k+1- kk)?1- kk)+abs(-(k+1-kk+1)?1-kk+1)_endendsubp-2.(3-2-4im
7、show(imledge-ss-e(-sobe-image)-mJlaMii. Read “ar.jpg” file (to do this by imread function), con vert the color image into grayscale image, then perform edge detect ion in freque ncy doma in using Gaussia n Highpass filter and display the result in a Matlab win dow.第二题程序:%频域边缘检测,利用Gassian高通滤波器进行滤波,进行
8、边缘检测%频域边缘检测,利用Gassian高通滤波器进行滤波,进行边缘检测clear; im=imread(car.jpg);I=rgb2gray(im); subplot(1,2,1); imshow(I); title(gray image);%shifting image (multiply the image by (_1)x+y)row,col=size(l);Y,X=meshgrid(1:col,1:row);ll=double(l).*(-1)A(X+Y);F=fft2(II);%subplot(2,2,2);%title(Fourier spectrum);%creat highpass filter%傅立叶变换中心D=zeros(row,col);u0=floor(row/2);v0=floor(col/2);D0=40;%截止频率n=2;for i=1:rowfor j=1:cold=(i-u0)A2+(j-v0)A2)A0.5;% D(i,j)=1心+(D0/d)A(2* n);D(i,j)=1-exp(-dA2)/(2*(D0)A2);endend%filteringG=F.*D;%Invert the result and s
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 2026年低空智联平台跨部门数据互通与共享机制设计
- 2026年适老化产品品类不足精细度有待提升公共样板间弥补短板
- 江苏省苏州市相城区重点达标名校2025-2026学年初三4月中考测试化学试题理试题含解析
- 湖北省巴东县2026届初三毕业班第一次质检化学试题含解析
- 天津市河西区第四中学2025-2026学年下学期普通高中期末考试试卷初三化学试题含解析
- 山东省临沂达标名校2026届初三6月中考考前仿真化学试题含解析
- 2026年湖南省耒阳市冠湘中学初三练习题一(全国卷II)生物试题含解析
- 上海市杨浦区名校2026届初三第五次模拟考化学试题试卷含解析
- 2026届湖北省鄂州梁子湖区四校联考初三生物试题第一次月考含解析
- 四川省乐山市沙湾区2025-2026学年初三第一次适应性测试自选模块试题含解析
- 2026年食品安全与环境管理的关系
- 2025-2026学年湘美版美术八年级下册1.3走向现代课件
- 高中英语必背3500单词表完整版
- 硬笔行楷经典字帖
- 文创艺术片区现状调研报告
- GB/T 10002.1-2006给水用硬聚氯乙烯(PVC-U)管材
- 第八章-作为审美范畴的优美与崇高-(《美学原理》课件)
- 土木工程专业认识教育课件
- 动脉血气分析六步法杜斌
- 说明书hid500系列变频调速器使用说明书s1.1(1)
- 全套电子课件:数据结构(C语言版)(第三版)
评论
0/150
提交评论