下载本文档
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
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 thissessi on, you should be able to perform image preprocess ing of edge detect ion in spatial doma in and freque ncy do
2、ma 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 detect ion methods.川.Experiment ContentsDema nd: Please show the figure on the lef
3、t and list the codes on the right respectively bellow eachquestion.(请将运行结果(图片)和程序代码贴在每题下方)i . Read car.jpg file (to do this by imread function), convert the color image into grayscale image, and the n perform edge detecti on using Roterts, Prewitt, Sobel operator separately in spatial doma in and di
4、splay 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(
5、k,kk)=1;elseim_edge(k,kk)=0;endendend subplot(3,2,2);imshow(im_edge,);% e ? e y?YX ? _ ? ?卩?0255 卩? ? §title( 'Robert image' );Y X=size(I);imedge=zeros(Y,X);for k=2:Y-1for kk=2:X-1imedge(k,kk)=abs(I(k-1,kk+1)-I(k-1,kk-1)+abs(I(k,kk+1)-im(k,kk-1) + abs(I(k+1,kk+1)-I(k+1,kk-1)+.abs(I(k+1,
6、kk -1)-I(k-1,kk-1)+abs(I(k+1, kk)-I(k-1, kk)+abs(I(k+1,kk+1)-I(k-1,kk+1) ;endendsubplot(3,2,3);imshow(imedge,);title( 'Prewit image' );Y X=size(I);im_edge=zeros(Y,X);for k=2:Y-1for kk=2:X-1im_edge(k,kk)=abs(I(k-1,kk+1)-I(k-1,kk-1)+2*abs(I(k,kk+1)-I(k,kk-1) + abs(I(k+1,kk+1)-I(k+1,kk-1)+.abs(
7、I(k+1,kk -1)-I(k-1,kk-1)+2*abs(I(k+1, kk)-I(k-1, kk)+abs(I(k+1,kk+1)-I(k-1,kk+1) ;endendsubplot(3,2,4);imshow(im_edge,);title( 'Sobel image' );图像如下ii. Read Car.jpg file (to do this by imread function), con vert the color image into grayscale image, the n perform edge detect ion in freque ncy
8、 doma in using Gaussia n Highpass filter and display the result i n a Matlab win dow.第二题程序:%频域边缘检测,利用Gassian高通滤波器进行滤波,进行边缘检测%频域边缘检测,利用Gassian高通滤波器进行滤波,进行边缘检测clear; im=imread('car.jpg');I=rgb2gray(im); subplot(1,2,1); imshow(I); title('gray image');%shifting image (multiply the image
9、by (_1)x+y)row,col=size(l);Y,X=meshgrid(1:col,1:row);Il=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/(1+(D0/d)A(2* n);D(i,j)=1-exp(-dA2)/(2*(D0)A2);endend%filteringG=F.*D;%Invert the result and shifting
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 员工个人工作总结自我评价范文3篇
- 2026安徽六安市霍邱县三流乡招考村级后备干部5人备考题库及答案详解(典优)
- 中小学各功能室管理制度规定
- 电工技师基本素质和综合能力考核试题及答案
- 2026年餐饮门店保洁员岗位知识考试题库含答案
- 2026中国再保险(集团)股份有限公司博士后科研工作站招聘备考题库带答案详解(综合卷)
- 2026年安全环保履职能力考试题库及答案
- 2026年安徽省合肥市庐江县沿湖治理建设管理中心公开选调工作人员1名备考题库及答案详解(全优)
- 2026广东深圳北理莫斯科大学学生工作部党建组织员招聘备考题库附参考答案详解(巩固)
- 2025年唐山科技职业技术学院马克思主义基本原理概论期末考试模拟题附答案解析(必刷)
- 会展技术服务合同范本
- 医患沟通培训课件
- 2024江苏省常熟市中考物理试卷【历年真题】附答案详解
- 睑板腺按摩护理技术
- 材料作文“各有千秋”(2024年重庆A卷中考满分作文10篇附审题指导)
- 2025年企业法律合规性风险评估与治理方案
- 企业员工英语能力水平测试题库
- 绿色工厂基础知识培训课件
- 研学旅行概论课件
- 深海采矿生态风险-洞察及研究
- DB61-T 5125-2025 绿色生态小区建设评价标准
评论
0/150
提交评论