


下載本文檔
版權說明:本文檔由用戶提供并上傳,收益歸屬內容提供方,若內容存在侵權,請進行舉報或認領
文檔簡介
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. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內容里面會有圖紙預覽,若沒有圖紙預覽就沒有圖紙。
- 4. 未經(jīng)權益所有人同意不得將文件中的內容挪作商業(yè)或盈利用途。
- 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內容的表現(xiàn)方式做保護處理,對用戶上傳分享的文檔內容本身不做任何修改或編輯,并不能對任何下載內容負責。
- 6. 下載文件中如有侵權或不適當內容,請與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- 2025年湖北黃岡應急管理職業(yè)技術學院單招職業(yè)適應性測試題庫帶答案
- 2025年貴州水利水電職業(yè)技術學院單招職業(yè)適應性測試題庫審定版
- 2025年贛州職業(yè)技術學院單招職業(yè)傾向性測試題庫匯編
- 2025年廣東省陽江市單招職業(yè)適應性測試題庫必考題
- 主體蓋房合同范本
- 校服購買合同范本
- 2025年廣州民航職業(yè)技術學院單招職業(yè)傾向性測試題庫完美版
- 科技醫(yī)學前沿與未來發(fā)展
- 知識版權在促進區(qū)域經(jīng)濟發(fā)展中的作用研究
- 2025年河北化工醫(yī)藥職業(yè)技術學院單招職業(yè)適應性測試題庫及答案1套
- 北京體育職業(yè)學院《機器人操作系統(tǒng)》2023-2024學年第二學期期末試卷
- 2025安徽雙鶴藥業(yè)限責任公司招聘30人易考易錯模擬試題(共500題)試卷后附參考答案
- 2022年RDPAC認證考試備考題庫700題(含答案)
- 2024年南京旅游職業(yè)學院高職單招職業(yè)技能測驗歷年參考題庫(頻考版)含答案解析
- 2025年春新外研版(三起)英語三年級下冊課件 Unit2第2課時Speedup
- 人教版(新)九年級下冊化學全冊教案教學設計及教學反思
- 2025年浙江省國土空間規(guī)劃研究院招聘歷年高頻重點提升(共500題)附帶答案詳解
- 2025年安徽省安慶市公安警務輔助人員招聘190人歷年高頻重點提升(共500題)附帶答案詳解
- 7.1力教學課件-2024-2025學年初中物理人教版八年級下冊
- 小學生勤儉節(jié)約課件
- 化工行業(yè)生產(chǎn)過程安全管理升級策略方案
評論
0/150
提交評論