




版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)
文檔簡(jiǎn)介
1、 課 程 設(shè) 計(jì) 報(bào) 告課程設(shè)計(jì)名稱: dsp原理及應(yīng)用 系 別: 三 系 學(xué) 生 姓 名: 班 級(jí): 學(xué) 號(hào): 成 績: 指 導(dǎo) 教 師: 開 課 時(shí) 間: 2014-2015學(xué)年2學(xué)期一、課程設(shè)計(jì)目的 本課程是為通信工程專業(yè)本科生開設(shè)的必修課,結(jié)合學(xué)生的專業(yè)方向的理論課程,充分發(fā)揮學(xué)生的主動(dòng)性,使學(xué)生掌握應(yīng)用matlab 等仿真軟件建立基于激光與可見光的無人駕駛車防撞系統(tǒng),鞏固理論課程內(nèi)容,規(guī)范文檔的建立,培養(yǎng)學(xué)生的創(chuàng)新能力,并能夠運(yùn)用其所學(xué)知識(shí)進(jìn)行綜合的設(shè)計(jì),鼓勵(lì)2人一組。dsp的課程設(shè)計(jì)是對(duì)自適應(yīng)dsp控制原理與應(yīng)用等系統(tǒng)仿真軟件、課程學(xué)習(xí)的綜合檢驗(yàn),配合理論課的教學(xué),讓學(xué)生親自參加設(shè)
2、計(jì)、仿真、驗(yàn)證dsp系統(tǒng)的高級(jí)處理與控制原理、applications等方面的關(guān)鍵知識(shí)點(diǎn)。二、設(shè)計(jì)任務(wù)書無人駕駛車用激光標(biāo)定螳螂防撞算法的仿真三、進(jìn)度安排day 1: 圖書館查閱資料,思考總體設(shè)計(jì)方案, 熟悉軟件的編程環(huán)境,推薦的參考資料有:matlab工程仿真matlab/simulink系統(tǒng)建模與仿真實(shí)例分析tms320c55x dsp library programmers referenceday 2: 總體設(shè)計(jì)方案的確定與設(shè)計(jì)day 3: 各部分的具體實(shí)現(xiàn)day 4: 程序調(diào)試并程序注釋day 5: 整理完成設(shè)計(jì)報(bào)告四、具體要求及分工情況要求:a 熟悉matlab的gui desig
3、n。b 熟悉matlab的image邊框processc 用手機(jī)與激光筆采集樣板圖序列d simulate電子ptz功能e 用兩點(diǎn)定位計(jì)算報(bào)告第三點(diǎn)的距離f 如果時(shí)間多余再做如下試驗(yàn)箱互動(dòng)g connect with the ti board to make warning sound h user must be able to control the ptz.五、課程設(shè)計(jì)內(nèi)容在windows環(huán)境下,用matlab搭建圖像處理軟件,一位同學(xué)負(fù)責(zé)gui的建設(shè),一位同學(xué)負(fù)責(zé)后臺(tái)算法的建立,用手機(jī)預(yù)先拍好的激光標(biāo)定圖片序列構(gòu)建虛擬前進(jìn)過程,并播報(bào)與障礙物的距離,類似螳螂三單眼三維超高速“dma”算
4、法。目 錄1、引言12、基本原理22.1 matlab介紹22.2螳螂算法及單目測(cè)距原理22.2.1 螳螂算法22.2.2單目測(cè)距43、gui design94、實(shí)驗(yàn)代碼125、測(cè)試結(jié)果186、總結(jié)和展望217、參考文獻(xiàn)221、引言近年來,互聯(lián)網(wǎng)技術(shù)的迅速發(fā)展給汽車工業(yè)帶來了革命性變化的機(jī)會(huì)。與此同時(shí),汽車智能化技術(shù)正逐步得到廣泛應(yīng)用,這項(xiàng)技術(shù)使汽車的操作更簡(jiǎn)單,行駛安全性也更好,而其中最典型也是最熱門的未來應(yīng)用就是無人駕駛汽車。也許這一趨勢(shì)能使無人汽車比新能源汽車更早走入大眾的生活。公共領(lǐng)域示范運(yùn)營的大環(huán)境下,首先選擇微型電 動(dòng)車作為推廣突破口, 市場(chǎng)前景廣闊,環(huán)保、節(jié)能效果快速、明顯;在使
5、用過程中,通過合理策略可 進(jìn)一步減低電動(dòng)汽車的購置和使用成本,提高電動(dòng)汽車競(jìng)爭(zhēng)力;最后指出純電動(dòng)汽車的有效推廣需要構(gòu)建純電動(dòng)汽車友好性社會(huì)。純電動(dòng)汽車的市場(chǎng)化勢(shì)必為汽車行業(yè)的發(fā)展注入新的活力,為國家在低碳經(jīng)濟(jì)和后危機(jī)時(shí)代的經(jīng)濟(jì)戰(zhàn)略布局取得先機(jī)。無人駕駛,是指通過給車輛裝備智能軟件和 多種感應(yīng)設(shè)備,包括車載傳感器、雷達(dá)、gps以及攝像頭等,實(shí)現(xiàn)車輛的自主安全駕駛,安全高效地 到達(dá)目的地并達(dá)到完全消除交通事故的目標(biāo)。美國nhtsa(美國國家公路交通安全管理局)分5級(jí)定義汽車的自動(dòng)化等級(jí)。 0級(jí):由駕駛員駕駛;1級(jí):具備1種以上自動(dòng)化控制功能(如自適應(yīng)巡航和車道保持系統(tǒng)acc等);2級(jí):以汽車為主體
6、執(zhí)行多種操作功能;3級(jí):當(dāng)以汽車為主體的駕駛行不通時(shí)可指示駕駛員切換為手動(dòng)駕駛;4級(jí):完全可以無人駕駛。 如今,越來越多的企業(yè)開始涉足這塊領(lǐng)域,將尖端的it技術(shù)運(yùn)用到汽車領(lǐng)域中,希望為消費(fèi)者駕車出行帶來更多美好體驗(yàn)。麥肯錫預(yù)測(cè),到2025年無人駕駛汽車可以產(chǎn)生2000億19萬億美元的產(chǎn)值;市場(chǎng)研究公司ihs預(yù)測(cè), 2035年4級(jí)完全無人駕駛車每年銷量可達(dá)480萬輛。對(duì)任何一個(gè)行業(yè)而言,這都具有足夠的市場(chǎng)誘惑。2、基本原理2.1 matlab介紹matlab是美國mathworks公司出品的商業(yè)數(shù)學(xué)軟件,用于算法開發(fā)、數(shù)據(jù)可視化、數(shù)據(jù)分析以及數(shù)值計(jì)算的高級(jí)技術(shù)計(jì)算語言和交互式環(huán)境,主要包括mat
7、lab和simulink兩大部分。matlab是matrix&laboratory兩個(gè)詞的組合,意為矩陣工廠(矩陣實(shí)驗(yàn)室)。是由美國mathworks公司發(fā)布的主要面對(duì)科學(xué)計(jì)算、可視化以及交互式程序設(shè)計(jì)的高科技計(jì)算環(huán)境。它將數(shù)值分析、矩陣計(jì)算、科學(xué)數(shù)據(jù)可視化以及非線性動(dòng)態(tài)系統(tǒng)的建模和仿真等諸多強(qiáng)大功能集成在一個(gè)易于使用的視窗環(huán)境中,為科學(xué)研究、工程設(shè)計(jì)以及必須進(jìn)行有效數(shù)值計(jì)算的眾多科學(xué)領(lǐng)域提供了一種全面的解決方案,并在很大程度上擺脫了傳統(tǒng)非交互式程序設(shè)計(jì)語言(如c、fortran)的編輯模式,代表了當(dāng)今國際科學(xué)計(jì)算軟件的先進(jìn)水平。matlab和mathematica、maple并稱為三大數(shù)學(xué)軟
8、件。它在數(shù)學(xué)類科技應(yīng)用軟件中在數(shù)值計(jì)算方面首屈一指。matlab可以進(jìn)行矩陣運(yùn)算、繪制函數(shù)和數(shù)據(jù)、實(shí)現(xiàn)算法、創(chuàng)建用戶界面、連接其他編程語言的程序等,主要應(yīng)用于工程計(jì)算、控制設(shè)計(jì)、信號(hào)處理與通訊、圖像處理、信號(hào)檢測(cè)、金融建模設(shè)計(jì)與分析等領(lǐng)域。matlab的基本數(shù)據(jù)單位是矩陣,它的指令表達(dá)式與數(shù)學(xué)、工程中常用的形式十分相似,故用matlab來解算問題要比用c,fortran等語言完成相同的事情簡(jiǎn)捷得多,并且matlab也吸收了像maple等軟件的優(yōu)點(diǎn),使matlab成為一個(gè)強(qiáng)大的數(shù)學(xué)軟件。在新的版本中也加入了對(duì)c,fortran,c+,java的支持。2.2螳螂算法及單目測(cè)距原理2.2.1 螳螂算
9、法在所有的動(dòng)物當(dāng)中,螳螂躲避攻擊對(duì)象的反應(yīng)速度最快,主要是因?yàn)轶氩坏袕?fù)眼還有單眼,當(dāng)攻擊對(duì)象的影像從復(fù)眼進(jìn)入單眼時(shí),單眼負(fù)責(zé)觀察目標(biāo)變大的速度,隨時(shí)通知中樞神經(jīng)逃避目標(biāo)。根據(jù)以上原理,我們選擇了含有96個(gè)cpu與arm處理器的芯片,96個(gè)cpu完成復(fù)眼的功能,arm處理器完成單眼的功能。視覺幾何計(jì)算規(guī)避原理圖如圖1:圖1復(fù)眼cpu提供徑向畸變校正后的圖像image(t)和image(t-1),單眼提供features(t-1),同時(shí)負(fù)責(zé)提取features(t),如果feature沒有變化,則表示幾何視覺距離不變,如果feature有變化,進(jìn)行motion檢測(cè),進(jìn)行三角幾何計(jì)算,同時(shí)標(biāo)定聚
10、合最終位置。計(jì)算機(jī)視覺的基本任務(wù)可以歸結(jié)到測(cè)量、識(shí)別和重建。為進(jìn)行視覺計(jì)算,必須首先獲得空間坐標(biāo)系與圖象坐標(biāo)系之間的變換關(guān)系,即為攝象機(jī)建立適當(dāng)?shù)哪P筒⑶蠼馄鋮?shù)。模型和參數(shù)的準(zhǔn)確程度直接影響視覺計(jì)算的精度。而視覺計(jì)算的魯棒性和可靠性、對(duì)源數(shù)據(jù)及計(jì)算條件的誤差的容忍度、計(jì)算的代價(jià)等,都對(duì)算法是否能在實(shí)際中應(yīng)用有深刻的影響。三維視覺三角幾何計(jì)算原理圖如圖2 圖2陰影部分為電子眼的光學(xué)軸長(a),b表示障礙的大小與位置,a、b的大小可以根據(jù)需要用軟件在飛行現(xiàn)場(chǎng)進(jìn)行長、寬、高的冪比例關(guān)系校準(zhǔn)與自標(biāo)定。當(dāng)單眼在5幀圖像里看到變化超過=10個(gè)像素,斷定目標(biāo)有變化,復(fù)眼的速度是每秒30幀,變化是用最小均方
11、差的方法計(jì)算的。計(jì)算公式如下:常用的自動(dòng)規(guī)避方法有雷達(dá),超聲波,紅外線或激光。每種方法都有他各自的優(yōu)缺點(diǎn)。雷達(dá)缺點(diǎn)是由于主動(dòng)發(fā)射電磁波,容易暴露自身,成為對(duì)方反輻射導(dǎo)彈的目標(biāo),另外也容易被干擾,只要對(duì)方采取電子對(duì)抗措施,如使用電子干擾或發(fā)射干擾彈,就無法正常工作。超聲波測(cè)距的優(yōu)點(diǎn)是比較耐臟污,即使傳感器上有塵土,只要沒有堵死就可以測(cè)量,可以在較差的環(huán)境中使用,所以倒車?yán)走_(dá)多半使用超聲波,缺點(diǎn)是精度較低,且成本較高。紅外測(cè)距的優(yōu)點(diǎn)是便宜,易制,安全,缺點(diǎn)是精度低,距離近,方向性差。激光測(cè)距的優(yōu)點(diǎn)是精確,缺點(diǎn)是需要注意人體安全,且制做的難度較大,成本較高,而且光學(xué)系統(tǒng)需要保持干凈,否則將影響測(cè)量。
12、所以我們決定選擇普通可見光低照度感光傳感器作為我們的測(cè)距方法。不但可以測(cè)量距離還可以識(shí)別跟蹤目標(biāo)。2.2.2單目測(cè)距車輛的安全系統(tǒng)是智能交通系統(tǒng)的重要組成部分,在危險(xiǎn)預(yù)警系統(tǒng)、防撞系統(tǒng)等方面發(fā)揮著重要的作用,測(cè)距技術(shù)則是實(shí)現(xiàn)這一系統(tǒng)的關(guān)鍵部分。目前,可用于汽車測(cè)距主要有超聲波測(cè)距、毫米波雷達(dá)測(cè)距、激光測(cè)距和視覺測(cè)距這四類方式,除去只適合短距離測(cè)距的超聲波方式,與少則幾千,動(dòng)輒上萬的雷達(dá)或激光測(cè)距儀器相比,視覺測(cè)距在成本設(shè)備方面有很大的價(jià)格優(yōu)勢(shì)。目前應(yīng)用于智能車輛的視覺系統(tǒng)根據(jù)攝像機(jī)的多少一般分為兩種:采用多個(gè)攝像機(jī)的立體視覺系統(tǒng)及采用單個(gè)攝像機(jī)的單目視覺系統(tǒng)。立體視覺雖然對(duì)于恢復(fù)深度信息及確定
13、景物距離比較容易,測(cè)量精度高,但是計(jì)算速度較慢,成本較大,同時(shí)圖像配準(zhǔn)這一難題的存在缺大大限制了它的應(yīng)用。單目視覺系統(tǒng)的方法簡(jiǎn)潔快速,具有更快的圖像處理速度和更好的控制實(shí)時(shí)性,也具有很好的研究和應(yīng)用前景。(1) 反轉(zhuǎn)透視測(cè)距模型攝像機(jī)采集圖像的過程是從三維歐拉空間到二維歐拉空間的幾何變換過程??紤]單目攝像機(jī)測(cè)距的幾何變換過程,如果用i表示三維的現(xiàn)實(shí)空間而用w表示圖像空間,則圖像采集過程是從i到w的過程。測(cè)距過程可以被視為這一過程的逆過程,如圖1所示 ,車距測(cè)量可以認(rèn)為是利用圖像空間w = u,v中的數(shù)據(jù) ,在一 定 的 先 驗(yàn) 條 件 下 計(jì) 算 現(xiàn) 實(shí) 空 間i =x,y,z中 的 一 個(gè)
14、平 面s =(x, y,o)w 上的數(shù)據(jù)過程。獲得了目標(biāo)車輛底端在圖像空間中的縱坐標(biāo) u ,還需要獲得采集圖像的條件和對(duì)于圖像場(chǎng)景描述的假設(shè)。如果包括試點(diǎn)及攝像機(jī)的位置,由攝像機(jī)在現(xiàn)實(shí)空間中的位置 l,d,h表示;視圖方向由攝像機(jī)中心軸與標(biāo)準(zhǔn)軸的夾角和來表示;攝像機(jī)的孔徑張角 2 ;攝像機(jī)清晰度 m n。以上參數(shù)值可通過測(cè)量或間接計(jì)算獲得圖3。圖3m n射線從攝像機(jī)到外界空間,獲得圖像空間中 (u, v)點(diǎn)的射線在實(shí)際間中的角度由(u)和 (v)來確定。其中 u、v 是i空間中的坐標(biāo), u = 0, 1,2, ,m1;v=0,1,2,n1。另外,地面上一點(diǎn)p在s平面內(nèi)到攝像機(jī)的地面距離可以通過
15、下一距離公式計(jì)算:綜合上述因素,得到前車距離的計(jì)算公式:該模型利用射線角度的關(guān)系建立離圖像空間i中的坐標(biāo)值u, v與現(xiàn)實(shí)空間平面 s = ( x, y,o) w 的數(shù)據(jù)之間的關(guān)系。因此 , 獲得圖像中車輛的像素坐標(biāo)就可以計(jì)算出車輛在s平面中的實(shí)際位置圖4。圖4如果攝像機(jī)攝像中心軸與世界坐標(biāo)系中的 x 軸平行,則和值均為0,計(jì)算過稱亦可簡(jiǎn)化為:(2) 基于幾何關(guān)系的投影模型和攝像機(jī)標(biāo)定的測(cè)距算法圖像采集是將客觀世界的三維場(chǎng)景投影到ccd攝像機(jī)(采集器)的二維像平面(ccd光敏矩陣表面)上,這個(gè)投影一般采用幾何透視變換來描述,其依據(jù)小孔成像模型來描述此透視變換,如圖5所示。圖5 (a)ccd布置示
16、意圖 (b)距離測(cè)量幾何模型其中, f 為ccd攝像機(jī)的有效焦距; 為ccd攝像機(jī)的俯仰角度;h 為ccd攝像機(jī)的安裝高度(鏡頭中ixndao地面的高度);()為光軸與像平面的焦點(diǎn),作為像平面坐標(biāo)系的原點(diǎn),一般取為 (0,0);(x, y)為路面上一點(diǎn)p在像平面上的投影坐標(biāo)(圖3)。在這里,點(diǎn)p就是檢測(cè)出的前方車輛底部陰影的一點(diǎn)。則根據(jù)幾何關(guān)系得到點(diǎn)p與鏡頭中心的水平距離d的計(jì)算公式如下:(3) 基于逆投影變換的測(cè)距算法約束條件:(1)因高速公路坡度較小,故可假設(shè)高速公路坡度相同。車道沒有太大的彎道,在圖像檢測(cè)范圍內(nèi),基本呈直道;(2)拍攝位置固定,攝像頭垂直于地面,拍攝角度不變。在本模型中,
17、車間距離需要通過攝像圖像來得到,即從圖像信息出發(fā),解求三維環(huán)境匯總物體的空間位置、形狀、面積、長度等幾何信息,這就要建立物體點(diǎn)和像點(diǎn)之間的關(guān)系,需要建立適當(dāng)?shù)淖鴺?biāo)系。由這3個(gè)坐標(biāo)系之間的三角形相似關(guān)系可以導(dǎo)出:當(dāng)焦距 f一定時(shí),實(shí)際空間中兩車間距與圖像前方車輛處的車道寬度的乘積為一常數(shù)。距離遠(yuǎn)近的不同,前車在圖中的成像大小也不一樣,距離越遠(yuǎn),成像越小,距離越近,成像越大,任意兩次測(cè)量的距離值與成像大小成反比關(guān)系,即: 其中: d和d 分別為兩次測(cè)量的距離(單位:米), w 和 w 為兩次測(cè)量圖像中的車寬(單位:像素)。若已知像大小為w ,則可根據(jù) d = dw/w或 d = d w/w,求得此
18、時(shí)的距離d。從式中可知, d w =dw是個(gè)常量,記為測(cè)量系數(shù) q,這里 ,可以通過多次測(cè)量時(shí)記錄的和和,求出因此,距離公式可定義為: d = qw。式中:d為所求距離(單位:米);w為圖中車的寬度(單位:像素);q 為測(cè)量系數(shù)。3、gui design1、open a new gui in the guide layout editor1. start guide by typing guide at the matlab prompt2. in the guide quick start dialog box, select the blank gui (default) template
19、, and then click ok3. display the names of the gui components in the component palette:a. select file preferences guide.b. select show names in component palette.c. click ok.3、layout the simple guide guiadd, align, and label the components in the gui.1. add the three push buttons to the gui. select
20、the push button tool from the component palette at the left side of the layout editor and drag it into the layout area. create three buttons, positioning them approximately as shown in the following figure.5、label the push buttonseach of the three push buttons specifies a plot type: surf, mesh, and
21、contour. this topic shows you how to label the buttons with those options.1. select view property inspector.2. in the layout area, click the top push button.3. in the property inspector, select the string property, and then replace the existing value with the word start.4. click outside the string f
22、ield. the push button label changes to start.5. click each of the remaining push buttons in turn andrepeat steps 3 and 4. label the middle push button 3m, the neat button 2m,and the bottom button 1m.6、save the gui layoutwhen you save a gui, guide creates two files, a fig-file and a code file. the fi
23、g-file, with extension .fig, is a binary file that contains a description of the layout. the code file, with extension .m, contains matlab functions that control the gui behavior.1. save and activate your gui by selecting tools run.2. guide displays a dialog box displaying: activating will save chan
24、ges to your figure file and matlab code. do you wish to continue?click yes.3. guide opens a save as dialog box in your current folder and prompts you for a fig-file name.4. browse to any folder for which you have write privileges, and then enter the file name simple_gui for the fig-file. guide saves
25、 both the fig-file and the code file using this name.5. if the folder in which you save the gui is not on the matlab path, guide opens a dialog box, giving you the option of changing the current folder to the folder containing the gui files, or adding that folder to the top or bottom of the matlab p
26、ath.4、實(shí)驗(yàn)代碼function varargout = untitled(varargin)% untitled m-file for untitled.fig% untitled, by itself, creates a new untitled or raises the existing% singleton*.% h = untitled returns the handle to a new untitled or the handle to% the existing singleton*.% untitled(callback,hobject,eventdata,hand
27、les,.) calls the local% function named callback in untitled.m with the given input arguments.% untitled(property,value,.) creates a new untitled or raises the% existing singleton*. starting from the left, property value pairs are% applied to the gui before untitled_openingfunction gets called. an% u
28、nrecognized property name or invalid value makes property application% stop. all inputs are passed to untitled_openingfcn via varargin.% *see gui options on guides tools menu. choose gui allows only one% instance to run (singleton).% see also: guide, guidata, guihandles% copyright 2002-2003 the math
29、works, inc.% edit the above text to modify the response to help untitled% last modified by guide v2.5 08-jan-2002 15:01:51% begin initialization code - do not editgui_singleton = 1;gui_state = struct(gui_name, mfilename, . gui_singleton, gui_singleton, . gui_openingfcn, untitled_openingfcn, . gui_ou
30、tputfcn, untitled_outputfcn, . gui_layoutfcn, , . gui_callback, );if nargin & ischar(varargin1) gui_state.gui_callback = str2func(varargin1);endif nargout varargout1:nargout = gui_mainfcn(gui_state, varargin:);else gui_mainfcn(gui_state, varargin:);end% end initialization code - do not edit% - execu
31、tes just before untitled is made visible.function untitled_openingfcn(hobject, eventdata, handles, varargin)% this function has no output args, see outputfcn.% hobject handle to figure% eventdata reserved - to be defined in a future version of matlab% handles structure with handles and user data (se
32、e guidata)% varargin command line arguments to untitled (see varargin)% choose default command line output for untitledhandles.output = hobject;% update handles structureguidata(hobject, handles);% uiwait makes untitled wait for user response (see uiresume)% uiwait(handles.figure1);% - outputs from
33、this function are returned to the command line.function varargout = untitled_outputfcn(hobject, eventdata, handles) % varargout cell array for returning output args (see varargout);% hobject handle to figure% eventdata reserved - to be defined in a future version of matlab% handles structure with ha
34、ndles and user data (see guidata)% get default command line output from handles structurevarargout1 = handles.output;% - executes on button press in pushbutton3.function pushbutton3_callback(hobject, eventdata, handles)filename,pathname=uigetfile(*.jpg;*bmp;*.gif,);%+str=pathname filename;%im3=imrea
35、d(str);%axesaxes(handles.axes3);imshow(im3);% hobject handle to pushbutton3 (see gcbo)% eventdata reserved - to be defined in a future version of matlab% handles structure with handles and user data (see guidata)% - executes during object creation, after setting all properties.function axes4_createf
36、cn(hobject, eventdata, handles)% hobject handle to axes4 (see gcbo)% eventdata reserved - to be defined in a future version of matlab% handles empty - handles not created until after all createfcns called% hint: place code in openingfcn to populate axes4% - executes on button press in pushbutton7.fu
37、nction pushbutton7_callback(hobject, eventdata, handles) for n=1:3 a=imread(int2str(n),.jpg); axes(handles.axes4); % cut smallirows = size(a,1); % find the lines vertical icolumns = size(a,2); % fine lines horizontalfor m=1:100 scal=1-m/600;rowscutend = round(irows*scal); % after the cut rowcolumnsc
38、utend = round(icolumns*scal); % after the cut columnrowscuthead = irows-round(irows*scal); % after the cut rowcolumnscuthead = icolumns-round(icolumns*scal); % after the cut column acut = a(rowscuthead:rowscutend,columnscuthead:columnscutend,:);pause(0.02); % after cutif n=1 sca=3*scal sca1=sca+0.00
39、01; endif n=2 sca=2*scal sca1=sca+0.0001; endif n=3 sca=1*scal sca1=sca+0.00001; end imshow(acut);title(距離障礙物,num2str(sca1),m處);endf(n)=getframe;pause(0.05);end% hobject handle to pushbutton7 (see gcbo)% eventdata reserved - to be defined in a future version of matlab% handles structure with handles
40、 and user data (see guidata)% - executes on button press in pushbutton8.function pushbutton8_callback(hobject, eventdata, handles)for n=1:1a=imread(int2str(n),.jpg); %axes(handles.axes4);% cut smallirows = size(a,1); % find the lines verticalicolumns = size(a,2); % fine lines horizontalfor m=1:100sc
41、al=1-m/600;rowscutend = round(irows*scal); % after the cut rowcolumnscutend = round(icolumns*scal); % after the cut columnrowscuthead = irows-round(irows*scal); % after the cut rowcolumnscuthead = icolumns-round(icolumns*scal); % after the cut columnacut = a(rowscuthead:rowscutend,columnscuthead:col
42、umnscutend,:); pause(0.02); % after cuti=3*scal;ii=i+0.0001;imshow(acut);title(距離障礙物,num2str(ii),m處);endf(n)=getframe;pause(0.05);end% hobject handle to pushbutton4 (see gcbo)% eventdata reserved - to be defined in a future version of matlab% handles structure with handles and user data (see guidata
43、)% - executes on button press in pushbutton9.function pushbutton9_callback(hobject, eventdata, handles)for n=2:2a=imread(int2str(n),.jpg); axes(handles.axes4);% cut smallirows = size(a,1); % find the lines verticalicolumns = size(a,2); % fine lines horizontalfor m=1:100scal=1-m/600;rowscutend = roun
44、d(irows*scal); % after the cut rowcolumnscutend = round(icolumns*scal); % after the cut columnrowscuthead = irows-round(irows*scal); % after the cut rowcolumnscuthead = icolumns-round(icolumns*scal); % after the cut columnacut = a(rowscuthead:rowscutend,columnscuthead:columnscutend,:); pause(0.02);
45、% after cuti=2*scal;ii=i+0.0001;imshow(acut);title(距離障礙物,num2str(ii),m處);endf(n)=getframe;pause(0.05);end% hobject handle to pushbutton4 (see gcbo)% eventdata reserved - to be defined in a future version of matlab% handles structure with handles and user data (see guidata)% - executes on button press in pushbutton12.function pushbutton12_callback(hobject, eventdata, handles)for n=3:3a=imread(int2str(n),.jpg); %axes(handle
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。
最新文檔
- 辦公室施工方案
- 水泥地面刷地坪漆施工方案
- 徐州安裝塑膠跑道施工方案
- 分層開挖裝車施工方案
- 佛山廠房補(bǔ)漏施工方案
- 圍堰工程施工方案
- 黑龍江室外木紋漆施工方案
- 家長會(huì)發(fā)言稿簡(jiǎn)短
- 三下家長會(huì)語文發(fā)言稿
- 先進(jìn)雞舍發(fā)言稿
- 2022年高考(全國甲卷)語文仿真模擬卷【含答案】
- 腸瘺治療PPT醫(yī)學(xué)課件(PPT 25頁)
- 員工轉(zhuǎn)正評(píng)價(jià)表
- 道路交通事故責(zé)任認(rèn)定行政復(fù)議申請(qǐng)書范例
- 鄭州大學(xué)圖書館平立剖面效果圖
- 高效液相含量測(cè)定計(jì)算公式
- 公安機(jī)關(guān)通用告知書模板
- 《小學(xué)數(shù)學(xué)課程與教學(xué)》教學(xué)大綱
- 《手機(jī)攝影》全套課件(完整版)
- 礦井無計(jì)劃停電停風(fēng)安全技術(shù)措施
- 標(biāo)前合作合同協(xié)議書范本
評(píng)論
0/150
提交評(píng)論