2023年全國碩士研究生考試考研英語一試題真題(含答案詳解+作文范文)_第1頁
已閱讀1頁,還剩24頁未讀 繼續(xù)免費(fèi)閱讀

下載本文檔

版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進(jìn)行舉報(bào)或認(rèn)領(lǐng)

文檔簡介

1、<p><b>  畢業(yè)設(shè)計(jì)附件</b></p><p>  題 目:基于嵌入式系統(tǒng)的圖像采集系統(tǒng)</p><p>  姓 名: 華永奇 </p><p>  學(xué) 號: 2008080303107 </p><p> 

2、 學(xué) 院: 信息學(xué)院 </p><p>  專 業(yè): 電子信息工程 </p><p>  同 組 人: </p><p>  指 導(dǎo) 教 師: 田景文 </p>

3、;<p>  協(xié)助指導(dǎo)教師: </p><p>  時間: 2012 年 5 月 1 </p><p>  北京聯(lián)合大學(xué)畢業(yè)設(shè)計(jì)(論文)開題報(bào)告</p><p>  題目: 基于嵌入式系統(tǒng)的圖像采集系統(tǒng) <

4、;/p><p>  專業(yè): 電子信息工程 指導(dǎo)教師: 田景文 </p><p>  學(xué)院: 信息學(xué)院 學(xué)號: 2008080303107 </p><p>  班級: 0808030301 姓名: 華

5、永 奇 </p><p><b>  一、課題任務(wù)與目的</b></p><p><b>  1、課題任務(wù)</b></p><p>  圖像采集系統(tǒng)作為一種比較通用的圖像采集裝置,在各個行業(yè)有著廣泛應(yīng)用,本題目設(shè)計(jì)以嵌入式系統(tǒng)為核心的圖像采集系統(tǒng),具有一定的通用性。</p><p>

6、<b>  基本要求:</b></p><p>  設(shè)計(jì)系統(tǒng)的總體方案。</p><p>  設(shè)計(jì)圖像傳感器與嵌入式系統(tǒng)的接口。</p><p>  設(shè)計(jì)圖像采集和存儲的軟件。</p><p><b>  部分實(shí)驗(yàn)及調(diào)試。</b></p><p> ?、?撰寫畢業(yè)設(shè)計(jì)論文,答

7、辯。</p><p><b>  2、課題目的</b></p><p>  嵌入式是當(dāng)今最為熱門的概念之一,嵌入式系統(tǒng)是指以應(yīng)用為核心,以計(jì)算機(jī)技術(shù)為基礎(chǔ),軟硬件可剪裁,對功能、可靠性、成本、體積和功耗有嚴(yán)格要求的專用計(jì)算機(jī)系統(tǒng)。其應(yīng)用已經(jīng)滲透到各個領(lǐng)域,無論是在工業(yè)控制、交通管理、信息家電、安防,還是個人手持設(shè)備,都有著非常廣泛的應(yīng)用。而且,隨著智能化、信息化和網(wǎng)絡(luò)

8、化發(fā)展,“后PC時代"已經(jīng)來臨,這預(yù)示著嵌入式系統(tǒng)技術(shù)將會獲得更為廣闊的發(fā)展空間。例如,在通信領(lǐng)域,數(shù)字技術(shù)正在全面取代模擬技術(shù):在廣播電視領(lǐng)域,美國已經(jīng)開始實(shí)施模擬電視數(shù)字化,我國在2015年之前,也將會全面實(shí)現(xiàn)數(shù)字電視;在個人領(lǐng)域,各種嵌入式產(chǎn)品也將為個人提供移動數(shù)據(jù)處理和網(wǎng)絡(luò)通信等功能。而這些都離不開嵌入式技術(shù)的應(yīng)用。</p><p>  視頻監(jiān)測是安全防范系統(tǒng)的重要組成部分,它是一種防范能力較強(qiáng)

9、的綜合系統(tǒng)。視頻監(jiān)測以其直觀、準(zhǔn)確、及時和信息內(nèi)容豐富而廣泛應(yīng)用于許多場合。近年來,隨著計(jì)算機(jī)網(wǎng)絡(luò)以及圖像處理、傳輸技術(shù)的飛速發(fā)展視頻監(jiān)測技術(shù)也有了長足的進(jìn)步。正是由于數(shù)字視頻監(jiān)測具有傳統(tǒng)模擬監(jiān)測無法比擬的優(yōu)點(diǎn),而且符合當(dāng)前信息社會中數(shù)字化、網(wǎng)絡(luò)化和智能化的發(fā)展趨勢,所以數(shù)字視頻監(jiān)測正在逐步取代模擬監(jiān)測,廣泛應(yīng)用于各行各業(yè)。</p><p>  對于本畢設(shè)的研究,即對結(jié)合了嵌入式、網(wǎng)絡(luò)、圖像處理和傳輸技術(shù)于一體的

10、嵌入式網(wǎng)絡(luò)視頻圖像監(jiān)測系統(tǒng)的研究,意義是明顯的。不但有助于我們解決傳統(tǒng)監(jiān)測系統(tǒng)的缺點(diǎn),提高監(jiān)測系統(tǒng)功能,而且更是有實(shí)際意義,例如國內(nèi)城鎮(zhèn)化與城市建設(shè)、安全事故頻發(fā)地區(qū),智能家居和病人監(jiān)測等,這些方面都需要有新一代的監(jiān)測系統(tǒng)保證。本畢業(yè)設(shè)計(jì)主要是針對病人監(jiān)測而提出的初步解決方案。</p><p><b>  二、調(diào)研資料情況</b></p><p><b> 

11、 1、國內(nèi)外現(xiàn)狀</b></p><p>  ⑴ 視頻監(jiān)測系統(tǒng)現(xiàn)狀</p><p>  視頻監(jiān)測系統(tǒng)發(fā)展了短短二十幾年的時問,從最早的模擬檢測到前些年的數(shù)字監(jiān)測,再到現(xiàn)在方興未艾的網(wǎng)絡(luò)視頻監(jiān)測,發(fā)生了翻天覆地的變化。從技術(shù)角度出發(fā)視頻監(jiān)測系統(tǒng)的發(fā)展劃分為三代:</p><p>  傳統(tǒng)的模擬信號視頻監(jiān)測</p><p>  這類系

12、統(tǒng)主要是以模擬設(shè)備為主的閉路電視監(jiān)測系統(tǒng),圖像信息以模擬信號在視頻電纜中傳輸,一般傳輸距離不能太遠(yuǎn)。本地模擬信號監(jiān)測系統(tǒng)主要由攝像機(jī)、視頻矩陣、監(jiān)視器、卡帶式錄像機(jī)(VCR)等組成,利用視頻傳輸線將來自攝像機(jī)的視頻連接到監(jiān)視器上,利用視頻矩陣主機(jī),采用鍵盤進(jìn)行切換和控制,錄像采用使用磁帶的長時間錄像機(jī)。主要應(yīng)用于安保、生產(chǎn)管理場合等小范圍內(nèi)的監(jiān)測。這種方式傳輸距離有限,無法入網(wǎng)、監(jiān)測方式單一以及存儲信號耗費(fèi)大量存儲介質(zhì)等缺點(diǎn)。</

13、p><p>  基于PC的多媒體監(jiān)測</p><p>  20世紀(jì)90年代中期,基于PC的多媒體監(jiān)測隨著數(shù)字視頻壓縮編碼技術(shù)的發(fā)展而產(chǎn)生,PC機(jī)的普及也推動了此類技術(shù)的發(fā)展。系統(tǒng)在遠(yuǎn)端有若干個攝像機(jī)、各種視頻采集設(shè)備,獲取圖像信息,經(jīng)過視頻壓縮卡處理,通過通信網(wǎng)絡(luò)將這些信息傳到監(jiān)測中心。</p><p>  這類監(jiān)測系統(tǒng)功能較強(qiáng),便于現(xiàn)場操作,但穩(wěn)定性不夠好,結(jié)構(gòu)復(fù)雜,

14、視頻前端(如CCD等視頻信號的采集、壓縮、通信)較為復(fù)雜,可靠性不高,功耗高,費(fèi)用高;需要有多人值守;同時,軟件的開放性也不好,傳輸距離明顯受限。PC機(jī)也需專人管理,特別是在環(huán)境或空間不適宣的監(jiān)測點(diǎn),這種方式不理想。</p><p> ?、?基于嵌入式的網(wǎng)絡(luò)視頻監(jiān)測</p><p>  視頻監(jiān)測系統(tǒng)越來越多的應(yīng)用于各個領(lǐng)域,比如,智能小區(qū)、銀行的安全監(jiān)測,醫(yī)院病房的監(jiān)護(hù),工廠車問的現(xiàn)場視頻

15、監(jiān)測以及應(yīng)用于遠(yuǎn)程網(wǎng)絡(luò)實(shí)驗(yàn)中觀看實(shí)驗(yàn)設(shè)備、觀看操作、查看實(shí)驗(yàn)結(jié)果等等。對于視頻監(jiān)測系統(tǒng)的要求也是越來越高:實(shí)時性好、可靠性高、操作簡單、可以接入網(wǎng)絡(luò)。這樣的數(shù)字化、網(wǎng)絡(luò)化、低成本的視頻監(jiān)測系統(tǒng)的開發(fā)與設(shè)計(jì)正受到重視。</p><p>  20世紀(jì)90年代末,隨著計(jì)算機(jī)、網(wǎng)絡(luò)、電子與通信、圖像處理等技術(shù)的飛速發(fā)展,基于嵌入式技術(shù)的遠(yuǎn)程網(wǎng)絡(luò)視頻監(jiān)測技術(shù)應(yīng)用而生。這類視頻監(jiān)測系統(tǒng)集中了多媒體技術(shù)、數(shù)字圖像處理、網(wǎng)絡(luò)傳輸

16、、嵌入式等最新技術(shù)。第三代視頻監(jiān)測技術(shù)不僅僅可解決圖像傳輸、遠(yuǎn)程控制、現(xiàn)場信號采集等監(jiān)測功能,還可提供高質(zhì)量的監(jiān)測圖像和便捷的監(jiān)測方式。它的主要原理是:嵌入式服務(wù)端采用微處理器和嵌入式實(shí)時操作系統(tǒng),結(jié)合網(wǎng)絡(luò)技術(shù),將采集來的視頻圖像經(jīng)過壓縮處理,傳輸?shù)骄W(wǎng)絡(luò),實(shí)現(xiàn)網(wǎng)絡(luò)視頻監(jiān)測。嵌入式視頻監(jiān)測系統(tǒng)以其小巧、靈活、低成本、性能穩(wěn)定、高性能的特點(diǎn)而獨(dú)具優(yōu)勢,結(jié)合TCP/LP技術(shù),通過建立C/S或者B/S工作模型來實(shí)現(xiàn)網(wǎng)絡(luò)視頻監(jiān)測。這類系統(tǒng)可以直接

17、連入以太網(wǎng),具有靈活方便、即插即看等特點(diǎn)。嵌入式視頻服務(wù)器、網(wǎng)絡(luò)攝像機(jī)以及嵌入式 DVR 正是這類視頻監(jiān)測產(chǎn)品的代表。</p><p> ?、?嵌入式網(wǎng)絡(luò)視頻監(jiān)控系統(tǒng)優(yōu)點(diǎn)</p><p>  嵌入式網(wǎng)絡(luò)視頻監(jiān)測系統(tǒng)與其它監(jiān)測系統(tǒng)相比較,具有如下優(yōu)點(diǎn): </p><p>  ① 嵌入式網(wǎng)絡(luò)視頻監(jiān)測系統(tǒng)實(shí)際上是基于TCP/IP網(wǎng)絡(luò)技術(shù)開發(fā)出來的,直接連入網(wǎng)絡(luò),即插即看,

18、擴(kuò)大布控地域,而且增加設(shè)備只是IP地址的擴(kuò)充,方便使用、節(jié)省成本。</p><p> ?、谇度胧揭曨l監(jiān)測系統(tǒng)采用嵌入式實(shí)時多任務(wù)操作系統(tǒng),系統(tǒng)的實(shí)時性、穩(wěn)定性、可靠性大大提高,也無需專人管理,非常適合于無人值守的環(huán)境。</p><p> ?、刍诰W(wǎng)絡(luò)的特性可以使得監(jiān)測更為靈活,隨時隨地得到現(xiàn)場的情況,通過聯(lián)網(wǎng)可以使得攝像機(jī)具備了強(qiáng)大的功能,成為許多場合的監(jiān)測手段。由于網(wǎng)絡(luò)的雙向傳輸特性,還

19、可以通過控制與攝像機(jī)相連的云臺來實(shí)現(xiàn)攝像機(jī)的全方位監(jiān)測,通過網(wǎng)絡(luò)對現(xiàn)場進(jìn)行控制,還可以通過適當(dāng)?shù)膱D形分析辨識方法,實(shí)現(xiàn)對監(jiān)測現(xiàn)場異常情況的實(shí)時監(jiān)測報(bào)普,以及對目標(biāo)的追蹤等。</p><p>  2、視頻監(jiān)測系統(tǒng)的發(fā)展方向</p><p>  視頻監(jiān)測正從以前的模擬監(jiān)測到現(xiàn)在的數(shù)字監(jiān)測;從現(xiàn)場監(jiān)測到遠(yuǎn)程監(jiān)測;從有人值守監(jiān)測到現(xiàn)在的無人值守監(jiān)測,視頻監(jiān)測詎朝著數(shù)字化、網(wǎng)絡(luò)化、集成化的嵌入式視頻

20、監(jiān)測方向蓬勃發(fā)展。數(shù)字化是網(wǎng)絡(luò)化的前提,網(wǎng)絡(luò)化又是系統(tǒng)集成化的基礎(chǔ),所以,視頻監(jiān)測發(fā)展的最大兩個特點(diǎn)就是數(shù)字化和網(wǎng)絡(luò)化。數(shù)字化是21世紀(jì)的特征,是以信息技術(shù)為核心的電子技術(shù)發(fā)展的必然。系統(tǒng)的網(wǎng)絡(luò)化在某種程度上打破了布控區(qū)域和設(shè)備擴(kuò)展的地域和數(shù)量界限。系統(tǒng)網(wǎng)絡(luò)化將使整個網(wǎng)絡(luò)系統(tǒng)硬件和軟件資源的共享以及任務(wù)和負(fù)載的共享,這也是系統(tǒng)集成的一個重要概念。</p><p>  3、目前視頻監(jiān)測系統(tǒng)國內(nèi)外常見方案設(shè)計(jì)<

21、/p><p>  目前,國內(nèi)外對基于嵌入式網(wǎng)絡(luò)視頻監(jiān)測系統(tǒng)的研究,一般集中于嵌入式視頻監(jiān)測系統(tǒng)的設(shè)計(jì)、嵌入式操作系統(tǒng)的研究、視頻圖像的網(wǎng)絡(luò)傳輸以及視頻圖像處理等幾個方面。在嵌入式視頻監(jiān)測系統(tǒng)設(shè)計(jì)方面一般是考慮系統(tǒng)的整體結(jié)構(gòu)和功能,例如小型網(wǎng)絡(luò)攝像機(jī),系統(tǒng)由圖像傳感器、嵌入式處理器、圖像處理器、網(wǎng)絡(luò)接口組成,通過壓縮優(yōu)化算法和背景差分算法可以使攝像機(jī)實(shí)現(xiàn)實(shí)時的圖像壓縮、傳輸,并能跟蹤目標(biāo),該系統(tǒng)的主要特點(diǎn)是實(shí)時性的提高

22、;在嵌入式操作系統(tǒng)方面,一般集中于嵌入式操作系統(tǒng)在視頻監(jiān)測系統(tǒng)中的應(yīng)用研究,例如在嵌入式Linux下對視頻采集設(shè)備驅(qū)動程序的研究等;在對視頻圖像網(wǎng)絡(luò)傳輸?shù)难芯恐校?。有在IP組播方式下的網(wǎng)絡(luò)視頻傳輸方案,可以大大的節(jié)約網(wǎng)絡(luò)帶寬,提高視頻的播放效率或者采用流媒體的格式傳送視頻圖像數(shù)據(jù),可以更好的實(shí)現(xiàn)視頻的傳輸及播放等;在視頻監(jiān)測領(lǐng)域關(guān)于視頻圖像處理的研究一般是通過一定的圖形分析算法,實(shí)現(xiàn)目標(biāo)識別,目標(biāo)跟蹤,以及報(bào)警等功能。例如利用背景差

23、分算法在圖像處理中,控制運(yùn)動模塊使攝像機(jī)可以跟蹤信息庫中的目標(biāo)網(wǎng)等。</p><p>  隨著壓縮編碼技術(shù)、計(jì)算機(jī)網(wǎng)絡(luò)技術(shù)和嵌入式系統(tǒng)的發(fā)展,以嵌入式視頻服務(wù)器為核心的視頻監(jiān)測系統(tǒng)開始在市場上嶄露頭角,該系統(tǒng)不需要處理模擬視頻信號的PC,而是把攝像機(jī)輸出的模擬視頻信號通過內(nèi)置的嵌入式視頻編碼器直接轉(zhuǎn)換成數(shù)字信號,通過計(jì)算機(jī)網(wǎng)絡(luò)傳輸出去,嵌入式視頻服務(wù)器具備視頻編碼處理、網(wǎng)絡(luò)通信、自動控制等強(qiáng)大功能,直接支持網(wǎng)絡(luò)視

24、頻傳輸和網(wǎng)絡(luò)管理,使得監(jiān)測范圍達(dá)到前所未有的廣度。</p><p>  目前,國內(nèi)在這方面的研究剛剛起步,隨著數(shù)字技術(shù)的發(fā)展、圖像數(shù)字壓縮編碼技術(shù)及標(biāo)準(zhǔn)的改進(jìn)、芯片成本的不斷下降、從事研究的單位越來越多。</p><p>  現(xiàn)階段,嵌入式網(wǎng)絡(luò)視頻監(jiān)測系統(tǒng)的解決方案主要有以下幾種:</p><p> ?、?視頻采集芯片+DSP處理器。該方案中由視頻采集芯片完成圖像的

25、預(yù)處理,由DSP完成圖像的編碼:基于MPEG-4、H.263或MJPEG標(biāo)準(zhǔn)的壓縮,經(jīng)以太網(wǎng)網(wǎng)絡(luò)傳輸。方案的主要缺點(diǎn)是控制不夠靈活,不適合作系統(tǒng)控制,因?yàn)镈SP通常沒有強(qiáng)大的操作系統(tǒng)。</p><p>  ⑵ DSP處理器+嵌入式處理器。該方案采用由DSP完成基于MPEG-4、H.263或MJPEG標(biāo)準(zhǔn)的圖像壓縮,在嵌入式處理器上運(yùn)行嵌入式OS(如嵌入式Linux OS)進(jìn)行系統(tǒng)控制和網(wǎng)絡(luò)傳輸。方案的主要缺點(diǎn)是:

26、由于有兩個主要的芯片,設(shè)計(jì)、調(diào)試、使用較難,系統(tǒng)成本偏高。</p><p> ?、?圖像采集芯片+嵌入式處理器。該方案中,在嵌入式處理器上運(yùn)行嵌入式OS(如嵌入式Linux OS)進(jìn)行系統(tǒng)控制和網(wǎng)絡(luò)傳輸。方案的主要缺點(diǎn)是:缺乏強(qiáng)大的圖像處理能力,很難滿足高實(shí)時性要求。</p><p> ?、?其他方案。DSP中央處理器完成圖像圖像壓縮編碼、編碼數(shù)據(jù)網(wǎng)絡(luò)傳輸和本地存儲,采用CPLD完成圖像采

27、集的控制邏輯的脫機(jī)遠(yuǎn)程視頻監(jiān)測方案。</p><p><b>  4、調(diào)研及參考資料</b></p><p>  [1] 方彥軍. 嵌入式系統(tǒng)原理與設(shè)計(jì),國防工業(yè)出版社 2011.7</p><p>  [2] 趙燕. 傳感器原理及應(yīng)用, 北京大學(xué)出版社, 2011.7</p><p>  [3] 伊拉希 (美)(Ela

28、hiA.). 網(wǎng)絡(luò)通信技術(shù),科學(xué)出版社,2007.12</p><p>  [4] 任哲. 嵌入式實(shí)時操作系統(tǒng)uC/OS-II原理及應(yīng)用(第2版),北京航空航天大學(xué)出版社.2009.10</p><p>  [5] 張綺文. 解書剛.ARM嵌入式常用模塊與綜合系統(tǒng)設(shè)計(jì)實(shí)例精講(第2版), 電子工業(yè)出版社.2008.10</p><p>  [6] 劉文耀. 數(shù)字圖像

29、:采集與處理, 電子工業(yè)出版社, 2007.8</p><p>  [7] 王晨營,時良平 《智能手機(jī)家居監(jiān)測系統(tǒng)的設(shè)計(jì)》 科技創(chuàng)新導(dǎo)報(bào) 2008年lO月</p><p>  [8] 許雪梅,周文,徐蔚欽,黃帥 《基于ARM9+LINUX的無線視頻監(jiān)控系統(tǒng)的設(shè)計(jì)》 刊名:計(jì)算機(jī)測量與控制 年,卷(期): 2010,18(11)</p><p>  

30、[9] 王戩,王耀青 《WinCE.Net系統(tǒng)下的usb camera驅(qū)動程序開發(fā)》</p><p>  刊名:微機(jī)算機(jī)信息. 2008</p><p>  [10] 李侃,廖啟征 《基于S3C2410平臺與嵌入式Linux的圖像采集應(yīng)用》</p><p>  刊名:微計(jì)算機(jī)信息 年,卷(期): 2006(8)</p><p>  [1

31、1] 錢華明, 劉英明,張振旅 《基于S3C2410嵌入式無線視頻監(jiān)控系統(tǒng)的設(shè)計(jì)》 刊名:計(jì)算機(jī)測量與控制 年,卷(期): 2009,17(6)</p><p>  三、初步設(shè)計(jì)方法與實(shí)施方案</p><p>  1、系統(tǒng)的總體方案設(shè)計(jì)</p><p>  整個系統(tǒng)由硬件和軟件兩部分組成。</p><p>  硬件部分由主控制板模塊、攝

32、像頭采集模塊、傳輸模塊和視頻監(jiān)控PC等組成。軟件部分由linux2.6.12內(nèi)核、攝像頭驅(qū)動、網(wǎng)卡驅(qū)動以及視頻圖像的采集程序、圖像的發(fā)送和接收程序等構(gòu)成。</p><p>  系統(tǒng)組成結(jié)構(gòu)如圖1所示。首先,通過攝像頭采集程序?qū)D像進(jìn)行采集,并通過攝像頭中的DSP芯片對圖像進(jìn)行JPEG壓縮,然后通過USB將采集到的數(shù)據(jù)發(fā)送到主控制板上,主控制板上對接收到的數(shù)據(jù)進(jìn)行處理及存儲,當(dāng)需要對視頻進(jìn)行監(jiān)控時,主控制板再運(yùn)行圖

33、像的發(fā)送程序通過網(wǎng)卡將圖像發(fā)送出去,最后我們通過接收程序使用另一個網(wǎng)卡對圖像進(jìn)行接收,最終顯示在windows PC顯示屏中。</p><p>  圖1 總系統(tǒng)構(gòu)成</p><p><b>  2、硬件設(shè)計(jì)</b></p><p>  將飛凌公司的FL2440開發(fā)板作為主控制板,使用USB攝像頭進(jìn)行圖像的采集,作為采集模塊,并通過USB傳輸

34、到主控制板。傳輸模塊使用有線(無線)網(wǎng)卡,采用IEEE 802.3x以太局域網(wǎng)技術(shù),進(jìn)行數(shù)據(jù)的接發(fā)。宿主機(jī)通過串口與開發(fā)板相連,對其進(jìn)行控制及程序的調(diào)試。整個硬件設(shè)計(jì)如圖2所示。</p><p><b>  圖2 系統(tǒng)硬件圖</b></p><p><b>  主控制板</b></p><p>  主控制板芯片采用飛凌公

35、司的FL2440開發(fā)板,內(nèi)部集成了三星公司ARM920T內(nèi)核的16/32位RISC嵌入式微處理器S3C2440,主頻高達(dá)400MHz,能夠完成JPEG軟件圖像壓縮以及USB數(shù)據(jù)傳送的要求。FL2440內(nèi)置豐富的外設(shè)資源,其中包括256MB NAND Flash、64MB SDRAM,串口和USB等接口控制電路</p><p><b>  數(shù)字?jǐn)z像頭</b></p><p&

36、gt;  選用中星微的ZC301PH 攝像頭,內(nèi)部有A/D轉(zhuǎn)換芯片和DSP芯片,攝像頭輸出的是JPEG流,最大分辨率能達(dá)到640×480,支持的最小分辨率為160X 120。當(dāng)圖片大小設(shè)置成640×480,調(diào)色板設(shè)置成YUV420P時,經(jīng)攝像頭內(nèi)部DSP處理后,輸出JPEG流,圖像數(shù)據(jù)量大為減少,加快了USB輸出到處理器的速度。</p><p><b>  3、軟件設(shè)計(jì)</b&

37、gt;</p><p>  因開發(fā)應(yīng)用環(huán)境是在嵌入式Linux系統(tǒng)下進(jìn)行的,所以首先需要將嵌入式Linux的環(huán)境搭建好,應(yīng)用程序開發(fā)的過程中,才能夠進(jìn)行編譯、調(diào)試和運(yùn)行。</p><p>  嵌入式Linux環(huán)境的建立</p><p>  本文選用的是FL2440開發(fā)板,飛凌公司已給了建立嵌入式Linux環(huán)境所需要的開發(fā)包,我們依次對uboot,kernel,cra

38、mfs文件系統(tǒng)進(jìn)行交叉編譯后,通過USB下載到開發(fā)板上,有效地對開發(fā)板進(jìn)行控制和調(diào)試。</p><p>  攝像頭驅(qū)動和網(wǎng)卡驅(qū)動的移植</p><p>  將開發(fā)板自帶的有線網(wǎng)卡驅(qū)動源代碼以及在網(wǎng)上將萬能usb攝像頭驅(qū)動程序源代碼gspca webcam drivers下載下來,gspca webcam drivers 是linux下攝像頭支持的最廣泛的一個驅(qū)動,

39、60; 這是由一個法國醫(yī)生(http://mxhaard.free.fr/)所設(shè)計(jì)編寫的開源驅(qū)動,針對FL2440開發(fā)板修改后,把它們放在相應(yīng)的內(nèi)核目錄下,修改相應(yīng)的Kconfig,Makefile和編譯器,內(nèi)核選項(xiàng)等修改后,通過make menuconfig命令進(jìn)入內(nèi)核配置界面,選擇模塊的方式,重新編譯內(nèi)核,最終得到它們相應(yīng)的驅(qū)動(.ko文件)。</p><p>  基于V4L的視頻采集程序</p>

40、<p>  視頻采集是整個視頻采集模塊的核心。Video4Linux(簡稱V4L)是Linux專門針對視頻設(shè)備提供的應(yīng)用程序接口,是Linux對視頻設(shè)備的內(nèi)核級驅(qū)動。通過它可以執(zhí)行打開、讀寫及關(guān)閉等操作。視頻采集程序的流程如圖3所示。</p><p>  圖3 視頻采集流程圖</p><p>  Video4Linux的結(jié)構(gòu)體struct v4l_struct包括以下變量

41、struct video_capability描述了設(shè)備名稱,可支持的分辨率、信號源等攝像頭的基本信息,通過ioctl函數(shù)的VIDIOCGCAP命令獲得這些基本信息;struct video_picture描述了設(shè)備采集圖像的各種屬性,這些屬性可通過ioctl函數(shù)的VIDIOCGPICT命令獲得,使用VIDIOCSPICT可改變圖像的屬性;struct video_mbuf包含了利用內(nèi)存映射獲取數(shù)據(jù)時的幀信息,它可使用VIDIOCGMB

42、UF獲??;命令VIDIOCAMCAPTURE和VIDIOSYNC,分別用于獲取視頻圖像、判斷圖像是否截取成功。</p><p>  在V4L中有兩種方式采集視頻:①用read()函數(shù)直接讀取方式;②用mmap()函數(shù)內(nèi)存映射方式截取視頻。mmap()函數(shù)通過系統(tǒng)調(diào)用使得進(jìn)程之間通過映射同一個普通文件實(shí)現(xiàn)共享內(nèi)存,本系統(tǒng)采用內(nèi)存映射方式。USB攝像頭在Linux中的設(shè)備文件名為/dev/video0,視頻采集程序便

43、是針對此設(shè)備名操作。加載驅(qū)動后,利用pthread_create()函數(shù)創(chuàng)建采集線程wl,調(diào)用open()函數(shù)打開設(shè)備,調(diào)用成功表示捕獲了視頻硬件返回其描述符;利用ioctl中的VlDIOCGCAP命令獲取設(shè)備文件的相關(guān)信息,VIDIOCGPICT讀取采集圖像的屬性,使VIDIOCSPICT,</p><p>  以及修改v_mmap中關(guān)于圖像幀的設(shè)置等操作,對設(shè)備進(jìn)行初始化設(shè)置。完成后,使用VIDIOCAMCA

44、PTURE捕獲視頻圖像,通過VIDIOSYNC命令判斷圖像采集成功后,繼續(xù)下一幀數(shù)據(jù)的采集。 </p><p><b>  網(wǎng)絡(luò)傳輸程序</b></p><p>  本文選用的是基于802.3x的以太局域網(wǎng),可支持高達(dá)54Mbps的數(shù)據(jù)流,而我們選用的以太網(wǎng)卡,可支持高達(dá)100Mbps的數(shù)據(jù)流。采用socket()編程方式,初步利用利用TCP/IP協(xié)議(或RTP/RT

45、CP協(xié)議)基于線程對數(shù)據(jù)進(jìn)行無線傳輸。程序分為服務(wù)器端和客戶端程序。通信流程如圖5所示。</p><p>  圖5 網(wǎng)絡(luò)傳輸流程圖</p><p>  在服務(wù)端,首先利用pthread_create()創(chuàng)建server_th線程,使用socket()函數(shù)創(chuàng)建流式套接字,用bind()函數(shù)建立服務(wù)器端地址與套接字的對應(yīng)關(guān)系,用listen()函數(shù)將剛創(chuàng)建的主動套接字轉(zhuǎn)化成被動套接字,使它

46、處于監(jiān)聽模式下,指示內(nèi)核應(yīng)接受發(fā)向該套接字的連接請求。而此時,服務(wù)器的狀態(tài)從CLOSED轉(zhuǎn)換到了LISTEN狀態(tài)。</p><p>  在客戶端PC,創(chuàng)建套接字程序,使用connect()函數(shù)對服務(wù)器建立連接。當(dāng)TCP的三次握手完成后,服務(wù)器程序?qū)?shù)據(jù)從視頻緩沖區(qū)拷到網(wǎng)絡(luò)傳輸緩沖區(qū),最后將數(shù)據(jù)發(fā)送給客戶端程序。客戶端程序?qū)⒔邮盏綌?shù)據(jù)放到接收信息的數(shù)據(jù)緩沖區(qū)中,對其解壓縮后,顯示在監(jiān)控PC上。</p>

47、<p><b>  四、預(yù)期結(jié)果</b></p><p>  以畢業(yè)論文方式提交實(shí)驗(yàn)結(jié)果及測試報(bào)告,并用實(shí)驗(yàn)板連接監(jiān)控電腦演示實(shí)驗(yàn)結(jié)果。</p><p><b>  五、進(jìn)度計(jì)劃</b></p><p>  17周-18周:根據(jù)本課題的具體設(shè)計(jì)任務(wù),熟悉課題,收集相關(guān)資料,進(jìn)行調(diào)研和分析。</p>

48、<p>  19周-20周:確定總體方案。撰寫并完善開題報(bào)告,進(jìn)行開題答辯。</p><p>  01周-04周:學(xué)習(xí)相關(guān)知識,設(shè)計(jì)系統(tǒng)的總體方案。嵌入式圖像采集系統(tǒng)的硬件設(shè)計(jì)。設(shè)計(jì)圖像傳感器與嵌入式系統(tǒng)的接口。</p><p>  05周-08周:嵌入式圖像采集系統(tǒng)的軟件設(shè)計(jì)。設(shè)計(jì)圖像采集和存儲的軟件。</p><p>  09周-10周:實(shí)驗(yàn)及調(diào)試。

49、</p><p>  11周-13周:總結(jié)畢業(yè)設(shè)計(jì)階段的工作,撰寫畢設(shè)論文,畢業(yè)設(shè)計(jì)答辯。</p><p>  北京聯(lián)合大學(xué)畢業(yè)設(shè)計(jì)(論文)外文原文及譯文</p><p><b>  一、外文原文</b></p><p>  Anatomy of the Linux networking stack</p>

50、<p>  From sockets to device drivers</p><p>  Summary:  One of the greatest features of the Linux® operating system is its networking stack. It was initially a derivative of the BSD stack and

51、 is well organized with a clean set of interfaces. Its interfaces range from the protocol agnostics, such as the common sockets layer interface or the device layer, to the specific interfaces of the individual networking

52、 protocols. This article explores the structure of the Linux networking stack from the perspective of its layers and also examines some</p><p>  Protocols introduction</p><p>  While formal intr

53、oductions to networking commonly refer to the Open Systems Interconnection (OSI) model, this introduction to the basic networking stack in Linux uses the four-layer model known as the Internet model (see Figure 1).</p

54、><p>  Figure 1. The Internet model of a network stack</p><p>  At the bottom of the stack is the link layer. The link layer refers to the device drivers providing access to the physical layer, whi

55、ch could be numerous mediums, such as serial links or Ethernet devices. Above the link layer is the network layer, which is responsible for directing packets to their destinations. The next layer, called the transport la

56、yer, is responsible for peer-to-peer communication (for example, within a host). While the network layer manages communication between hosts, the t</p><p>  Practically speaking, the layers of the networking

57、 stack go by much more recognizable names. At the link layer, you find Ethernet, the most common high-speed medium. Older link-layer protocols include the serial protocols such as the Serial Line Internet Protocol (SLIP)

58、, Compressed SLIP (CSLIP), and the Point-to-Point Protocol (PPP). The most common network layer protocol is Internet Protocol (IP), but other protocols exist at the network layer that satisfy other needs, such as the Int

59、ernet Cont</p><p>  Core network architecture</p><p>  Now on to the architecture of the Linux network stack and how it implements the Internet model. Figure 2 provides a high-level view of the

60、Linux network stack. At the top is the user space layer, or application layer, which defines the users of the network stack. At the bottom are the physical devices that provide connectivity to the networks (serial or hig

61、h-speed networks such as Ethernet). In the middle, or kernel space, is the networking subsystem that is the focus of this article. Through th</p><p>  Figure 2. Linux high-level network stack architecture<

62、;/p><p>  First, here's a quick overview of the core elements of the Linux networking subsystem, followed by more detail in later sections. At the top (see Figure 2) is the system call interface. This simpl

63、y provides a way for user-space applications to gain access to the kernel's networking subsystem. Next is a protocol-agnostic layer that provides a common way to work with the underlying transport-level protocols. Ne

64、xt are the actual protocols, which in Linux include the built-in protocols of TCP, UDP, </p><p>  System call interface</p><p>  The system call interface can be described from two perspectives.

65、 When a networking call is made by the user, it is multiplexed through the system call interface into the kernel. This ends up as a call to sys_socketcall in ./net/socket.c, which then further demultiplexes the call to i

66、ts intended target. The other perspective of the system call interface is the use of normal file operations for networking I/O. For example, typical read and write operations may be performed on a networking socket </

67、p><p>  Protocol agnostic interface</p><p>  The sockets layer is a protocol agnostic interface that provides a set of common functions to support a variety of different protocols. The sockets laye

68、r not only supports the typical TCP and UDP protocols, but also IP, raw Ethernet, and other transport protocols, such as Stream Control Transmission Protocol (SCTP).</p><p>  Communication through the networ

69、k stack takes place with a socket. The socket structure in Linux is struct sock, which is defined in linux/include/net/sock.h. This large structure contains all of the required state of a particular socket, including the

70、 particular protocol used by the socket and the operations that may be performed on it.</p><p>  The networking subsystem knows about the available protocols through a special structure that defines its capa

71、bilities. Each protocol maintains a structure called proto (found in linux/include/net/sock.h). This structure defines the particular socket operations that can be performed from the sockets layer to the transport layer

72、(for example, how to create a socket, how to establish a connection with a socket, how to close a socket, and so on). </p><p>  Network protocols</p><p>  The network protocols section defines t

73、he particular networking protocols that are available (such as TCP, UDP, and so on). These are initialized at start of day in a function called inet_init in linux/net/ipv4/af_inet.c (as TCP and UDP are part of the inet f

74、amily of protocols). The inet_init function registers each of the built-in protocols using the proto_register function. This function is defined in linux/net/core/sock.c, and, in addition to adding the protocol to the ac

75、tive protocol list, i</p><p>  You can see how individual protocols identify themselves through the proto structure in files tcp_ipv4.c, udp.c, and raw.c in linux/net/ipv4/. Each of these protocol structures

76、 are mapped by type and protocol into the inetsw_array, which maps the built-in protocols to their operations. The structure of inetsw_array and its relationships is shown in Figure 3. Each of the protocols in this array

77、 is initialized at start of day into inetsw through a call to inet_register_protosw from inet_init. Func</p><p>  Figure 3. Structure of the Internet protocol array</p><p>  Socket protocol corr

78、elation</p><p>  Recall that when a socket is created one defines the type and protocol, such as my_sock = socket( AF_INET, SOCK_STREAM, 0 ). The AF_INET indicates an Internet address family with a stream so

79、cket defined as SOCK_STREAM (as shown here in inetsw_array). </p><p>  Note from Figure 3 that the proto structure defines the transport-specific methods, while the proto_ops structure defines the general so

80、cket methods. Additional protocols can be added to inetsw protocol switch through a call to inet_register_protosw. For example, the SCTP adds itself through a call to sctp_init in linux/net/sctp/protocol.c. For more info

81、rmation about the SCTP, check out the Resources section.</p><p>  Data movement for sockets takes place using a core structure called the socket buffer (sk_buff). An sk_buff contains packet data and also sta

82、te data that cover multiple layers of the protocol stack. Each packet sent or received is represented with an sk_buff. The sk_buff structure is defined in linux/include/linux/skbuff.h and shown in Figure 4.</p>&l

83、t;p>  Figure 4. Socket buffer and its relationship to other structures</p><p>  As shown, multiple sk_buff may be chained together for a given connection. Each sk_buff identifies the device structure (net

84、_device) to which the packet is being sent or from which the packet was received. As each packet is represented with an sk_buff, the packet headers are conveniently located through a set of pointers (th, iph, and mac for

85、 the Media Access Control, or MAC, header). Because the sk_buff are central to the socket data management, a number of support functions have been created t</p><p>  Socket buffers are designed to be linked

86、together for a given socket and include a multitude of information, including the links to the protocol headers, a timestamp (when the packet was sent or received), and the device associated with the packet.</p>&

87、lt;p>  Device agnostic interface</p><p>  Below the protocols layer is another agnostic interface layer that connects protocols to a variety of hardware device drivers with varying capabilities. This laye

88、r provides a common set of functions to be used by lower-level network device drivers to allow them to operate with the higher-level protocol stack.</p><p>  First, device drivers may register or unregister

89、themselves to the kernel through a call to register_netdevice or unregister_netdevice. The caller first fills out the net_device structure and then passes it in for registration. The kernel calls its init function (if on

90、e is defined), performs a number of sanity checks, creates a sysfs entry, and then adds the new device to the device list (a linked list of devices active in the kernel). You can find the net_device structure in linux/in

91、clude/linux</p><p>  To send an sk_buff from the protocol layer to a device, the dev_queue_xmit function is used. This function enqueues an sk_buff for eventual transmission by the underlying device driver (

92、with the network device being defined by the net_device or sk_buff->dev reference in the sk_buff). The dev structure contains a method, called hard_start_xmit, that holds the driver function for initiating transmissio

93、n of an sk_buff.</p><p>  Receiving a packet is performed conventionally with netif_rx. When a lower-level device driver receives a packet (contained within an allocated sk_buff), the sk_buff is passed up to

94、 the network layer through a call to netif_rx. This function then queues the sk_buff to an upper-layer protocol's queue for further processing through netif_rx_schedule. You can find the dev_queue_xmit and netif_rx f

95、unctions in linux/net/core/dev.c.</p><p>  Recently, a new application program interface (NAPI) was introduced into the kernel to allow drivers to interface with the device agnostic layer (dev). Some drivers

96、 use NAPI, but the large majority still use the older frame reception interface (by a rough factor of six to one). NAPI can yield better performance under high loads by avoiding taking an interrupt for each incoming fram

97、e.</p><p>  Device drivers</p><p>  At the bottom of the network stack are the device drivers that manage the physical network devices. Examples of devices at this layer include the SLIP driver

98、over a serial interface or an Ethernet driver over an Ethernet device.</p><p>  At initialization time, a device driver allocates a net_device structure and then initializes it with its necessary routines. O

99、ne of these routines, called dev->hard_start_xmit, defines how the upper layer should enqueue an sk_buff for transmission. This routine takes an sk_buff. The operation of this function is dependent upon the underlying

100、 hardware, but commonly the packet described by the sk_buff is moved to a hardware ring or queue. Frame receipt, as described in the device agnostic layer, </p><p>  After a device driver configures its inte

101、rfaces in the dev structure, a call to register_netdevice makes it available for use. You can find the drivers specific to network devices in linux/drivers/net.</p><p>  Going further</p><p>  T

102、he Linux source code is a great way to learn about the design of device drivers for a multitude of device types, including network device drivers. What you'll find is a variation in design and usage of the available

103、kernel APIs, but each is useful for instruction or as a starting point for a new device driver. The remaining code in the network stack is common and usable unless you require a new protocol. Even then, the implementatio

溫馨提示

  • 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
  • 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 眾賞文庫僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負(fù)責(zé)。
  • 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時也不承擔(dān)用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。

評論

0/150

提交評論