殷建軍 潘春華 肖克輝 葉耀文 劉小平 肖德琴
(華南農(nóng)業(yè)大學(xué)數(shù)學(xué)與信息學(xué)院,廣州510642)
基于無(wú)線圖像傳感器網(wǎng)絡(luò)的農(nóng)田遠(yuǎn)程監(jiān)測(cè)系統(tǒng)
殷建軍 潘春華 肖克輝 葉耀文 劉小平 肖德琴
(華南農(nóng)業(yè)大學(xué)數(shù)學(xué)與信息學(xué)院,廣州510642)
為了實(shí)時(shí)獲取農(nóng)田圖像和視頻信息,提出了基于無(wú)線圖像傳感器網(wǎng)絡(luò)的農(nóng)田遠(yuǎn)程監(jiān)測(cè)系統(tǒng)。針對(duì)當(dāng)前圖像傳感器節(jié)點(diǎn)存在的不足,基于CMOS圖像傳感器和S3C6410嵌入式處理器設(shè)計(jì)了低成本、高分辨率的無(wú)線圖像傳感器節(jié)點(diǎn),并研究了基于驅(qū)動(dòng)層和應(yīng)用層協(xié)作的分辨率實(shí)時(shí)調(diào)整算法,使得節(jié)點(diǎn)具備10種不同的分辨率,最高分辨率可達(dá)500萬(wàn)像素,而且分辨率可根據(jù)用戶需求實(shí)時(shí)調(diào)整,以滿足用戶對(duì)不同圖像精度的需求。采用WiFi技術(shù)構(gòu)建無(wú)線圖像傳感器網(wǎng)絡(luò),并通過(guò)4G網(wǎng)絡(luò)遠(yuǎn)程傳輸圖像和視頻到服務(wù)器。在服務(wù)器端開發(fā)了基于Web的可視化農(nóng)田信息管理軟件,實(shí)現(xiàn)對(duì)采集的數(shù)據(jù)進(jìn)行有效存儲(chǔ)、管理和應(yīng)用,并為用戶提供網(wǎng)絡(luò)服務(wù)。部署了該系統(tǒng)并進(jìn)行了長(zhǎng)時(shí)間的運(yùn)行測(cè)試試驗(yàn),試驗(yàn)結(jié)果表明:系統(tǒng)可穩(wěn)定地運(yùn)行,能夠根據(jù)遠(yuǎn)程指令采集并傳輸不同分辨率的圖像,采集并傳輸1幅126 KB左右的圖像平均耗時(shí)為5.36 s,網(wǎng)絡(luò)平均丟包率為1.67%,客戶端開啟視頻監(jiān)控平均時(shí)延為3.48 s,視頻播放流暢。
無(wú)線圖像傳感器網(wǎng)絡(luò);分辨率調(diào)整算法;可視化管理軟件;遠(yuǎn)程監(jiān)測(cè)系統(tǒng)
農(nóng)田的圖像和視頻信息具有直觀、便捷、實(shí)時(shí)和信息量大的優(yōu)點(diǎn)[1-2]。農(nóng)田靜態(tài)圖像可被用來(lái)觀測(cè)農(nóng)作物的長(zhǎng)勢(shì)和分析農(nóng)作物各種深度狀態(tài)信息[3-5],農(nóng)田視頻監(jiān)控可用于在線統(tǒng)計(jì)農(nóng)田害蟲數(shù)量[6-7],也可用于農(nóng)田安全生產(chǎn)監(jiān)控[8]。無(wú)線圖像傳感器網(wǎng)絡(luò)(Wireless image sensor network,WISN)由一組微型圖像傳感器節(jié)點(diǎn)以自組網(wǎng)的形式構(gòu)成[9-10],能夠采集被監(jiān)測(cè)區(qū)域內(nèi)的圖像和視頻信息,并無(wú)線傳輸?shù)娇刂浦行摹?/p>
近年來(lái),國(guó)內(nèi)外學(xué)者研究了WISN在農(nóng)業(yè)監(jiān)測(cè)方面的應(yīng)用。PAEK等[11]開發(fā)和部署了2個(gè)基于圖像的環(huán)境監(jiān)測(cè)系統(tǒng),一個(gè)用于監(jiān)測(cè)生物學(xué)家統(tǒng)計(jì)蜥蜴和蟾蜍數(shù)量的陷阱,另一個(gè)監(jiān)測(cè)系統(tǒng)用來(lái)監(jiān)測(cè)鳥巢。THULASIPRIYA等[12]開發(fā)了一個(gè)基于無(wú)線圖像傳感器網(wǎng)絡(luò)的害蟲陷阱監(jiān)測(cè)系統(tǒng),用于采集陷阱圖像并進(jìn)行圖像分析,以統(tǒng)計(jì)果蠅數(shù)量。LLORET等[13]提出了一個(gè)帶有圖像處理系統(tǒng)的WISN用于葡萄狀態(tài)的監(jiān)測(cè)。姚仲敏等[14]設(shè)計(jì)了一個(gè)基于移動(dòng)無(wú)線傳感器網(wǎng)絡(luò)的農(nóng)田植株圖像監(jiān)測(cè)系統(tǒng),利用無(wú)人機(jī)搭載協(xié)調(diào)器收集節(jié)點(diǎn)采集的圖像數(shù)據(jù)。楊信廷等[15]設(shè)計(jì)了一種基于無(wú)線多媒體傳感器網(wǎng)絡(luò)的作物環(huán)境與長(zhǎng)勢(shì)遠(yuǎn)程監(jiān)測(cè)系統(tǒng)。
上述WISN監(jiān)測(cè)系統(tǒng)在應(yīng)用中存在以下不足:①圖像采集模塊大都是購(gòu)買市面上的成品攝像頭,價(jià)格較高。②圖像采集模塊的分辨率低,且固定不可調(diào),無(wú)法滿足用戶對(duì)不同圖像精度的需要。③構(gòu)建的采集網(wǎng)絡(luò)大都基于ZigBee協(xié)議,傳輸速率低、傳輸延遲大。④在服務(wù)器端沒有集成可視化信息管理軟件,不能實(shí)現(xiàn)更完善的節(jié)點(diǎn)管理、數(shù)據(jù)分析和應(yīng)用服務(wù)。
本文基于CMOS圖像傳感器自行研制低成本、高分辨率的圖像傳感器節(jié)點(diǎn),并以此構(gòu)建基于WiFi的WISN用于農(nóng)田的遠(yuǎn)程監(jiān)測(cè),并在服務(wù)器端開發(fā)可視化信息管理軟件,對(duì)節(jié)點(diǎn)和采集的數(shù)據(jù)進(jìn)行管理,并為用戶提供數(shù)據(jù)查詢、統(tǒng)計(jì)、分析等網(wǎng)絡(luò)服務(wù)功能。
1.1 監(jiān)測(cè)系統(tǒng)結(jié)構(gòu)
農(nóng)田遠(yuǎn)程監(jiān)測(cè)系統(tǒng)體系結(jié)構(gòu)如圖1所示。系統(tǒng)在邏輯上可分為3部分:①由部署在監(jiān)測(cè)區(qū)域內(nèi)的采集節(jié)點(diǎn)所構(gòu)成的采集子系統(tǒng),負(fù)責(zé)采集圖像和視頻數(shù)據(jù)。②由匯聚節(jié)點(diǎn)(Sink node)、網(wǎng)關(guān)節(jié)點(diǎn)(Gateway node)和4G網(wǎng)絡(luò)組成的傳輸子系統(tǒng),負(fù)責(zé)將數(shù)據(jù)傳送到服務(wù)器。③由服務(wù)器和備份服務(wù)器及運(yùn)行其上的可視化信息管理軟件組成應(yīng)用子系統(tǒng),負(fù)責(zé)接收、存儲(chǔ)、管理和分析數(shù)據(jù),并為用戶提供可視化網(wǎng)絡(luò)服務(wù)功能。
圖1 監(jiān)測(cè)系統(tǒng)體系結(jié)構(gòu)Fig.1 Architecture ofmonitoring system
部署在農(nóng)田的圖像傳感器節(jié)點(diǎn)周期性地采集農(nóng)作物和農(nóng)田環(huán)境圖像或視頻信息,并利用WiFi技術(shù)無(wú)線發(fā)送到匯聚節(jié)點(diǎn),再由匯聚節(jié)點(diǎn)轉(zhuǎn)發(fā)到網(wǎng)關(guān)節(jié)點(diǎn);網(wǎng)關(guān)節(jié)點(diǎn)將接收的數(shù)據(jù)從802.11局域網(wǎng)的數(shù)據(jù)幀格式轉(zhuǎn)換為4G的TDD-LTE數(shù)據(jù)幀格式,然后通過(guò)4G模塊發(fā)送到服務(wù)器;最后,服務(wù)器對(duì)數(shù)據(jù)進(jìn)行存儲(chǔ)、處理和分析。用戶可以利用智能手機(jī)或計(jì)算機(jī)通過(guò)Internet與監(jiān)測(cè)系統(tǒng)進(jìn)行交互,可以對(duì)數(shù)據(jù)進(jìn)行查詢、統(tǒng)計(jì)和分析,也可以根據(jù)應(yīng)用需要修改監(jiān)測(cè)參數(shù)等。
1.2 系統(tǒng)硬件設(shè)計(jì)
1.2.1 圖像傳感器節(jié)點(diǎn)結(jié)構(gòu)
圖像傳感器節(jié)點(diǎn)由圖像采集模塊、處理器模塊、無(wú)線通信模塊和供電模塊組成,如圖 2a所示。圖2b為節(jié)點(diǎn)的實(shí)物圖。
圖2 節(jié)點(diǎn)硬件結(jié)構(gòu)與實(shí)物Fig.2 Hardware structure and node picture
1.2.2 圖像采集模塊
一般來(lái)說(shuō)圖像采集模塊可通過(guò)兩種方式得到:購(gòu)買市面上的成品攝像頭;購(gòu)買圖像傳感器芯片,再定制一個(gè)小電路底板,并加裝合適的鏡頭構(gòu)成一個(gè)圖像采集模塊。兩種方式的優(yōu)劣比較如表1所示?;诔杀竞凸δ艿目紤],本文選擇了第2種方式,即自行開發(fā)圖像采集模塊,這樣保證了圖像傳感器芯片的可選擇性,更重要的是通過(guò)開發(fā)驅(qū)動(dòng)可實(shí)現(xiàn)圖像的高分辨率及分辨率的可調(diào)性。
表1 圖像采集模塊方案比較Tab.1 Comparison between two image acquisition module solutions
CMOS和CCD是目前圖像采集中使用最多的兩種圖像傳感器[16]。與CCD相比,CMOS圖像傳感器具有體積小、成本低、功耗小、易控制等特點(diǎn)[17],且隨著技術(shù)的進(jìn)步,其成像質(zhì)量已經(jīng)接近甚至超過(guò)CCD[18],因此,選用CMOS圖像傳感器芯片來(lái)設(shè)計(jì)圖像采集模塊。OV5642是美國(guó) OmniVision公司2010年推出的新一代CMOS彩色圖像傳感器芯片,支持多種分辨率,最高分辨率可達(dá)500萬(wàn)像素,支持5種圖像輸出格式,具有自動(dòng)曝光等多種圖像控制功能,核心電壓1.5 V,模擬電壓1.8 V/2.8 V,工作時(shí)電流140mA,待機(jī)時(shí)電流20μA[19]。OV5642與處理器模塊 S3C6410通過(guò) 20針的 CIF(Camera interface)接口相連,如圖3所示。
圖3 S3C6410與OV5642的連接Fig.3 Connection between S3C6410 and OV5642
1.2.3 處理器模塊
由于節(jié)點(diǎn)需要采集、壓縮和傳輸圖像/視頻數(shù)據(jù),執(zhí)行多任務(wù)調(diào)度,因此要求處理器有較高的性能。為此,選擇以S3C6410核心板+自行設(shè)計(jì)的外圍電路構(gòu)成處理器模塊。S3C6410是SAMSUNG公司基于ARM11內(nèi)核構(gòu)建的低功耗、高性能多媒體處理器[20],主頻高達(dá) 667 MHz,并帶有 256 MB SDRAM和1 GB NANDFLASH,工作電流為200mA。S3C6410集成了一個(gè)多格式編解碼器(Multi-format video coder,MFC),支持 H.264/MPEG4編碼和譯碼,以及VCI的解碼,極大地提高了多媒體的處理效率。
1.2.4 匯聚節(jié)點(diǎn)和網(wǎng)關(guān)節(jié)點(diǎn)設(shè)計(jì)
匯聚節(jié)點(diǎn)和網(wǎng)關(guān)節(jié)點(diǎn)是監(jiān)測(cè)系統(tǒng)的骨干節(jié)點(diǎn),是在采集節(jié)點(diǎn)的基礎(chǔ)上,通過(guò)軟硬件升級(jí)得到。硬件上主要增加存儲(chǔ)容量和蓄電池容量;匯聚節(jié)點(diǎn)增加一塊WiFi網(wǎng)卡,用于和網(wǎng)關(guān)通信;網(wǎng)關(guān)節(jié)點(diǎn)增加一塊4G模塊,用于和服務(wù)器通信。軟件上增加數(shù)據(jù)的轉(zhuǎn)發(fā)模塊,以實(shí)現(xiàn)數(shù)據(jù)格式的轉(zhuǎn)換和數(shù)據(jù)的快速轉(zhuǎn)發(fā)。
1.3 系統(tǒng)軟件設(shè)計(jì)
考慮到節(jié)點(diǎn)既要執(zhí)行圖像處理任務(wù),又要進(jìn)行系統(tǒng)控制、以及負(fù)責(zé)接口與網(wǎng)絡(luò)的管理,因此選擇功能強(qiáng)大的嵌入式Linux作為操作系統(tǒng),并在此基礎(chǔ)上開發(fā)和移植相關(guān)的驅(qū)動(dòng)、中間件,應(yīng)用層采用模塊化設(shè)計(jì),包含系統(tǒng)控制模塊、圖像采集與壓縮模塊、網(wǎng)絡(luò)通信模塊和數(shù)據(jù)存儲(chǔ)模塊。
1.3.1 節(jié)點(diǎn)工作流程
節(jié)點(diǎn)上電復(fù)位后,進(jìn)行一系列初始化,接著設(shè)置休眠時(shí)間,并打開定時(shí)器,然后進(jìn)入休眠狀態(tài),等待下一個(gè)工作周期的到來(lái)。休眠時(shí)間到,節(jié)點(diǎn)被喚醒,首先連接Sink節(jié)點(diǎn),加入WiFi網(wǎng)絡(luò),然后啟動(dòng)圖像傳感器開始采集、壓縮和傳輸圖像,完成采集任務(wù)后,節(jié)點(diǎn)再次進(jìn)入休眠狀態(tài),等待下一個(gè)工作周期的到來(lái),節(jié)點(diǎn)工作流程如圖4所示。
圖4 節(jié)點(diǎn)工作流程Fig.4 Workflow of node
1.3.2 分辨率實(shí)時(shí)調(diào)整算法
為滿足用戶對(duì)不同圖像精度的需求,設(shè)計(jì)了基于驅(qū)動(dòng)層和應(yīng)用層協(xié)作的分辨率實(shí)時(shí)調(diào)整算法。在驅(qū)動(dòng)層設(shè)計(jì)了 10種不同的分辨率,最高可達(dá)2 592像素×1 944像素,如表2所示。為實(shí)現(xiàn)分辨率的快速調(diào)整,為每一種分辨率設(shè)計(jì)一個(gè)對(duì)應(yīng)的寄存器配置表。寄存器配置表是一個(gè)N×3的二維數(shù)組,數(shù)組的行數(shù)N由待配置的寄存器數(shù)量決定;在每一行的3列數(shù)據(jù)中,前2列共同組成了待配置寄存器的16 bits地址,最后1列是待寫入的配置數(shù)據(jù)。利用I2C協(xié)議將寄存器配置表中的配置數(shù)據(jù)寫入相關(guān)寄存器即可實(shí)現(xiàn)對(duì)應(yīng)分辨率[20]。
表2 OV5642多級(jí)分辨率及寄存器配置表Tab.2 Multilevel resolution and correspondingregister configuration table of OV5642
驅(qū)動(dòng)層多分辨率的設(shè)計(jì)為應(yīng)用層根據(jù)用戶指令選擇不同分辨率奠定了基礎(chǔ)。當(dāng)用戶發(fā)送修改分辨率的指令時(shí),節(jié)點(diǎn)的應(yīng)用層接收指令,并解析指令,然后提取分辨率調(diào)整參數(shù)(分辨率索引),并將其傳遞到驅(qū)動(dòng)層,最后由驅(qū)動(dòng)層完成分辨率調(diào)整,分辨率調(diào)整流程如圖5所示。
圖5 分辨率調(diào)整流程圖Fig.5 Flow chart of resolution adjustment
1.3.3 圖像采集與傳輸
V4L2(Video for linux two)是Linux內(nèi)核中訪問(wèn)音、視頻設(shè)備的驅(qū)動(dòng)框架[21],為應(yīng)用層提供了一系列的API接口,通過(guò)調(diào)用這些接口可實(shí)現(xiàn)圖像采集。采集的靜態(tài)圖像壓縮成JPEG格式圖片保存在SD卡中,同時(shí)啟動(dòng)發(fā)送程序傳輸?shù)椒?wù)器端;采集的視頻進(jìn)行硬件壓縮并傳輸?shù)椒?wù)器。
1.3.4 服務(wù)器應(yīng)用軟件
服務(wù)器是WISN和監(jiān)測(cè)系統(tǒng)的應(yīng)用核心。為有效地接收、存儲(chǔ)、管理和分析節(jié)點(diǎn)采集的數(shù)據(jù),并為用戶提供網(wǎng)絡(luò)服務(wù),設(shè)計(jì)了基于B/S模式的可視化農(nóng)情信息綜合管理平臺(tái)(Agricultural information comprehensive management platform,AICMP)。AICMP由7個(gè)功能模塊組成,如圖6所示,既能管理筆者前期開發(fā)的稻田水分傳感器網(wǎng)絡(luò)[22-24],也能管理本文設(shè)計(jì)的無(wú)線圖像傳感器網(wǎng)絡(luò)。
AICMP提供可視化操作功能,圖7顯示了用戶登錄服務(wù)器主頁(yè)查看WISN網(wǎng)絡(luò)拓?fù)浣Y(jié)構(gòu)及查看節(jié)點(diǎn)采集圖像的情況,圖中列出了網(wǎng)關(guān)節(jié)點(diǎn)、匯聚節(jié)點(diǎn)和采集節(jié)點(diǎn)的位置、距離,并標(biāo)出了節(jié)點(diǎn)的編號(hào)。紅色矩形代表網(wǎng)關(guān),藍(lán)色三角形代表匯聚節(jié)點(diǎn),綠色圓圈代表采集節(jié)點(diǎn)。當(dāng)單擊圖中節(jié)點(diǎn)時(shí),會(huì)顯示節(jié)點(diǎn)采集的最新圖像及采集時(shí)間。
圖6 AICMP的功能模塊結(jié)構(gòu)Fig.6 Functional schematic diagram of AICMP
圖7 節(jié)點(diǎn)采集的最新圖像Fig.7 Display of image captured by node
2.1 節(jié)點(diǎn)部署與組網(wǎng)
為驗(yàn)證監(jiān)測(cè)系統(tǒng)的穩(wěn)定性,于2016年6月5日開始在廣東省農(nóng)業(yè)技術(shù)推廣總站(113.414 751°E、23.186 813°N)進(jìn)行節(jié)點(diǎn)部署與組網(wǎng),并開展60 d的綜合測(cè)試實(shí)驗(yàn)。實(shí)驗(yàn)部署的拓?fù)浣Y(jié)構(gòu)如圖8所示。
圖8 實(shí)驗(yàn)節(jié)點(diǎn)部署Fig.8 Deployment of nodes in experiment
2.2 多分辨率采集測(cè)試
多分辨率測(cè)試是為了驗(yàn)證節(jié)點(diǎn)能否按照系統(tǒng)設(shè)計(jì)的功能采集不同分辨率的圖像。測(cè)試方法為:從服務(wù)器發(fā)送指令,控制節(jié)點(diǎn)采集10種不同分辨率的圖像各100幅,并上傳到服務(wù)器,圖像壓縮質(zhì)量因子設(shè)置為80%,表3列出了10種分辨率圖像對(duì)應(yīng)的平均大小,從中可以看出,隨著分辨率的提高,采集圖像的原始數(shù)據(jù)越來(lái)越大,壓縮后的圖像文件也越來(lái)越大,JPEG的平均壓縮比約為8.6∶1。
表3 不同分辨率圖像的平均大小Tab.3 Average size of imagesw ith different resolutions
為了體現(xiàn)不同分辨率圖像清晰度的差異,選取5種分辨率圖像進(jìn)行對(duì)比分析,分辨率從左至右分別是640像素×480像素、1 600像素×1 200像素、1 280像素×1 024像素、2 048像素×1 536像素和2 592像素×1 944像素,如圖9所示。從直觀上看,圖9a中同一目標(biāo)的不同分辨率圖像沒有太大差異,肉眼無(wú)法直接區(qū)分它們的清晰度。為此,對(duì)圖像進(jìn)行放大以展現(xiàn)其細(xì)節(jié)的差異。為了便于比較和區(qū)分,采集圖像時(shí)放入水瓶蓋,并對(duì)采集后的圖像進(jìn)行等比例放大,然后截取含水瓶蓋的部分進(jìn)行對(duì)比分析,如圖9b所示,從中可以清晰地看到,隨著圖像分辨率的提高,圖像中水瓶蓋圖案越來(lái)越清晰,這表明分辨率高的圖像具有更高的清晰度,也證明了本文設(shè)計(jì)的多分辨率方案是有效的。
圖9 節(jié)點(diǎn)采集的不同分辨率圖像對(duì)比Fig.9 Comparison between images captured by node with different resolutions
2.3 系統(tǒng)丟包率測(cè)試
表4列出了監(jiān)測(cè)系統(tǒng)的14個(gè)節(jié)點(diǎn)(包括匯聚節(jié)點(diǎn))采集并傳輸不同分辨率圖像時(shí)的丟包率統(tǒng)計(jì)情況,數(shù)據(jù)是統(tǒng)計(jì)100次的結(jié)果。
表4 不同分辨率圖像的傳輸丟包率Tab.4 Packet loss ratio of imagesw ith different resolutions %
丟包率為
式中 Nsent——節(jié)點(diǎn)發(fā)送的數(shù)據(jù)包個(gè)數(shù)
測(cè)試時(shí),節(jié)點(diǎn)將發(fā)送1幅圖像產(chǎn)生的數(shù)據(jù)包個(gè)數(shù)Nsent記錄下來(lái),待發(fā)送完圖像后,將Nsent發(fā)送到服務(wù)器;服務(wù)器接收?qǐng)D像時(shí),記錄接收到的數(shù)據(jù)包個(gè)數(shù)Nreceived,然后根據(jù)式(1)計(jì)算丟包率。從表4可以看出,所有節(jié)點(diǎn)平均丟包率為1.67%,表明網(wǎng)絡(luò)傳輸穩(wěn)定可靠,遠(yuǎn)程監(jiān)測(cè)系統(tǒng)能夠滿足實(shí)際應(yīng)用需求。
2.4 系統(tǒng)耗時(shí)測(cè)試
耗時(shí)測(cè)試的目的是檢驗(yàn)網(wǎng)絡(luò)中的節(jié)點(diǎn)采集和傳輸1幅圖像到服務(wù)器所消耗的時(shí)間,它反映了監(jiān)測(cè)系統(tǒng)的實(shí)時(shí)性。表5展示了14個(gè)采集節(jié)點(diǎn)執(zhí)行100次采集任務(wù)的平均耗時(shí)情況,所采集的圖像分辨率為640像素×480像素。從表5可看出,14個(gè)采集節(jié)點(diǎn)的平均耗時(shí)為5.36 s,也就是說(shuō),在發(fā)出采集指令5.36 s后,服務(wù)器可以收到節(jié)點(diǎn)上傳的圖像,表明系統(tǒng)具有很好的實(shí)時(shí)性,能夠滿足農(nóng)田環(huán)境和農(nóng)作物實(shí)時(shí)監(jiān)測(cè)的需要。同時(shí)發(fā)現(xiàn),4個(gè)匯聚節(jié)點(diǎn)平均耗時(shí)約為4.92 s,小于其他節(jié)點(diǎn)的5.54 s,因?yàn)樗鼈儾杉膱D像可以直接上傳到網(wǎng)關(guān),少了一次WiFi傳輸和轉(zhuǎn)發(fā)。
表5 節(jié)點(diǎn)的時(shí)延Tab.5 Delay of node
2.5 視頻監(jiān)控測(cè)試
圖10展示了客戶端通過(guò)HTTP協(xié)議登錄服務(wù)器開啟4個(gè)節(jié)點(diǎn)視頻監(jiān)控的情況。視頻采集的分辨率為640像素×480像素,幀率為25 f/s。H.264碼流的壓縮比約為106∶1,4個(gè)節(jié)點(diǎn)視頻監(jiān)控開啟后,網(wǎng)絡(luò)的視頻碼率平均為3.32 Mb/s。從發(fā)出開啟視頻指令,到視頻開始在客戶端網(wǎng)頁(yè)播放,平均時(shí)延約為3.48 s。從測(cè)試情況來(lái)看,監(jiān)控視頻畫面流暢,無(wú)卡頓情況,能夠滿足農(nóng)田視頻監(jiān)控的需要。
圖10 節(jié)點(diǎn)視頻監(jiān)控Fig.10 Videomonitoring of node
(1)設(shè)計(jì)了一種低成本、高分辨率的無(wú)線圖像傳感器節(jié)點(diǎn)和基于應(yīng)用層與驅(qū)動(dòng)層協(xié)作、多線程并發(fā)的分辨率實(shí)時(shí)調(diào)整算法,使節(jié)點(diǎn)具有10種不同的分辨率,最高可達(dá)500萬(wàn)像素,且分辨率可根據(jù)用戶需求實(shí)現(xiàn)遠(yuǎn)程、實(shí)時(shí)調(diào)整。
(2)基于所設(shè)計(jì)的節(jié)點(diǎn),提出了基于WiFi+4G的農(nóng)田實(shí)時(shí)監(jiān)測(cè)系統(tǒng)和基于Web的可視化農(nóng)田信息管理軟件,實(shí)現(xiàn)了農(nóng)田圖像和視頻信息的自動(dòng)采集、遠(yuǎn)程傳輸、有效存儲(chǔ)和高效網(wǎng)絡(luò)應(yīng)用。
(3)對(duì)監(jiān)測(cè)系統(tǒng)進(jìn)行了綜合測(cè)試試驗(yàn),試驗(yàn)結(jié)果表明系統(tǒng)能穩(wěn)定運(yùn)行,節(jié)點(diǎn)能夠自動(dòng)采集、壓縮并傳輸10種不同分辨率的圖像,采集并傳輸1幅大小為126 KB左右的圖像消耗的時(shí)間約為5.36 s,網(wǎng)絡(luò)平均丟包率為1.67%;視頻監(jiān)控播放流暢,無(wú)卡頓情況,播放時(shí)延約為3.48 s。
1 熊迎軍,沈明霞,孫玉文,等.農(nóng)田圖像采集與無(wú)線傳輸系統(tǒng)[J].農(nóng)業(yè)機(jī)械學(xué)報(bào),2011,42(3):184-187.XIONG Yingjun,SHENMingxia,SUN Yuwen,etal.Design on system of acquisition and wireless transmission for farmland image[J].Transactions of the Chinese Society for Agricultural Machinery,2011,42(3):184-187.(in Chinese)
2 ZHAO LQ,YIN SY,LIU L B,et al.A crop monitoring system based on wireless sensor network[J].Procedia Environmental Sciences,2011,11(Part B):558-565.
3 SRITARAPIPAT T,RAKWATIN P,KASETKASEM T.Automatic rice crop heightmeasurement using a field server and digital image processing[J].Sensors,2014,14(1):900-926.
4 MORA M,AVILA F,CARRASCO-BEMAVODES M,et al.Automated computation of leaf area index from fruit trees using improved image processing algorithms applied to canopy cover digital photograpies[J].Computers&Electronics in Agriculture,2016,123:195-202.
5 賈洪雷,王剛,郭明卓,等.基于機(jī)器視覺的玉米植株數(shù)量獲取方法與試驗(yàn)[J].農(nóng)業(yè)工程學(xué)報(bào),2015,31(3):215-220.JIA Honglei,WANG Gang,GUOMingzhuo,et al.Methods and experiments of obtaining corn population based onmachine vision[J].Transactions of the CSAE,2015,31(3):215-220.(in Chinese)
6 BECHAR I,MOISAN S,THONNAT M,et al.On-line video recognition and counting of harmful insects[C]∥2010 20th International Conference on Pattern Recognition(ICPR),2010:4068-4071.
7 肖德琴,傅俊謙,鄧曉暉,等.基于物聯(lián)網(wǎng)的桔小實(shí)蠅誘捕監(jiān)測(cè)裝備設(shè)計(jì)及試驗(yàn)[J].農(nóng)業(yè)工程學(xué)報(bào),2015,31(7):166-172.XIAO Deqin,F(xiàn)U Junqian,DENG Xiaohui,et al.Design and test of remotemonitoring equipment for bactrocera dorsalis trapping based on internet of things[J].Transactions of the CSAE,2015,31(7):166-172.(in Chinese)
8 GARCIA-SANCHEZ A,GARCIA-SANCHEZ F,GARCIA-HARO J.Wireless sensor network deployment for integrating video-surveillance and data-monitoring in precision agriculture over distributed crops[J].Computers and Electronics in Agriculture,2011,75(2):288-303.
9 PHAM C,LECUIRE V.Building low-costwireless image sensor networks:from single camera tomulti-camera system[C]∥ACM International Conference on Distributed Smart Cameras,2015:158-163.
10 GONZALEZ M,SCHANDY J,WAINSTEIN N,et al.Wireless image-sensor network application for population monitoring of lepidopterous insects pest(moths)in fruit crops[C]∥2014 IEEE International Instrumentation and Measurement Technology Conference,2014:1394-1398.
11 PAEK J,HICLS J,COE S,et al.Image-based environmentalmonitoring sensor application using an embedded wireless sensor network[J].Sensors,2014,14(9):15981-16002.
12 THULASIPRIYA C,PRAVEEN K,SRIVIDYA A.Monitoring of pest insect traps using image sensors&dspic[J].International Journal of Engineering Trends and Technology,2013,4:4088-4093.
13 LLORET,BOSCH I,SENDRA S,et al.A wireless sensor network for vineyard monitoring that uses image processing[J].Sensors,2011,11(12):6165-6196.
14 姚仲敏,荊寶剛,孫彩蘋.基于移動(dòng)無(wú)線傳感器網(wǎng)絡(luò)的植株圖像監(jiān)測(cè)系統(tǒng)設(shè)計(jì)與測(cè)試[J].農(nóng)業(yè)工程學(xué)報(bào),2016,32(11):189-196.YAO Zhongmin,JING Baogang,SUN Caiping.Design and test of plant imagemonitoring system based onmobile wireless sensor network[J].Transactions of the CSAE,2016,32(11):189-196.(in Chinese)
15 楊信廷,吳滔,孫傳恒,等.基于WMSN的作物環(huán)境與長(zhǎng)勢(shì)遠(yuǎn)程監(jiān)測(cè)系統(tǒng)[J/OL].農(nóng)業(yè)機(jī)械學(xué)報(bào),2013,44(1):167-173.http:∥www.j-csam.org/jcsam/ch/reader/view_abstract.a(chǎn)spx?flag=1&file_no=20130132&journal_id=jcsam.DOI: 10.6041/j.issn.1000-1298.2013.01.032.YANG Xinting,WU Tao,SUN Chuanheng,et al.Remotemonitoring system of crop environment and growing based on WMSN[J/OL].Transactions of the Chinese Society for Agricultural Machinery,2013,44(1):167-173.(in Chinese)
16 FOSSUM E R,HONDONGWA D B.A review of the pinned photodiode for CCD and CMOS image sensors[J].IEEE Journal of the Electron Devices Society,2014,2(3):33-43.
17 晉孝峰,岳素格,劉麗艷,等.CMOS圖像傳感器的硬復(fù)位電路研究[J].電子學(xué)報(bào),2014,42(1):182-186.JIN Xiaofeng,YUE Suge,LIU Liyan,et al.Research on CMOS image sensor hard reset circuit[J].Acta Electronica Sinica,2014,42(1):182-186.(in Chinese)
18 劉杰,朱天成.基于CMOS工藝的無(wú)線圖像傳感器網(wǎng)絡(luò)綜述[J].微計(jì)算機(jī)信息,2012(2):133-135.LIU Jie,ZHU Tiancheng.Wireless image sensor network based on CMOS technology[J].Microcomputer Information,2012(2): 133-135.(in Chinese)
19 OMNIVISION INC.OV5642 datasheet[EB/OL].(2009-08-18)[2016-11-01].http:∥www.docin.com/p-186847439.htm l.
20 楊闊,何東?。赟3C6410的田間視頻監(jiān)控系統(tǒng)的實(shí)現(xiàn)[J].計(jì)算機(jī)工程與設(shè)計(jì),2013,34(6):1978-1982.YANG Kuo,HE Dongjian.Implementation of field video monitoring system based on S3C6410[J].Computer Engineering and Design,2013,34(6):1978-1982.(in Chinese)
21 殷建軍,肖德琴,黃順彬.CMOS圖像傳感器多分辨率驅(qū)動(dòng)算法設(shè)計(jì)[J].計(jì)算機(jī)工程與設(shè)計(jì),2014,35(9):3045-3049.YIN Jianjun,XIAO Deqin,HUANG Shunbin.Design of CMOS image sensor multi-resolution driver algorithm[J].Computer Engineering and Design,2014,35(9):3045-3049.(in Chinese)
22 肖德琴.稻田水分傳感器網(wǎng)絡(luò)構(gòu)建[D].廣州:華南農(nóng)業(yè)大學(xué),2009.XIAO Deqin.Study on paddy field moisture sensor network[D].Guangzhou:South China Agricultural University,2009.(in Chinese)
23 肖德琴,古志春,馮健昭,等.稻田水分監(jiān)測(cè)無(wú)線傳感器網(wǎng)絡(luò)優(yōu)化設(shè)計(jì)與試驗(yàn)[J].農(nóng)業(yè)工程學(xué)報(bào),2011,27(2):174-179.XIAO Deqin,GU Zhichun,F(xiàn)ENG Jianzhao,et al.Design and experiment of wireless sensor networks for paddy field moisture monitoring[J].Transactions of the CSAE,2011,27(2):174-179.(in Chinese)
24 XIAO D,F(xiàn)ENG J,WANG N,et al.Integrated soil moisture and water depth sensor for paddy fields[J].Computers and Electronics in Agriculture,2013,98:214-221.
Remote Monitoring System for Farm land Based on Wireless Image Sensor Network
YIN Jianjun PAN Chunhua XIAO Kehui YE Yaowen LIU Xiaoping XIAO Deqin
(College of Mathematics and Informatics,South China Agricultural University,Guangzhou 510642,China)
A remote monitoring system for farmland based on wireless image sensor network was put forward in order to obtain the farmland image and video information in real time.Aiming at the shortcomings of the current image sensor nodes,a low-costhigh-resolution wireless image sensor nodewas designed based on CMOS image sensor chip and S3C6410 embedded processor.To ensure the stability and reliability of the node,the powerful embedded Linux operating system was employed as the software development platform.And based on this platform,amodular designingmethod was adopted to program the software system of the node in C/C++language.Especially,a resolution adjustment algorithm based on driver and application layer cooperation was studied,which made the node had 10 different resolutions and the highest resolution was up to 5 mega pixels.More importantly,the resolution can be adjusted in real time according to the requirements of users when it was working,which made the node can meet the needs of users for different image accuracies.A wireless image sensor network was constructed by utilizing WiFi technology as well as the images and videos captured by the nodes were remotely transmitted to the server through the 4G network.In order to prolong the life cycle of the node,a solar power supply system was designed.A visual farmland information management software Webbased was developed in order to effectively store,manage and use the data captured by the nodes,and a convenientmethod was provided for a user to remotely access the acquisition networks and the data stored in the server.The system was deployed and tested for a long time.The test results showed that the system could work stably,as well as capture and transmit images with different resolutions according to the remote instruction.Moreover,the average time to capture and transmit one image with size of about 126 KB was about 5.36 s,and the average packet loss ratio of the network was about 1.67%.In thetests,the average delay for the client to open videomonitoring was about 3.48 s,and the video playing was smooth.Finally,the power supply system based on the solar energy could provide a stable power supply for the nodes in the long work.The tests validated that the remotemonitoring system designed in thiswork can automatically capture images and videos of farmland in real time,transmit them to the server remotely,and satisfy the requirement of users for remotemonitoring farm land.
wireless image sensor network;resolution adjustment algorithm;visual management software;remotemonitoring system
——服務(wù)器接收到的數(shù)據(jù)包個(gè)數(shù)
S24;TP274
A
1000-1298(2017)07-0286-08
2016-10-26
2016-12-05
國(guó)家星火計(jì)劃項(xiàng)目(2014GA780064、2015GA780002)和廣東省科技計(jì)劃項(xiàng)目(2015A020224033、2015A020209129)
殷建軍(1981—),男,講師,博士,主要從事無(wú)線傳感器網(wǎng)絡(luò)在農(nóng)業(yè)上的應(yīng)用研究,E-mail:jianjunyin@scau.edu.cn
肖德琴(1970—),女,教授,博士生導(dǎo)師,主要從事無(wú)線傳感器網(wǎng)絡(luò)在農(nóng)業(yè)上的應(yīng)用研究,E-mail:deqinx@scau.edu.cn
10.6041/j.issn.1000-1298.2017.07.036