姜國(guó)權(quán),楊小亞,王志衡,劉紅敏
(河南理工大學(xué)計(jì)算機(jī)科學(xué)與技術(shù)學(xué)院,焦作 454000)
基于圖像特征點(diǎn)粒子群聚類算法的麥田作物行檢測(cè)
姜國(guó)權(quán),楊小亞,王志衡※,劉紅敏
(河南理工大學(xué)計(jì)算機(jī)科學(xué)與技術(shù)學(xué)院,焦作 454000)
為了快速準(zhǔn)確地提取麥田作物行中心線,提出了基于圖像特征點(diǎn)粒子群聚類算法的麥田作物行檢測(cè)。首先,對(duì)自然光照下獲取的彩色圖像運(yùn)用“過(guò)綠顏色因子圖像灰度化”、“Otsu圖像二值化”、“左右邊緣中間線檢測(cè)提取作物行特征點(diǎn)算法”3步對(duì)圖像進(jìn)行預(yù)處理。然后,根據(jù)農(nóng)田作物行中心線周圍區(qū)域的特征點(diǎn)到該直線的距離均小于某一距離閾值的特征,運(yùn)用粒子群優(yōu)化算法對(duì)每一作物行的特征點(diǎn)分別進(jìn)行聚類。最后,對(duì)每一類的特征點(diǎn)用最小二乘法進(jìn)行直線擬合獲取麥田作物行中心線。試驗(yàn)結(jié)果表明,該算法可以對(duì)作物斷行、雜草、土塊等復(fù)雜農(nóng)田環(huán)境下的圖像進(jìn)行有效地作物行檢測(cè),識(shí)別率達(dá)95%,識(shí)別誤差小于3°。與標(biāo)準(zhǔn)Hough算法相比,運(yùn)行速率提升了一倍。該文可為實(shí)現(xiàn)農(nóng)業(yè)機(jī)器人田間作業(yè)提供參考。
圖像處理;算法;聚類;作物行檢測(cè);粒子群優(yōu)化;最小二乘法
作為精準(zhǔn)農(nóng)業(yè)的一個(gè)重要組成部分,農(nóng)業(yè)機(jī)器人視覺(jué)導(dǎo)航技術(shù)越來(lái)越備受關(guān)注[1-5],并已廣泛應(yīng)用于農(nóng)作物種植、施肥、中耕除草等[6-8]方面。檢測(cè)作物行中心線是進(jìn)行視覺(jué)導(dǎo)航的基礎(chǔ),國(guó)內(nèi)外專家針對(duì)作物行識(shí)別在甜菜[9]、棉花[10]、谷類[11-12]以及玉米[13]等作物中的應(yīng)用做了大量研究。目前常用的作物行檢測(cè)算法有Hough變換法(Hough transform, HT)[14-17]和最小二乘法。Hough算法受噪聲影響小,魯棒性強(qiáng),缺點(diǎn)是往往存在峰值檢測(cè)難,計(jì)算量大等問(wèn)題。近年來(lái),不斷有學(xué)者提出改進(jìn)的Hough變換:Jiang等[18]提出了Hough變換與消隱點(diǎn)約束相結(jié)合的算法,首先將過(guò)綠2G-R-B與Otsu閾值分割法相結(jié)合對(duì)圖像進(jìn)行預(yù)處理,然后,運(yùn)用移動(dòng)窗口的方法來(lái)提取代表作物行的特征點(diǎn)并利用Hough算法檢測(cè)出大于實(shí)際作物行數(shù)的候選直線,最后基于消隱點(diǎn)的方法得到真正的作物行。該方法有效地解決了Hough變換峰值檢測(cè)的問(wèn)題,識(shí)別率達(dá)到90%以上,然而,在算法實(shí)時(shí)性上仍然沒(méi)有較大的改進(jìn)。為了減少計(jì)算量,Xu等[19]提出隨機(jī)Hough變換,采用多到一的映射方法,減少計(jì)算量,運(yùn)用動(dòng)態(tài)鏈表,降低內(nèi)存。該改進(jìn)算法雖能一定程度上減少內(nèi)存,提高運(yùn)行速度[20],但對(duì)于高密度的雜草圖像,作物行檢測(cè)精度不高。除了標(biāo)準(zhǔn)Hough及其相應(yīng)的改進(jìn)算法,最小二乘法也被廣泛用于作物行中心線的提取中。Montalvo等[21]將最小二乘法運(yùn)用在高密度雜草的作物行中心線提取中。司永勝等[22]提出基于最小二乘法的早期作物行中心線檢測(cè)算法,利用特征點(diǎn)的鄰近關(guān)系對(duì)目標(biāo)點(diǎn)分類,對(duì)點(diǎn)集里的特征點(diǎn)用最小二乘法進(jìn)行直線擬合,然而在歸類過(guò)程中,當(dāng)前點(diǎn)的選擇對(duì)分類以及直線的擬合效果有很大影響,容易受到噪聲點(diǎn)干擾。針對(duì)最小二乘法對(duì)噪聲敏感等問(wèn)題,Jiang等[23]提出了一個(gè)新的算法:在基于作物行間距相等的基礎(chǔ)上,運(yùn)用多窗口移動(dòng)的方法,將特征點(diǎn)進(jìn)行聚類獲得代表作物行的像素點(diǎn),該算法可以保證在高雜草的作物圖像中也能成功提取特征點(diǎn)。但運(yùn)用該方法的前提是作物行必須滿足等間距的約束條件。在實(shí)際農(nóng)田環(huán)境中,有些作物行間距是不等的,此時(shí),該方法不能很好地工作。
粒子群算法(particle swarm optimization,PSO)是解決函數(shù)優(yōu)化問(wèn)題的有效工具,該算法具有并行處理,計(jì)算效率快,魯棒性強(qiáng)等優(yōu)點(diǎn),常用于車道線檢測(cè)[24]。孟慶寬等[25]將粒子群優(yōu)化思想運(yùn)用到導(dǎo)航線提取中,運(yùn)用垂直投影法獲取作物行左右邊界,將圖像底邊的一個(gè)像素點(diǎn)與圖像頂邊的一個(gè)像素點(diǎn)組成的直線看成一個(gè)粒子,根據(jù)一定距離范圍內(nèi)目標(biāo)點(diǎn)的個(gè)數(shù)建立適應(yīng)度函數(shù),運(yùn)用粒子群優(yōu)化算法進(jìn)行尋優(yōu),找到最優(yōu)直線。算法運(yùn)行速度較快,但算法不能適應(yīng)雜草較多的農(nóng)田環(huán)境。基于此,本文提出了基于圖像特征點(diǎn)粒子群聚類算法的麥田作物行檢測(cè)。
1.1 圖像獲取
本文試驗(yàn)所用圖像均拍攝于中國(guó)焦作市東于村和中國(guó)農(nóng)科院研究生院試驗(yàn)田。在圖像采集過(guò)程中,使用Samsung S750彩色相機(jī)進(jìn)行拍攝,相機(jī)距離地面高度為1.1 m,相機(jī)光軸與水平線夾角為30°,圖像為480×640像素的彩色圖像。試驗(yàn)所用計(jì)算機(jī)配置為CPU主頻2.60 GHz,內(nèi)存為1.88 GB。圖像處理所用的軟件為Matlab R2009a。
1.2 圖像預(yù)處理
為了將作物信息從土壤背景中分離出來(lái),試驗(yàn)采用Tang等[26]提出的超綠色法(excess green)即2G-R-B特征因子對(duì)圖1a進(jìn)行灰度化處理,并采用Otsu[27]在1975年提出的Otsu算法對(duì)圖1b進(jìn)行二值化[28]處理。圖1a選取的是一幅大小為480×640像素的小麥作物圖像?;叶然岸祷Y(jié)果分別如圖1b、圖1c。
為了減少圖像處理后期工作量,從二值圖像圖1c的作物行中提取部分特征點(diǎn)來(lái)表示作物行。試驗(yàn)采用左右邊緣中間線檢測(cè)算法[29-30]。結(jié)果如圖1d。
圖1 圖像預(yù)處理Fig.1 Image preprocessing
1.3 基于粒子群的特征點(diǎn)聚類
1.3.1 粒子群優(yōu)化算法原理
粒子群優(yōu)化算法最早由Kennedy和Eberhart提出,該算法通過(guò)模仿鳥(niǎo)搜索食物的行為來(lái)解決優(yōu)化問(wèn)題。粒子群算法中,每個(gè)粒子可以看成優(yōu)化問(wèn)題的一個(gè)可行解,所有粒子都有一個(gè)被優(yōu)化的目標(biāo)函數(shù)決定的適應(yīng)值,并有一個(gè)速度值決定它們飛翔的方向和距離,粒子通過(guò)跟蹤2個(gè)極值即“個(gè)體極值”和“全局極值”來(lái)更新自己在解空間中的位置與速度。具體原理如下:
假設(shè)在D維的搜索空間,這里待優(yōu)化問(wèn)題的變量數(shù)決定了解空間的維數(shù)D。第i個(gè)粒子的位置可表示為xi=(xi1,xi2,…,xiD),第i個(gè)粒子經(jīng)歷過(guò)的最好位置(即個(gè)體極值)記為pi=(pi1,pi2,…,piD),每個(gè)粒子飛行速度為vi=(vi1,vi2,…,viD),所有粒子經(jīng)歷的最好位置為pg=(xg1,xg2,…,xgD),粒子根據(jù)以下公式更新自己的速度與位置:
式中xid(t)為第t次迭代粒子i位置矢量的第d維分量;vid(t)為第t次迭代粒子i速度矢量的第d維分量;c1、c2為加速度系數(shù);w為慣性權(quán)重;r1、r2為0~1之間的隨機(jī)數(shù)。
1.3.2 基于PSO的特征點(diǎn)聚類
目標(biāo)圖像經(jīng)本文章節(jié)1.2中的算法預(yù)處理后,可以獲得代表作物行的候選特征點(diǎn)圖像即圖1d。如何對(duì)其準(zhǔn)確聚類(使代表每一作物行的特征點(diǎn)聚為相應(yīng)的類)、確定真正代表作物行走向的特征點(diǎn)是下一步用最小二乘法檢測(cè)直線的關(guān)鍵所在。
根據(jù)作物的特點(diǎn)可知,作物行中心線周圍區(qū)域的特征點(diǎn)到該直線的距離dt均小于某一距離閾值(以下稱距離約束條件)。這里假設(shè)V表示特征點(diǎn)構(gòu)成的數(shù)據(jù)空間,ykxb=+表示離散在數(shù)據(jù)空間的直線,計(jì)算V中所有特征點(diǎn)到所有這些直線的距離,哪條直線周圍區(qū)域滿足距離約束條件的特征點(diǎn)最多,就將這些特征點(diǎn)聚為一類。
算法具體步驟如下:
1)從上到下,從左到右掃描特征點(diǎn)圖像(圖1d),找到所有像素值為1的特征點(diǎn)(xi, yi),假設(shè)數(shù)據(jù)空間V中有n個(gè)特征點(diǎn),則,i=1,2,3,…,n。
2)初始化粒子群。包括粒子群體規(guī)模m,空間維數(shù)D,迭代次數(shù)T,加速度系數(shù)c1與c2,慣性權(quán)重w。
3)在數(shù)據(jù)空間V中設(shè)置2個(gè)變量k,b。k的取值范圍為kmin到kmax,b的取值范圍為bmin到bmax。任意組合dbound構(gòu)成的直線y=kiix+bjj可以看成一個(gè)粒子,其中kii∈[kmin,kmax],bjj∈[bmin,bmax],由此可知D=2。初始位置和速度在粒子各個(gè)變量的取值范圍內(nèi)由系統(tǒng)隨機(jī)生成。初始化距離閾值dbound(dbound取值為麥田寬度的一半),同時(shí)設(shè)置一個(gè)初始值為0的累加器變量SUM。
4)根據(jù)目標(biāo)適應(yīng)度函數(shù)計(jì)算每個(gè)粒子的適應(yīng)值。設(shè)定適應(yīng)度函數(shù)為f=Q,Q表示V中的特征點(diǎn)(xi, yi),(i=1,2,…,n)到直線方程y=kiix+bjj的距離dt
小于距離閾值dbound的點(diǎn)的個(gè)數(shù)SUM。Q越大,函數(shù)適應(yīng)度越好。由此找到個(gè)體極值pi和全局極值pg,根據(jù)公式(1)和公式(2)對(duì)每個(gè)粒子的速度與位置進(jìn)行更新。如果距離dt小于dbound,則SUM=max(SUMii)。這里SUMii表示任一組合(kii,bjj)滿足距離約束條件的特征點(diǎn)的個(gè)數(shù)。
5)當(dāng)達(dá)到最大迭代次數(shù)T,算法結(jié)束,輸出滿足距離約束條件的所有特征點(diǎn)。第一類聚類完畢。
6)刪除步驟5)中的特征點(diǎn),更新V中特征點(diǎn)的數(shù)量。循環(huán)運(yùn)行步驟4)和5),循環(huán)次數(shù)由要檢測(cè)的作物行數(shù)決定。
圖2a把特征點(diǎn)分為5類,剔除不滿足距離約束條件的點(diǎn),留下能代表目標(biāo)作物行中心線的特征點(diǎn)。不同顏色代表不同類的特征點(diǎn)聚類結(jié)果。
1.4 基于最小二乘法的線性擬合
最小二乘法是一種常用的直線檢測(cè)算法,它的優(yōu)點(diǎn)是精度高,檢測(cè)速度快。但實(shí)際應(yīng)用中由于農(nóng)作物圖像一般是多行、雜草較多等原因,并不能直接應(yīng)用最小二乘法進(jìn)行直線擬合。對(duì)于以上問(wèn)題,本文采用如下方法解決:1)利用第1.3.2節(jié)算法得到點(diǎn)集;2)使用最小二乘法對(duì)聚類后每一類點(diǎn)集里的特征點(diǎn)進(jìn)行線性擬合。直線擬合結(jié)果如圖2b。
圖2 特征點(diǎn)聚類和作物行檢測(cè)結(jié)果圖像Fig.2 Images of feature points clustering and crop rows detection
針對(duì)小麥不同光照,不同的生長(zhǎng)時(shí)期中枯草、斷行和雜草等復(fù)雜的情況,提取350幅圖像進(jìn)行作物行檢測(cè)測(cè)試,其中處于越冬期的小麥作物圖像197幅,處于返青期的小麥作物圖像153幅。
試驗(yàn)結(jié)果表明,對(duì)于本文提出的算法,333幅小麥圖像可以被成功檢測(cè)出所有作物行,識(shí)別率達(dá)95%。相比之下,標(biāo)準(zhǔn)Hough和文獻(xiàn)[25]的算法識(shí)別率分別為80%和75%。3種算法對(duì)不同生長(zhǎng)時(shí)期的小麥成功檢測(cè)出所有作物行的圖像數(shù)量見(jiàn)表1。
表1 3種作物行直線檢測(cè)算法性能對(duì)比Table 1 Performance comparison between three algorithms of crop row detection
為了進(jìn)一步檢測(cè)本文算法的性能,將該算法與標(biāo)準(zhǔn)Hough算法和文獻(xiàn)[25]提出的算法共3種算法在運(yùn)行速度和識(shí)別誤差上進(jìn)行了對(duì)比。運(yùn)行一幅480×640像素的彩色圖像,標(biāo)準(zhǔn)Hough、文獻(xiàn)[25]中的算法和本文算法平均耗時(shí)分別為0.987 4、0.685 9和0.423 7 s,本文算法耗時(shí)明顯較少,相比較于標(biāo)準(zhǔn)Hough,運(yùn)行速率提升一倍。對(duì)于3種算法的檢測(cè)誤差比較,本文采用Jiang等[23]提出的誤差計(jì)算方法。通過(guò)5人手工繪制作物行的直線并取其平均值作為作物行的參考直線,在繪制作物行直線時(shí)盡量使其能代表作物行的中心線,然后計(jì)算參考直線與實(shí)際檢測(cè)直線的夾角,這里的夾角是圖像中檢測(cè)的所有作物行與其對(duì)應(yīng)的參考直線夾角的平均值,夾角越大,識(shí)別誤差越大。經(jīng)試驗(yàn),對(duì)于提取的350幅圖像,標(biāo)準(zhǔn)Hough、文獻(xiàn)[25]中的算法和本文算法的平均誤差分別為2.538 0°、3.105 7°和0.936 5°,標(biāo)準(zhǔn)差分別為1.834 7°、2.499 7°和0.351 6°,如表1所示。試驗(yàn)中,本文算法和文獻(xiàn)[25]的算法,m=100,空間維數(shù)D=2,迭代次數(shù)T=50,加速度系數(shù)c1=c2=1.494 45,慣性權(quán)重w=1,Hough算法中極坐標(biāo)下極角θ的取值范圍為:θ∈[?90°, 90°]。由此可知,本文算法不僅耗時(shí)較少,而且具有較低的識(shí)別誤差。
圖3a選取了3幅處于不同自然條件下的小麥作物圖像。從左到右依次是:小麥處于越冬期并存在作物斷行情況的彩色圖像;小麥處于返青期并有枯草的彩色圖像;小麥處于返青期并含高密度雜草的彩色圖像;分別拍攝于2014年11月9日,陰天;2015年2月3日,晴天;2015年3月10日,陰天。
圖3 Hough算法的作物行檢測(cè)結(jié)果與參考直線的對(duì)比Fig.3 Comparison between reference lines and detection lines based on Hough
圖3b為經(jīng)過(guò)1.2節(jié)中的算法進(jìn)行預(yù)處理后的候選特征點(diǎn)圖像。從圖像中,可以看出,2G-R-B超綠色法以及Otsu算法對(duì)圖像有較好的分割效果,其分割結(jié)果受光照影響小,可以濾除土塊,雜物等的干擾,使植物與背景分割清晰,作物行信息清楚。并且提取的特征點(diǎn)可以很好表征作物行的走向。
標(biāo)準(zhǔn)Hough算法基于特征點(diǎn)圖像(如圖3b)進(jìn)行作物行中心線提取。從圖3c中Hough變換檢測(cè)結(jié)果(圖3c紅色的線)與參考直線(圖3c藍(lán)色的線)的夾角可以看出,對(duì)于特征點(diǎn)比較分散的圖像,如圖3b最右邊的圖像,Hough檢測(cè)存在一定偏差,識(shí)別誤差為4.463 3°。
針對(duì)以上Hough算法對(duì)于特征點(diǎn)分散的圖像峰值檢測(cè)較難的問(wèn)題,本文由此提出將特征點(diǎn)進(jìn)行聚類,如圖4a。從圖4a中可以看出,聚類后的點(diǎn)可以很好的表征作物行的中心位置。
圖4b顯示了本文算法的作物行檢測(cè)結(jié)果與參考直線的夾角。從處理結(jié)果中可以看出,對(duì)于作物行有明顯的缺失,以及枯草和雜草干擾的圖像,該算法仍能成功檢測(cè)出作物行。
圖4 基于粒子群聚類的作物行檢測(cè)結(jié)果與參考直線的對(duì)比Fig.4 Comparison between reference lines and detection lines based on PSO-clustering for crop row
圖5 顯示了文獻(xiàn)[25]中的算法檢測(cè)的作物行結(jié)果,該算法基于二值圖像進(jìn)行作物行中心線的提取,從圖5的結(jié)果可以看出,3幅圖檢測(cè)效果并不理想,3幅圖最右邊一行均沒(méi)有檢測(cè)出來(lái),這主要由于其算法用粒子群優(yōu)化時(shí),直線約束方程由頂邊和底邊的2個(gè)像素點(diǎn)決定,然而這3行作物并不能找到底邊,因此無(wú)法被識(shí)別出來(lái)。
圖5 文獻(xiàn)[25]算法的作物行檢測(cè)結(jié)果與參考直線的對(duì)比Fig.5 Comparison between reference lines and detection lines based on literature[25] for crop row
這里對(duì)以上3種作物行檢測(cè)算法結(jié)果進(jìn)行詳細(xì)分析。首先,對(duì)于標(biāo)準(zhǔn)Hough變換來(lái)說(shuō),對(duì)以上3幅小麥圖像,越冬期小麥、含枯草返青期小麥、含高密度雜草返青期小麥圖像,Hough算法識(shí)別誤差分別為0.968 3°、2.715 8°和4.463 3°。本文檢測(cè)算法識(shí)別誤差分別為0.631 0°、0.773 5°和1.065 7°。由此可知,對(duì)于雜草噪聲干擾較少的作物(圖3左邊兩幅圖),標(biāo)準(zhǔn)Hough和本文算法都可以成功檢測(cè)出作物行。然而對(duì)于雜草比較多的作物(圖3最右邊一幅圖),Hough的檢測(cè)結(jié)果存在較大偏差。這是由于對(duì)于噪聲點(diǎn)較多、特征點(diǎn)分散的圖像,Hough檢測(cè)算法的峰值往往難以確定。相比較于Hough檢測(cè)算法,本文通過(guò)將候選特征點(diǎn)聚類,剔除部分干擾特征點(diǎn),留下能代表目標(biāo)作物行中心線的特征點(diǎn),進(jìn)而可以較為準(zhǔn)確的獲取作物行。其次,對(duì)于文獻(xiàn)[25]提出的算法,它的識(shí)別誤差分別為2.260 5°、1.531 9°和5.829 1°。從結(jié)果中可以看出,該算法具有一定局限性,主要由于該算法用垂直投影法確定作物行的左右邊界,從而確定圖像底邊和頂邊像素點(diǎn)的范圍,并用粒子群算法進(jìn)行尋優(yōu),在算法實(shí)現(xiàn)過(guò)程中,如遇到圖5中最右邊作物行找不到底邊的情況時(shí),該作物行無(wú)法識(shí)別。同樣,對(duì)于雜草較多的圖像,由于受到較多噪聲點(diǎn)的干擾,算法的檢測(cè)結(jié)果存在偏差。因此,在識(shí)別誤差方面,Hough和文獻(xiàn)[25]的算法高于本文提出的算法。
在運(yùn)行速率方面,從表1中可以看出,本文算法和文獻(xiàn)[25]中的算法相比于標(biāo)準(zhǔn)Hough算法明顯耗時(shí)較少,主要由于前兩種算法都用到了粒子群優(yōu)化思想,粒子群本身之所以效率高,計(jì)算速度快,和它自身的算法自身優(yōu)勢(shì)有關(guān),它從隨機(jī)性初始解出發(fā),根據(jù)目標(biāo)函數(shù)的自身正反饋,不斷調(diào)整各個(gè)變量的速度,從而快速逼近最優(yōu)解。本文中Hough算法在參數(shù)范圍內(nèi)量化參數(shù)空間,然后進(jìn)行有限集合的窮盡搜索。若量化步長(zhǎng)過(guò)小,則必然會(huì)耗費(fèi)更多的計(jì)算時(shí)間,步長(zhǎng)過(guò)大,則無(wú)法到達(dá)自己本身的精度。而粒子群算法,可以根據(jù)自適應(yīng)調(diào)整進(jìn)化步長(zhǎng),當(dāng)前解離最優(yōu)解還有“一段距離”時(shí),那么粒子群則以較大步長(zhǎng)靠近,當(dāng)前解離最優(yōu)解非常近時(shí)候,則步長(zhǎng)又會(huì)縮小,使當(dāng)前解盡量和最優(yōu)解“重合”,因此粒子群算法是一種非常實(shí)用的優(yōu)化方法。此外,運(yùn)行一幅480×640像素大小的彩色圖像,文獻(xiàn)[25]中的算法和本文算法平均耗時(shí)分別為0.685 9和0.423 7 s,本文算法中,特征點(diǎn)的提取減少了數(shù)據(jù)量,相比較文獻(xiàn)[25]提高了運(yùn)行速率。
由上可知,本文提出的作物行檢測(cè)算法,相比較于標(biāo)準(zhǔn)Hough算法和文獻(xiàn)[25]中的算法,不僅具有更快的運(yùn)行速率,同時(shí)對(duì)各種復(fù)雜環(huán)境下的小麥作物圖像具有較強(qiáng)適應(yīng)性。
1)為了快速準(zhǔn)確的檢測(cè)作物行,提出新的聚類算法:根據(jù)特征點(diǎn)的距離特征,利用粒子群優(yōu)化算法對(duì)每一作物行的特征點(diǎn)進(jìn)行聚類,聚類后的特征點(diǎn)可以很好的代表作物行的中心位置;運(yùn)用最小二乘法對(duì)每一類的特征點(diǎn)進(jìn)行直線擬合,提高了最小二乘法的適應(yīng)性。試驗(yàn)結(jié)果表明,該算法可以較為準(zhǔn)確的獲取作物行,識(shí)別率達(dá)95%,識(shí)別誤差小于3°,滿足農(nóng)業(yè)機(jī)器人田間作業(yè)的實(shí)際需求。
2)該算法對(duì)含有高密度雜草的小麥圖像具有很強(qiáng)適應(yīng)性。
3)本文將提出的作物行檢測(cè)算法與常用的2種作物行檢測(cè)算法進(jìn)行了對(duì)比。試驗(yàn)結(jié)果表明,標(biāo)準(zhǔn)Hough、文獻(xiàn)[25]中的算法和本文算法的平均誤差分別為2.538 0°、3.105 7°和0.936 5°;利用本文算法檢測(cè)作物行中心線在保證低識(shí)別誤差的同時(shí),算法處理速率相比較于標(biāo)準(zhǔn)Hough算法提升一倍。
[1] Hemming J, Rath T. PA-Precision Agriculture: Computervision-based weed identification under field conditions using controlled lighting[J]. Journal of Agricultural Research Engineering, 2001, 78(3): 233-243.
[2] Xue J, Zhang L, Grift T E. Variable field-of-view machine vision based row guidance of an agricultural robot[J]. Computers and Electronics in Agriculture, 2012, 84(2): 85-91.
[3] Mousazadeh H. A technical review on navigation systems of agricultural autonomous off-road vehicles[J]. Journal of Terramechanics, 2013, 50(3): 211-232.
[4] Li G N, Tan Q C, Sun Q C, et al. Normal strain measurement by machine vision[J]. Measurement, 2014, 50(4): 106-114. [5] Gongal A, Silwal A, Amatya S, et al. Apple crop-load estimation with over-the-row machine vision system[J]. Computers and Electronics in Agriculture, 2016, 120: 26-35.
[6] Zhang N, Chaisattapagon C. Effective criteria for weed identification in wheat fields using machine vision[J]. Transactions of the ASAE, 1995, 38(3): 965-974.
[7] Burgos-Artizzu X P, Ribeiro A, Guijarro M, et al. Real-time image processing for crop/weed discrimination in maize fields[J]. Computers and Electronics in Agriculture, 2011, 75(2): 337-346.
[8] Rahman M, Blackwell B, Banerjee N, et al. Smartphone-based hierarchical crowdsourcing for weed identification[J]. Computers and Electronics in Agriculture, 2015, 113(C): 14-23.
[9] Bakker T, Wouters H, Asselt K V, et al. A vision based row detection system for sugar Beet[J]. Computers and Electronics in Agriculture, 2008, 60(1): 87-95.
[10] Billingsley J, Schoenfisch M. The successful development of a vision guidance system for agriculture[J]. Computers and Electronics in Agriculture, 1997, 16(2): 147-163.
[11] S?gaard H T, Olsen H J. Determination of crop rows by image analysis without segmentation[J]. Computers and Electronics in Agriculture, 2003, 38(2): 141-158.
[12] Hague T, Tillett N D. A bandpass filter-based approach to crop row location and tracking[J]. Mechatronics, 2001, 11(1): 1-12.
[13] Montalvo M, Guerrero J M, Romeo J, et al. Automatic expert system for weeds/crops identification in images from maize fields[J]. Expert Systems with Applications, 2013, 40(1): 75-82.
[14] 陳嬌,姜國(guó)權(quán),杜尚豐,等. 基于壟線平行特征的視覺(jué)導(dǎo)航多壟線識(shí)別[J]. 農(nóng)業(yè)工程學(xué)報(bào),2009,25(12):107-113. Chen Jiao, Jiang Guoquan, Du Shangfeng, et al. Crop rows detection based on parallel characteristic of crop rows using visual navigation.[J]. Transactions of the Chinese Society of Agricultural Engineering (Transactions of the CSAE), 2009, 25(12): 107-113. (in Chinese with English abstract)
[15] Fernandes L A F, Oliveira M M. Real-time line detection through an improved Hough transform voting scheme[J]. Pattern Recognition, 2008, 41(1): 299-314.
[16] 趙瑞嬌,李民贊,張漫,等. 基于改進(jìn)Hough 變換的農(nóng)田作物行快速檢測(cè)算法[J]. 農(nóng)業(yè)機(jī)械學(xué)報(bào),2009,40(7):163-165. Zhao Ruijiao, Li Minzan, Zhang Man, et al. Rapid crop-row detection based on improved Hough transformation[J]. Transactions of the Chinese Society for Agricultural Machinery, 2009, 40(7): 163-165. (in Chinese with English abstract)
[17] 曹倩,王庫(kù),李寒. 基于機(jī)器視覺(jué)的旱田多目標(biāo)直線檢測(cè)方法[J]. 農(nóng)業(yè)工程學(xué)報(bào),2010,26(13):187-191. Cao Qian, Wang Ku, Li Han. Detection algorithm for crop target multi-lines of the field image based on machine vision[J]. Transactions of the Chinese Society of Agricultural Engineering (Transactions of the CSAE), 2010, 26(13): 187-191. (in Chinese with English abstract)
[18] Jiang G, Wang X, Wang Z, et al. Wheat rows detection at the early growth stage based on Hough transform and vanishing point[J]. Computers and Electronics in Agriculture, 2016, 123: 211-223.
[19] Xu L, Oja E, Kultanen P. A new curve detection method: randomized Hough transform (RHT)[J]. Pattern Recognition Letters, 1990, 11(5): 331-338.
[20] Ji R, Qi L. Crop-row detection algorithm based on random Hough transformation[J]. Mathematical and Computer Modelling, 2011, 54(3/4): 1016-1020.
[21] Montalvo M, Pajares G, Guerrero J M, et al. Automatic detection of crop rows in maize fields with high weeds pressure[J]. Expert Systems with Applications, 2012, 39(15): 11889-11897.
[22] 司永勝,姜國(guó)權(quán),劉剛,等. 基于最小二乘法的早期作物行中心線檢測(cè)方法[J]. 農(nóng)業(yè)機(jī)械學(xué)報(bào),2010,41(7):163-167. Si Yongsheng, Jiang Guoquan, Liu Gang, et al.Early stage crop rows detection based on least square method[J]. Transactions of the Chinese Society for Agricultural Machinery, 2010, 41(7): 163-167. (in Chinese with English abstract)
[23] Jiang G, Wang Z, Liu H. Automatic detection of crop rows based on multi-ROIs[J]. Expert Systems with Applications, 2014, 42(5): 2429-2441.
[24] 石磊,趙春霞,楊靜宇,等. 一種基于粒子群的道路檢測(cè)新算法[J]. 數(shù)據(jù)采集與處理,2010,25(3):384-388.Shi Lei, Zhao Chunxia, Yang Jingyu, et al. New approach to road detection based on particle swarm optimization[J]. Journal of Data Acquisition & Processing, 2010, 25(3): 384-388. (in Chinese with English abstract)
[25] 孟慶寬,張漫,耿煌,等. 自然光照下基于粒子群算法的農(nóng)業(yè)機(jī)械導(dǎo)航路徑識(shí)別[J]. 農(nóng)業(yè)機(jī)械學(xué)報(bào),2016,47(6):11-20. Meng Qingkuan, Zhang Man, Geng Huang, et al. Guidance line recognition of agricultural machinery based on particle swarm optimization under natural illumination[J]. Transactions of the Chinese Society for Agricultural Machinery, 2016, 47(6): 11-20. (in Chinese with English abstract)
[26] Tang L, Tian L F, Steward B L, et al. Texture-based weed classification using Gabor wavelets and neural network for real-time selective herbicide applications[P]. Urbana, 1999: 993036.
[27] Otsu N. A threshold selection method from gray-level histograms[J]. Automatica, 1975, 11(285-296): 23-27.
[28] Matsui N, Mita K. Method of reducing digital images[P]. Washington, DC: U.S. Patent and Trademark Office: 4931881, 1990.
[29] 姜國(guó)權(quán),柯杏,杜尚豐,等. 基于機(jī)器視覺(jué)的農(nóng)田作物行檢測(cè)[J]. 光學(xué)學(xué)報(bào),2009,29(4):1015-1020. Jiang Guoquan, Ke Xing, Du Shangfeng, et al. Crop row detection based on machine vision[J]. Acta Optica Sinica, 2009, 29(4): 1015-1020. (in Chinese with English abstract)
[30] 姜國(guó)權(quán),王志衡,趙翠君. 基于已知點(diǎn)的作物行檢測(cè)方法[J].應(yīng)用基礎(chǔ)與工程科學(xué)學(xué)報(bào),2013,21(5):983-990. Jiang Guoquan, Wang Zhiheng, Zhao Cuijun. An algorithm of detecting crop rows based on known-points[J]. Journal of Basic Science & Engineering, 2013, 21(5): 983-990. (in Chinese with English abstract)
Crop rows detection based on image characteristic point and particle swarm optimization-clustering algorithm
Jiang Guoquan, Yang Xiaoya, Wang Zhiheng※, Liu Hongmin
(School of Computer Science and Technology, Henan Polytechnic University, Jiaozuo 454000, China)
In order to extract the crop rows of wheat quickly and accurately, a new method of wheat crop row detection was proposed based on particle swarm optimization (PSO) - clustering. The first step is image segmentation. The purpose of image segmentation was to separate the green plants from background, and it required the following 2 steps: Firstly, gray-level transformation, which could be done in RGB color space. In this paper, the color excess green index 2G-R-B was used; Secondly, image binarization was conducted. Among the global thresholding techniques for image binarization, Otsu method is one of the best threshold ways. So, this paper used Otsu algorithm to binarize the above obtained gray-level image. In order to reduce the burden of the next work, it was essential to extract a number of feature points indicating the crop rows. The specific algorithm can be divided into 2 steps: Firstly, get the left and right boundary points of each crop row. Secondly, extract the midpoint between left and right boundary points. After the original crop image was processed by the above steps, we got the feature points of the crop rows. According to the characteristics that the distances from the feature points around the crop row centreline to this straight line were all smaller than a certain distance threshold, we used the clustering method based on PSO to determine the real center points indicating crop rows. In the crop rows detection algorithm based on the PSO-clustering, the line in the data space composed of the feature points was considered as a particle. Finally, the centrelines were detected by fitting a straight line with the least square method. In order to prove the superiority of the algorithm, we compared the algorithm with standard Hough transform and the algorithm proposed in another literature. We tested the performance from the aspects of the detection accuracy and processing time for different images. Here, a total of 350 images have been tested. The number of the wheat images in overwintering stage was 197 and the number of the wheat images in green stage was 153. For the algorithm proposed in this paper, the number of the wheat images in overwintering stage successfully detected was 190 and that in green stage successfully detected was 143. Comparatively speaking, for the algorithm with standard Hough transform, the numbers of the wheat images in overwintering and green stage that were successfully detected were 180 and 100, respectively. For the algorithm proposed in another literature, the numbers were 168 and 93, respectively. Three representative pictures were selected in the experiment, which included the different environment i.e. the lack of crops, soil block, and high density weed. For the 3 images, the identification errors of the proposed algorithm were 0.631 0°, 0.773 5° and 1.065 7°, respectively. The identification errors of the standard Hough were 0.968 3°, 2.715 8° and 4.463 3°, respectively. The identification errors of the algorithm proposed in another literature were 2.260 5°, 1.531 9° and 5.829 1°, respectively. Therefore, compared with the other 2 algorithms, the proposed algorithm has the advantages of high real time and high accuracy, which can meet the practical requirements of field operation of agricultural robots.
image processing; algorithms; clustering; crop rows detection; particle swarm optimization; least squares
10.11975/j.issn.1002-6819.2017.11.021
TP391.4
A
1002-6819(2017)-11-0165-06
姜國(guó)權(quán),楊小亞,王志衡,劉紅敏. 基于圖像特征點(diǎn)粒子群聚類算法的麥田作物行檢測(cè) [J]. 農(nóng)業(yè)工程學(xué)報(bào),2017,33(11):165-170.
10.11975/j.issn.1002-6819.2017.11.021 http://www.tcsae.org
Jiang Guoquan, Yang Xiaoya, Wang Zhiheng, Liu Hongmin. Crop rows detection based on image characteristic point and particle swarm optimization-clustering algorithm[J]. Transactions of the Chinese Society of Agricultural Engineering (Transactions of the CSAE), 2017, 33(11): 165-170. (in Chinese with English abstract) doi:10.11975/j.issn.1002-6819.2017.11.021 http://www.tcsae.org
2017-01-07
2017-05-08
國(guó)家自然科學(xué)基金資助項(xiàng)目(61472119,61572173,61472373,61401150);河南省科技攻關(guān)項(xiàng)目(172102110032);河南省教育廳高等學(xué)校重點(diǎn)項(xiàng)目(17A210014);河南省高等學(xué)校礦山信息化重點(diǎn)學(xué)科開(kāi)放實(shí)驗(yàn)室開(kāi)放基金資助(KY2012-09);河南省高?;究蒲袠I(yè)務(wù)費(fèi)專項(xiàng)資金資助;計(jì)算機(jī)視覺(jué)與圖像處理創(chuàng)新團(tuán)隊(duì)(T2014-3)
姜國(guó)權(quán),男,副教授,主要從事機(jī)器視覺(jué)技術(shù)研究。焦作 河南理工大學(xué)計(jì)算機(jī)科學(xué)與技術(shù)學(xué)院,454000。Email:jguoquan@163.com
※通信作者:王志衡,男,副教授,主要從事機(jī)器視覺(jué)及模式識(shí)別研究。焦作 河南理工大學(xué)計(jì)算機(jī)科學(xué)與技術(shù)學(xué)院,454000。
Email:wzhenry@eyou.com