盧 軍,胡秀文
?
弱光復雜背景下基于MSER和HCA的樹上綠色柑橘檢測
盧 軍1,胡秀文2
(1. 華中農(nóng)業(yè)大學理學院,武漢 430070;2. 華中農(nóng)業(yè)大學工學院,武漢 430070)
基于圖像處理和機器視覺的樹上綠色柑橘檢測,能為果園管理者施肥、估產(chǎn)及采摘作業(yè)提供指導。該文提出一種基于水果表面光照分布的分層輪廓分析(hierarchical Contour Analysis,HCA)算法實現(xiàn)了樹上綠色柑橘的檢測。彩色數(shù)碼相機拍攝弱光下由閃光燈補光的樹上柑橘場景彩色圖像,基于水果表面的光照分布應用最大穩(wěn)定極值區(qū)域(maximally stable extremal region,MSER)算法提取圖像中的感興趣區(qū)域,然后建立感興趣區(qū)域周圍的分層輪廓圖,并利用霍夫變換擬合每一級輪廓獲得分層圓形目標,最后進行擬合圓嵌套分析得到綠色柑橘水果目標。所提算法在20張復雜的柑橘果園場景圖像中進行了測試,最終的召回率達81.2%,查準率達到83.5%,單幅圖像平均處理時間為3.70 s。該文所提出的基于光照分布的分層輪廓分析算法,不僅適用于綠色柑橘的檢測,也可為其他樹上綠色水果檢測提供通用的框架和思路。
圖像處理;目標識別;算法;最大穩(wěn)定極值區(qū)域;分層輪廓分析;霍夫變換;綠色柑橘檢測
在水果生產(chǎn)過程中,充分利用信息化、智能化技術(shù)對作物生長進行動態(tài)監(jiān)測,對于果園的自動管理(自動施肥/灌溉/噴藥)、提高農(nóng)作物品質(zhì)、產(chǎn)量估計及自動采摘都有著重要意義。本文以柑橘為例,討論了基于圖像處理的樹上綠色水果檢測。樹上綠色水果的檢測與識別是實現(xiàn)水果生產(chǎn)自動化和智能化的一個關(guān)鍵環(huán)節(jié),對優(yōu)化果園管理、實現(xiàn)自動作業(yè)具有重要的價值和應用前景。
隨著圖像處理、機器視覺技術(shù)的發(fā)展,關(guān)于樹上水果檢測和識別已吸引了眾多在圖像處理和農(nóng)業(yè)工程領(lǐng)域研究者的目光。Jimenez等[1-3]撰寫了關(guān)于樹上水果檢測定位的綜述性文章,全面地展示了該領(lǐng)域當時的發(fā)展階段和存在的挑戰(zhàn),描述了為解決挑戰(zhàn)所采用的各種成像設(shè)備和圖像處理方法。其中大部分工作是研究與背景顏色差異較大,如紅色、橙色水果的檢測,而關(guān)于樹上綠色水果的檢測與識別的工作較少且起步較晚。自2004年開始,陸續(xù)有關(guān)于樹上綠色水果檢測的論文發(fā)表。Annamalai等[4]在實驗室利用光譜儀對比了綠色柑橘和綠色葉片的光譜,提出基于光譜波段比的綠色柑橘檢測方法。Safren等[5]研究了基于可見光和近紅外高光譜圖像的綠色蘋果產(chǎn)量估計系統(tǒng)。Okamoto等[6]實現(xiàn)了基于高光譜相機和波段比算法的綠色柑橘檢測,對于完整柑橘檢測的成功率在82%以上,但對于遮擋柑橘檢測的成功率在47%~59%之間。Stajnko等[7]利用熱像儀來估計未成熟蘋果的數(shù)量和直徑,Wachs等[8]提出利用彩色圖像和熱圖像來檢測綠色蘋果的方案,但利用熱圖像的方法僅能在陽光直射的下午使用。而利用彩色相機獲取的彩色圖像進行樹上綠色水果檢測,由于設(shè)備價格低廉、使用方便而被普遍采用。更多的工作集中在分析處理彩色圖像,并利用顏色、紋理、形狀或多個特征組合來實現(xiàn)對樹上綠色水果的檢測[9-13]。
利用彩色圖像進行樹上綠色水果檢測的方法,對于多變的自然光照條件非常敏感,檢測的效果不夠穩(wěn)定魯棒[14-15]。針對該方法易受自然光照條件影響的問題,Payne等[16-19]利用人造光源對夜間的樹冠進行照明,從而獲得人造光照條件下的夜間彩色圖像并實現(xiàn)了較魯棒的樹上水果檢測。Linker等[20]提出了利用水果表面形狀的凸性所產(chǎn)生的光照分布特征來檢測樹上蘋果。Linker等[18]指出,在弱光條件下利用人工光源照明時,由于水果表面的鏡面反射效果,在光源正入射方向會形成一個亮斑,在該亮斑附近由于水果的球形特征會形成具有環(huán)狀對稱性特征的光強分布。Linker[19]提出了利用多個閾值來分割夜間樹上綠色蘋果圖像,然后針對分割結(jié)果圖進行圓擬合,并利用在多個分割圖中擬合圓的累計得分來檢測樹上綠色柑橘的方法。該方法效果較好而且比較穩(wěn)定,但處理過程中共需要設(shè)置7個參數(shù),而且在多個分割圖像中進行圓霍夫變換來檢測圓目標,這是一件極為耗時的工作,其時間性能沒有報道。
針對當前利用水果表面光照分布檢測樹上水果等工作的亮點和不足,本文提出基于最大穩(wěn)定極值區(qū)域和分層輪廓分析算法的樹上綠色柑橘檢測算法。本項工作利用彩色攝像機獲取在弱光條件下由閃光燈補光的樹上綠色柑橘圖像,利用最大穩(wěn)定極值區(qū)域檢測場景中的感興趣目標區(qū)域。針對符合形狀條件的感興趣局部區(qū)域,本文首次提出局部分層輪廓分析算法,捕捉并檢測柑橘目標表面的環(huán)形光照對稱分布,從而最終檢測出樹上綠色柑橘目標。
本文圖像的采集時間為2016年8月—10月18:00—19:30,試驗對象為樹上綠色柑橘,柑橘品種為Hamlin,地點為美國弗洛里達大學柑橘果園。所使用的相機為佳能公司生產(chǎn)的微型單反相機EOS M,鏡頭為佳能公司生產(chǎn)的EF-M卡口18~55 mm鏡頭(拍攝時使用18 mm廣角端),配備一個閃光燈(Canon 430EX)。閃光燈直接安裝在相機機頂?shù)臒嵫ブ信c鏡頭對齊。試驗拍攝同一果園中20棵不同果樹的單側(cè)圖像,所拍攝圖像的原始分辨率為5 184′3 456像素,存儲為24位彩色JPG圖像。圖像處理時將所有圖像均調(diào)整成1 037′691像素的大小以便后期處理,圖像處理的軟件是Matlab R2015b,所使用的計算機CPU為Intel Core i5 4258U 2.40 GHz,內(nèi)存為4 GB,操作系統(tǒng)為 Microsoft Windows 8.1中文版。
本文所提算法分為兩個階段:感興趣區(qū)域提取及分層輪廓分析。第一階段首先提取彩色圖像的綠色分量進行預處理,然后運用最大穩(wěn)定極值區(qū)域(maximally stable extremal region,MSER)算法[21-23]提取灰度圖像中的感興趣區(qū)域,通過對檢測出的感興趣區(qū)域進行形狀分析初步篩選出水果目標區(qū)域。第二階段提出分層輪廓分析算法(hierarchical contour analysis,HCA),針對篩選后的感興趣區(qū)域提取目標的分層輪廓線,利用圓形霍夫變換擬合出目標圓并依據(jù)圓心距離進行嵌套分析得到最終的柑橘水果目標。算法的主要流程圖如圖1所示。
圖1 綠色柑橘檢測算法流程圖
由于檢測的是樹上綠色水果目標,本文首先提取彩色圖像中的綠色分量灰度圖,然后對綠色分量圖進行濾波以濾除部分噪聲。在本試驗的測試過程中發(fā)現(xiàn),對比維納濾波[24],中值濾波會使目標的誤檢測增加。而在使用維納濾波的過程中,3′3的濾波窗口比5′5及更大的濾波窗口更有利于檢測面積較小及遮擋嚴重的水果目標。因此本文最終采用3′3的濾波窗口進行維納濾波濾除圖像中的高斯噪聲。經(jīng)過維納濾波平滑的圖像,能夠在水果表面提供更好的光照環(huán)形對稱性分布,有助于利用該特征實現(xiàn)對綠色柑橘的檢測。
MSER算法最初是Matas等[25]在檢測局部仿射不變特征區(qū)域時基于分水嶺變換的方法提出的,主要用于處理灰度圖像[26-28]。其基本思想是:對于一幅灰度圖像,利用遞變的閾值對圖像進行二值化分割,閾值取0~255共256個數(shù)值,由此得到256幅二值圖像。在閾值由0不斷增大或由255不斷減小的過程中,有一些連通區(qū)域在較大范圍閾值內(nèi)形狀保持穩(wěn)定,這些區(qū)域即為最大穩(wěn)定極值區(qū)域MSERs。
針對預處理平滑后的灰度圖像,利用MSER算法提取其最大穩(wěn)定極值區(qū)域,圖2給出了一個檢測的示例。圖2a為原始彩色圖像,圖2b為MSER算法對相應灰度圖像中最大穩(wěn)定極值區(qū)域的提取,圖中的柑橘目標有明顯區(qū)別于背景的輪廓,且在柑橘目標中心入射點附近呈現(xiàn)出近似于同心圓環(huán)的光強分布特征。在MSER算法提取結(jié)果的基礎(chǔ)上,針對每一個最大穩(wěn)定極值區(qū)域輪廓進行橢圓目標擬合[29-32],得到如圖2c的結(jié)果。由橢圓擬合結(jié)果可見,算法提取出的目標較多,且其中大部分為背景。因此,需要對提取區(qū)域結(jié)果進行形狀分析,初步篩選出具有合適形狀特征的最大穩(wěn)定極值區(qū)域。
a. 原始圖像 a. Original imageb. 最大穩(wěn)定極值區(qū)域(MSER)b. Maximally stable extremal regions (MSER) c. 橢圓擬合結(jié)果 c. Fitting results of ellipsed. 篩選結(jié)果 d. Screening results
假設(shè)利用MSER算法提取出了個最大穩(wěn)定極值區(qū)域,其中第個極值區(qū)域擬合出來的橢圓目標E參數(shù)為
式中(x,y)為中心坐標,a、b分別為長軸與短軸長度,θ為橢圓長軸傾角。根據(jù)該橢圓離心率e去除無效橢圓
式中4為離心率閾值,該式指出有效橢圓的離心率必須足夠小。在獲取的圖像集中利用柑橘目標外輪廓的內(nèi)接矩形手動標記了100個柑橘水果目標,分析了這100個水果目標的離心率,發(fā)現(xiàn)其離心率均低于0.35,因此此處的閾值4取值為0.35。然后對圖2c的目標區(qū)域進行形狀分析,最終得到的有效區(qū)域如圖2d所示。
MSER算法提取出的感興趣區(qū)域數(shù)量較多,經(jīng)過橢圓擬合和形狀分析之后,保留了形狀接近于圓形的最大穩(wěn)定極值區(qū)域,而這些區(qū)域中僅有一部分是水果目標。本文首次提出一種分層輪廓分析算法(hierarchical contour analysis,HCA)用以檢測有效感興趣區(qū)域中的水果目標。
本試驗中,由于柑橘果實近似球形,在光線正入射的表面處會出現(xiàn)一個亮斑。在該亮斑中心附近,柑橘表面的光強呈現(xiàn)出環(huán)形對稱分布的特征。針對這種光強環(huán)形對稱分布特征,本文提出分層輪廓分析方法來檢測水果表面這種特有的光照分布模式(圖3)。
注:LM、LM-1、LM-2分別為第M、M-1、M-2級分層輪廓(上行)及對應擬合圓目標(下行)。
在2.2節(jié)所檢測出的每一個最大穩(wěn)定極值區(qū)域基礎(chǔ)上,圖3a為圖2d所對應的亮度等高線分布圖,選取圖像中藍色框標記的水果作為目標進行進一步分析。圖3b是該目標的亮度等高線放大圖,最中間的輪廓線定義為L,由中心向外層依次選取3級輪廓線,分別為L、L1、L2。針對這三級等高線的外輪廓,分別利用圓形霍夫變換[33-37]進行圓檢測,結(jié)果如圖3c~3e所示。每個水果目標的每級輪廓線擬合出一個圓,由此擬合出多個近似同心圓,即為水果目標的分層輪廓特征,如圖3f所示。最終,依據(jù)式(3)對多級輪廓線進行嵌套分析得到最終的目標圓。
其中R與R分別表示圓C與圓的半徑,d表示兩個圓心的距離。當兩個圓的圓心距離足夠近時,則認為圓屬于圓的一部分,因此只保留圓。最終保留下來的最后一個圓目標唯一對應一個水果,如圖3g所示。
為驗證本文所提算法的有效性,對20幅復雜的樹上綠色柑橘圖像進行處理,結(jié)果表明該算法能夠有效識別圖像中的綠色柑橘目標。圖4a與圖4b為其中2張圖像處理的結(jié)果(依次對應表1中前兩組數(shù)據(jù))。由圖4可見,本文算法識別出了圖像中大部分的綠色柑橘目標。
a. 圖像1檢測結(jié)果 a. Detection results of image 1
b. 圖像2檢測結(jié)果 b. Detection results of image 2
注:藍色矩形框為人工標記的柑橘;紅色小圓為最大穩(wěn)定極值區(qū)域中心點;較大的紅色圓為算法檢測到的綠色柑橘。
Note: The blue rectangles are artificial markers of citrus; The small red circles are the center points of MSER; The larger red circles are the green citrus fruits that the algorithm detected.
圖4 示例圖像及檢測結(jié)果
Fig.4 Example images and test results
表1是本文所提算法在20幅測試圖像上的檢測結(jié)果。其中,真正類tp表示每張圖中正確識別的水果目標個數(shù),假正類fp表示背景被錯誤識別成水果的目標個數(shù),假負類fn表示圖中未被正確檢出的水果目標個數(shù)。ac表示召回率,%;pc表示查準率,%。
其中ac與pc的計算公式如式(4)所示。
在以上20幅圖構(gòu)成的測試圖像集中,共檢測出了496個水果目標,漏檢測115個目標,誤檢測98個目標。在整個測試集上的總計召回率為81.2%,查準率為83.5%。
表1 本文算法對20幅柑橘圖像檢測結(jié)果
Linker等[20]提出了利用水果表面形狀的凸性所產(chǎn)生的光照分布特征實現(xiàn)樹上蘋果檢測,其所提算法的召回率為93.5%,查準率為86.0%。但該算法首先要提取水果目標的外輪廓,因此極易受到光照變化和遮擋的影響;而本文提出的分層輪廓分析,利用的是環(huán)形光照的多級輪廓特征,不需要提取水果目標的外輪廓,當柑橘表面被部分遮擋時,其外層輪廓線不再完整但內(nèi)層輪廓線仍舊完整,保證了該算法在光照變化和遮擋下的穩(wěn)定性。
Li等[13]采用了模板匹配和圓霍夫變換的方法提取感興趣區(qū)域,然后利用紋理特征去除假正區(qū)域,最終在59張圖共154個目標果的測試集上達到了84.4%的識別率。Zhao等[38]整合了基于色差分析和模板匹配的方法提取感興趣區(qū)域,然后利用紋理特征和支持向量機對感興趣區(qū)域進行了分類得到最終水果目標,最終在68張圖共308個目標果的測試集上達到了83.4%的識別率。
表2為上述幾種最新的方法與本文的結(jié)果對比,由表2可見,本文算法在召回率和查準率方面要略低于這幾篇文章的結(jié)果。Linker等[20]和Li等[13]所使用的測試集中的平均每幅圖像僅包含2個左右水果目標, Zhao等[38]所處理的圖像包含目標平均在4.5個/幅,而本文所使用的測試集中的每幅圖像平均包含30.6個目標。隨著每張圖中包含的目標數(shù)量大幅增加,遮擋和水果尺度變化顯著增加,因此目標檢測的復雜度和難度相應地也會大幅增加。
表2 不同方法檢測結(jié)果對比
水果目標漏檢測的主要原因估計來自兩個方面:1)如圖4a中大部分漏檢測的水果所示,水果本身像素太小或遮擋率超過60%甚至更高;2)光照不夠均勻及陰影的存在,使部分水果表面未形成環(huán)形對稱分布特征。由于樹冠場景復雜,導致樹冠場景圖像中存在極亮或極暗區(qū)域,這些區(qū)域內(nèi)的葉片由于對比度偏低,易被誤檢測為柑橘,如圖4b右側(cè)。另一方面,一些正對相機的葉片表面易形成一種近似環(huán)形分布的特征,往往會被誤檢測為柑橘目標。
為了進一步了解本文所提算法的時間性能,將本文所提算法分為兩個階段:最大穩(wěn)定極值區(qū)域提取(MSER)及分層輪廓分析(HCA),如圖1所示。經(jīng)在測試集上的所有圖像測試,平均每幅圖像在第一階段的處理時間為0.57 s,第二階段的處理時間為3.13 s,每幅圖像的平均處理時長合計為3.70 s。兩個階段相比較而言,利用HCA方法提取輪廓所花時間較長,主要是由于霍夫變換擬合圓形目標需要較長時間。下一步的工作擬采用其他圓擬合的方法替換霍夫變換,從而減少HCA算法的執(zhí)行時間。
本文提出了一種基于最大穩(wěn)定極值區(qū)域(maximally stable extremal region,MSER)和分層輪廓分析(hierarchical contour analysis,HCA)的樹上綠色柑橘檢測算法。該算法首先提取彩色圖像的綠色分量,進行維納濾波后,采用MSER算法提取圖像中的最大穩(wěn)定極值區(qū)域,通過形狀分析篩選感興趣的最大穩(wěn)定極值區(qū)域。然后使用HCA算法提取感興趣區(qū)域的輪廓信息,對提取出的每級輪廓采用霍夫變換進行圓擬合,對分層擬合圓目標進行嵌套分析從而得到最終檢測目標。本文所提算法利用了水果表面環(huán)形光照分布的輪廓形狀特征實現(xiàn)了樹上綠色水果檢測,該方法所使用的形狀特征比顏色特征更為穩(wěn)定,同時也避免了常見水果外輪廓形狀特征在陰影和遮擋下的不穩(wěn)定性。通過在20幅圖像構(gòu)成的圖像集合上進行測試,本文所提算法的最終召回率達81.2%,查準率為83.5%,每幅圖像的平均處理時間為3.70 s。試驗表明,本文所提算法能夠有效識別復雜果園場景中的綠色柑橘水果目標。在下一步的工作中,一方面需要優(yōu)化圓擬合階段從而提高時間性能;另一方面要驗證該算法在不同水果品種、不同時間和光照條件下的性能,以推廣該算法。
[1] Jimenez A R, Ceres R, Pons J L. A survey of computer vision methods for locating fruit on trees[J]. Transactions of the ASAE, 2000, 43(6): 1911-1920.
[2] Kapach K, Barnea E, Mairon R, et al. Computer vision for fruit harvesting robots–state of the art and challenges ahead[J]. International Journal of Computational Vision and Robotics, 2012, 3(1): 4-34.
[3] Gongal A,Amatya S,Karkee M,et al. Sensors and systems for fruit detection and localization: A review[J]. Computers and Electronics in Agriculture,2015,116:8-19.
[4] Annamalai P, Lee W S. Identification of green citrus fruits using spectral characteristics[C]//ASABE Paper No. FL04–1001. St. Joseph, Mich: ASABE, 2004.
[5] Safren O,Alchanatis V, Ostrovsky V,et al. Detection of green apples in hyperspectral images of apple–tree foliage using machine vision[J]. Transactions of the ASABE, 2007, 50(6): 2303-2313.
[6] Okamoto H,Lee W S. Green citrus detection using hyperspectral imaging[J]. Computers and Electronics in Agriculture, 2009,66(2): 201-208.
[7] Stajnko D, Lakota M,Ho?evar M. Estimation of number and diameter of apple fruits in an orchard during the growing season by thermal imaging[J]. Computers and Electronics in Agriculture, 2004, 42(1): 31-42.
[8] Wachs J P, Stern H I, Burks T, et al. Low and high–level visual feature–based apple detection from multi–modal images[J]. Precision Agriculture, 2010, 11(6): 717-735.
[9] Rakun J, Stajnko D, Zazula D. Detecting fruits in natural scenes by using spatial-frequency based texture analysis and multiview geometry[J]. Computers and Electronics in Agriculture, 2011, 76(1): 80-88.
[10] Aggelopoulou A D, Bochtis D,F(xiàn)ountas S, et al. Yield prediction in apple orchards based on image processing[J]. Precision Agriculture, 2011, 12(3): 448-456.
[11] Kurtulmus F, Lee W S, Vardar A. Green citrus detection using ‘eigenfruit’, color and circular Gabor texture features under natural outdoor conditions[J]. Computers and Electronics in Agriculture, 2011, 78(2): 140-149.
[12] Chaivivatrakul S, Dailey M N. Texture–based fruit detection[J]. Precision Agriculture, 2014, 15(6): 662-683.
[13] Li H, Lee W S, Wang K. Immature green citrus fruit detection and counting based on fast normalized cross correlation (FNCC) using natural outdoor colour images[J]. Precision Agriculture, 2016, 17(6): 678-697.
[14] Linker R, Cohen O, Naor A. Determination of the number of green apples in RGB images recorded in orchards[J]. Computers and Electronics in Agriculture, 2012, 81: 45-57.
[15] Payne A B, Walsh K B, Subedi P P, et al. Estimation of mango crop yield using image analysis–segmentation method[J]. Computers and Electronics in Agriculture, 2013, 91: 57-64.
[16] Payne A, Walsh K, Subedi P, et al. Estimating mango crop yield using image analysis using fruit at ‘stone hardening’ stage and night time imaging[J]. Computers and Electronics in Agriculture, 2014, 100: 160-167.
[17] Font D, Tresanchez M, Martínez D, et al. Vineyard yield estimation based on the analysis of high resolution images obtained with artificial illumination at night[J]. Sensors, 2015, 15(4): 8284-8301.
[18] Linker R, Kelman E, Cohen O. Estimation of apple orchard yield using night time imaging[M]. Netherlands: Wageningen Academic Publishers, 2015: 568-580.
[19] Linker R. A procedure for estimating the number of green mature apples in night-time orchard images using light distribution and its application to yield estimation[J]. Precision Agriculture, 2017, 18(1): 59-75.
[20] Linker R,Kelman E. Apple detection in nighttime tree images using the geometry of light patches around highlights[J]. Computers and Electronics in Agriculture, 2015, 114: 154-162.
[21] 廉藺,李國輝,王海濤,等. 基于MSER的紅外與可見光圖像關(guān)聯(lián)特征提取算法[J]. 電子與信息學報,2011,33(7):1625-1631. Lian Lin, Li Guohui, Wang Haitao, et al. Corresponding feature extraction algorithm between infrared and visible images using MSER[J]. Journal of Electronics & Information Technology, 2011, 33(7): 1625-1631. (in Chinese with English abstract)
[22] Mikolajczyk K, Tuytelaars T, Schmid C, et al. A comparison of affine region detectors[J]. International Journal of Computer Vision, 2005, 65(1): 43-72.
[23] Fraundorfer F, Bischof H. A novel performance evaluation method of local detectors on non-planar scenes[C]//Computer Vision and Pattern Recognition– Workshops. CVPR Workshops. IEEE Computer Society Conference on. IEEE, 2005: 33.
[24] Grover R, Hwang P Y C. Introduction to random signals and applied Kalman filtering[M]. New York: Willey, 2012.
[25] Matas J, Chum O, Urban M, et al. Robust wide-baseline stereo from maximally stable extremal regions[J]. Image Vision Computing, 2004, 22(10): 761-767.
[26] Mikolajczyk K,Schmid C. A performance evaluation of local descriptors[J]. IEEE Transactions on Pattern Analysis and Machine Intelligence, 2005, 27(10): 1615-1630.
[27] Nistér D, Stewénius H. Linear time maximally stable extremal regions[C]// Computer Vision - ECCV 2008, European Conference on Computer Vision, Marseille, France, 2008:183—196.
[28] Obdr?álek D, Basovník S, Mach L, et al. Detecting scene elements using maximally stable colour regions[C]// International Conference on Research and Education in Robotics. Springer Berlin Heidelberg, 2009: 107-115.
[29] 王志彬,王開義,張水發(fā),等. 基于K-means聚類和橢圓擬合方法的白粉虱計數(shù)算法[J]. 農(nóng)業(yè)工程學報,2014,30(1):105-112. Wang Zhibin,Wang Kaiyi,Zhang Shuifa,et al. Whiteflies counting with K-means clustering and ellipse fitting[J]. Transactions of the Chinese Society of Agricultural Engineering (Transactions of the CSAE), 2014, 30(1): 105-112. (in Chinese with English abstract)
[30] 賀磊盈,蔡麗苑,武傳宇. 基于機器視覺的幼苗自動嫁接參數(shù)提取[J]. 農(nóng)業(yè)工程學報,2013,29(24):190-195. He Leiying, Cai Liyuan, Wu Chuanyu. Vision-based parameters extraction of seedlings for grafting robot[J]. Transactions of the Chinese Society of Agricultural Engineering (Transactions of the CSAE), 2013, 29(24): 190-195. (in Chinese with English abstract)
[31] 盧軍,桑農(nóng). 變化光照下樹上柑橘目標檢測與遮擋輪廓恢復技術(shù)[J]. 農(nóng)業(yè)機械學報,2014,45(4):76-81. Lu Jun, Sang Nong. Detection of citrus fruits within tree canopy and recovery of occlusion contour in variable illumination[J]. Transactions of the Chinese Society for Agricultural Machinery, 2014, 45(4): 76-81. (in Chinese with English abstract)
[32] 陳基偉. 橢圓直接擬合算法研究[J]. 工程勘察,2007(6):49-51. Chen Jiwei. Study on direct fitting algorithm of ellipse[J]. Geotechnical Investigation & Surveying,2007(6): 49-51. (in Chinese with English abstract)
[33] Pothen Z S, Nuske S. Texture-based fruit detection via images using the smooth patterns on the fruit[C]//IEEE International Conference on Robotics and Automation. IEEE, 2016: 5171-5176.
[34] Duda R O. Use of the Hough transform to detect lines and curves in pictures[J]. Commun ACM, 1972, 15: 11.
[35] 李寒,張漫,高宇,等. 溫室綠熟番茄機器視覺檢測方法[J].農(nóng)業(yè)工程學報,2017,33(增刊1):328-334.
Li Han, Zhang Man, Gao Yu, et al. Green ripe tomato detection method based on machine vision in greenhouse[J]. Transactions of the Chinese Society of Agricultural Engineering (Transactions of the CSAE),2017, 33(Supp.1):
328-334. (in Chinese with English abstract)
[36] 陶丹,王崢榮,李光林,等. 基于解模糊算法的蠶蛹圖像恢復及雌雄識別[J]. 農(nóng)業(yè)工程學報,2016,32(16):168-174.Tao Dan, Wang Zhengrong, Li Guanglin, et al. Silkworm pupa image restoration based on aliasing resolving algorithm and identifying male and female[J]. Transactions of the Chinese Society of Agricultural Engineering (Transactions of the CSAE), 2016, 32(16): 168-174. (in Chinese with English abstract)
[37] 李昕,李立君,高自成,等. 改進類圓隨機Hough變換及其在油茶果實遮擋識別中的應用[J]. 農(nóng)業(yè)工程學報,2013,29(1):164-170. Li Xin, Li Lijun, Gao Zicheng, et al. Revised quasi-circular randomized Hough transform and its application in camellia- fruit recognition[J]. Transactions of the Chinese Society of Agricultural Engineering (Transactions of the CSAE), 2013, 29(1): 164-170. (in Chinese with English abstract)
[38] Zhao C, Lee W S, He D. Immature green citrus detection based on colour feature and sum of absolute transformed difference (SATD) using colour images in the citrus grove[J]. Computers and Electronics in Agriculture, 2016, 124: 243-253.
盧 軍,胡秀文. 弱光復雜背景下基于MSER和HCA的樹上綠色柑橘檢測[J]. 農(nóng)業(yè)工程學報,2017,33(19):196-201. doi:10.11975/j.issn.1002-6819.2017.19.025 http://www.tcsae.org
Lu Jun, Hu Xiuwen. Detecting green citrus fruit on trees in low light and complex background based on MSER and HCA [J]. Transactions of the Chinese Society of Agricultural Engineering (Transactions of the CSAE), 2017, 33(19): 196-201. (in Chinese with English abstract) doi:10.11975/j.issn.1002-6819.2017.19.025 http://www.tcsae.org
Detecting green citrus fruit on trees in low light and complex background based on MSER and HCA
Lu Jun1, Hu Xiuwen2
(1.430070,; 2.430070,)
Accurate crop-load estimation is very important for efficient management of nutrients and harvest operations. Current machine vision techniques for crop-load estimation have achieved only limited success mostly due to partial occlusion, shape irregularity, varying illumination and multiple sizes. Detecting immature green fruit is a more challenging task for similar color of fruit and background. The key starting point of this paper for detecting immature citrus fruit was the observation that the light distribution on citrus fruit follows a general pattern in which the light intensity decreases with the distance from a local maximum due to specular reflection. Immature citrus fruit detection was achieved by detecting this pattern with concentric circles or parts of circles. This pattern was proposed with the maximally stable extremal region (MSER) method and validated by hierarchical contour analysis (HCA) which was the first proposed in this paper. The images were captured by a color camera under low natural light conditions with a flashlight, and the green component of the color images was used for further analysis. After smoothing the whole image by Weiner filter, the regions of interest (ROIs) in the image were extracted by the method of MSER. The ROIs detected by MSER were those whose support was nearly the same over a range of thresholds, so the regions on citrus fruit were detected by MSER for the pattern that the light intensity decreases stably and gently with the distance from a local maximum. However, many regions on leaves and background were also detected as ROIs and should be excluded in the next step. A novel algorithmic technique was proposed to remove these regions on background, and this method was named as the HCA. Firstly, shape analysis was used for each ROI and only those ROIs were considered as valid if the shape was nearly circular. Secondly, multiple levels of contours around each valid ROI were extracted and fitted with the circular Hough transform (CHT). Lastly, multiple fitted circles would be merged into one if their most parts were overlapped together, this step was called circle merging and the merged circles were considered as the last detected citrus fruits. The algorithm was tested on a testing dataset with 20 images and achieved the recall rate of 81.2% and the precision rate of 83.5%. The processing time of the proposed method was 3.70 s totally on each image, on average, in which 0.57 s was used for MSER detection and 3.13 s was used for HCA. The result showed that the proposed method can detect green citrus fruit in a very difficult and challenging scene with so many fruits in one image and extensive partial occlusion. The good performance of partial occlusion tolerance of the proposed method in this paper is mainly due to that the proposed HCA doesn’t use the shape of outer contour of fruit, but uses multiple concentric contours which come from the pattern of light intensity distribution on fruit surface. The research framework in this paper can give a novel thought on other green fruit detection besides citrus fruit.
image processing; object recognition; algorithms; hierarchical contour analysis (HCA); maximally stable extremal region (MSER); circular hough transform; immature citrus detection
10.11975/j.issn.1002-6819.2017.19.025
TP391. 41
A
1002-6819(2017)-19-0196-06
2017-06-09
2017-09-19
國家自然科學基金資助項目(34113029)
盧 軍,湖北宜昌人,副教授,博士生,主要從事圖像處理與機器視覺方面的研究。Email:lujun5918@163.com