胡祝華,張逸然,趙瑤池,3※,曹 路,白 勇,黃夢醒
?
權重約束AdaBoost魚眼識別及改進Hough圓變換瞳孔智能測量
胡祝華1,2,張逸然1,趙瑤池1,3※,曹 路1,白 勇1,2,黃夢醒1,2
(1. 海南大學信息科學技術學院,海口 570228;2. 海南大學南海海洋資源利用國家重點實驗室,海口 570228; 3. 天津大學計算機科學與技術學院,天津 330350)
針對傳統魚眼瞳孔直徑測量方法耗時、耗力,且數據主觀性強的問題,該文提出基于權重約束AdaBoost和改進Hough圓變換的魚眼瞳孔直徑智能測量方法。首先,利用工業相機采集實驗板上的魚圖像,從正負魚眼圖像樣本中訓練出基于權重約束AdaBoost算法的魚眼分類器;然后,采用該分類器對試驗圖像進行檢測,將檢測到的魚眼局部圖從整體圖中分離出來;最后,采用改進的Hough圓變換檢測出魚眼的瞳孔,并計算得到瞳孔直徑。對100條金鯧魚進行試驗,魚眼分類精度達97.1%,瞳孔正確檢測率達94.2%,相比改進前分別提升了1.7個百分點和10.5個百分點,與人工測量瞳孔直徑值的平均偏差為6.5%,比改進前低了5.9個百分點,總的平均測量時間為324.371 ms,比改進前減少了10.707 ms。試驗證明:該文提出的方法能夠精確、實時、自動地測量出魚眼瞳孔的直徑,有效避免了傳統測量方式的復雜性和測量數據的主觀性,可為魚體生長狀況評估、良種選育提供重要參考。
水產養殖;圖像處理;測量;魚眼識別;瞳孔;計算機視覺;AdaBoost;改進Hough 圓變換
在智慧和健康水產養殖中,魚體特征參數具有重要的意義[1]。在魚類良種選育、魚的等級、新鮮度分類評價方面,魚的體長、體寬尤其是魚眼瞳孔數據是重要的評判參數。然而,傳統的魚類體征參數的測量方法是在魚體離水的情況下用直尺和游標卡尺等測量工具分步多次測量的,而且為了減少魚類的強烈應激反應,需要先將魚麻醉后再進行測量,這樣不僅耗時、耗力,并且在測量后部分測量活體可能會出現停止進食,甚至無法保活的現象,對魚類的生長和存活都造成了難以逆轉的影響[2-4]。因此,水產養殖者希望能夠實現魚類體征測量的完全自動化、精準化和無接觸化,而使用計算機視覺和圖像處理技術來測量魚的各項體征指標不僅可以實現自動化、無接觸化,還能夠解決人工測量數據主觀性高的問題,很大程度上提高了測量效率和準確度,因此,應用計算機視覺和圖像處理的方法到水產養殖領域是國內外在此方面研究的趨勢。
國內外在利用計算機視覺等技術在魚體提取、體征數據測量和進一步分級、分類方面已開展了一些研究[5]。王文靜等[6]利用計算機視覺技術、聚類法將魚體圖像從背景中分離出來,計算魚體面積,再根據其提出的模型計算出魚體質量。張志強等[7]建立了對應淡水魚的質量預測模型,從而實現對魚按質量進行預測分級。為了實現魚體的自動檢測,通常可以采用的訓練魚體分類器的方法有:AdaBoost訓練法[8]、神經網絡法[9]。Hsieh等[10]基于投影轉換法提出一種簡單有效的金槍魚長度測量方法,將方法應用于漁船甲板上,操作便捷。Jeong等[11]利用傳感器技術,實現了對魚體部分特征指標的測量。Yao等[12]將機器學習算法中的K-均值聚類算法應用于復雜背景下的魚類提取,得到了較好的試驗效果。余心杰等[13]結合機器視覺和稱重傳感器技術,設計了一種可對大黃魚質量、體長和體寬等指標進行自動檢測的系統。Ivorra等[14]結合3D成像和光譜分析技術,實現了對大西洋鯛魚的新鮮度預測。張天時等[2]發明了一種測量臺,用相機拍攝整個測量板,由人工對圖像中魚體對應的臺面刻度進行讀取,再根據縮小倍數換算出圖像上魚的瞳孔直徑的實際長度。
上述研究雖然一定程度上解決了傳統魚體征數據測量效率低下、主觀性高的問題,但大都是針對體長、體寬和質量數據的測量,在魚眼瞳孔測量方面,由于魚眼嵌入在魚體之內,給測量技術提出了較高的要求,目前在魚眼瞳孔測量方面少有研究。文獻[2]可以實現無接觸測量,但是測量方法還是人工測量,同樣存在主觀性強,精度差,人力耗費巨大的問題。受到利用Haar-like特征和AdaBoost算法進行人臉檢測[15-17]和人眼檢測[18-19]的啟發,本文以金鯧魚作為研究對象,提出了一種基于權重約束AdaBoost算法和改進Hough圓變換的魚眼檢測和瞳孔直徑測量方法,以解決魚眼瞳孔直徑測量中耗時、耗力且精度差、效率低的問題。
圖1為定制的圖像采集裝置結構圖,由標準測量盤(平臺底長560 mm ,寬400 mm)和機械臂構成。本文的試驗對象為金鯧魚,所有魚例圖像(彩色JPG格式,4 608×3 456像素)均采集于海南省陵水縣新村鎮鹽墩村海南藍海洋水產養殖有限公司(海南大學海洋學院產學研基地),使用裝有相機(OLYMPUS TG-4,f/2.0,焦距:4 mm,自帶鏡頭畸變校正)的采集裝置對在正常光照下拍攝的金鯧魚圖像進行算法的分析和測試。試驗的硬件環境為:Intel(R) Core(TM) i3-3110M CPU @ 2.40 GHz,4 GB內存;軟件環境為:64位Windows10操作系統,VS2013+ OpenCV3.0編譯套件。

1. 測量盤 2. 固定夾 3. 旋鈕 4. 機械臂 5. 末端執行器
魚例圖像的采集過程為:采集相機固定在機械臂的末端執行器上,并通過數據線與筆記本直接相連,將魚置于測量盤上后,通過調節機械手臂可設置相機位置、高度,使拍攝的畫面正好能夠覆蓋平臺底長,相機鏡頭平行于平臺,且位于魚體的正上方。采集與分析過程如圖2所示。

圖2 魚體圖像采集和分析流程圖
通過圖像采集裝置采集到800張4 608×3 456像素的魚例圖像,700張作為訓練魚眼分類器的樣本,100張用于分類器的驗證和魚眼瞳孔直徑的測量。訓練過程是先從樣本中提取出Haar-like特征值,用改進的基于權重約束的Adboost算法進行訓練,得到魚眼分類器。測量過程中首先對魚例測量圖像提取Haar-like特征,將特征值輸入到AdaBoost分類器中,分割出魚眼部分,然后采用改進的Hough圓變換得到魚眼瞳孔和瞳孔像素直徑,最后將瞳孔像素直徑轉換得到實際直徑。測量方法的流程如圖3所示。

圖3 魚眼瞳孔直徑測量方法流程圖
從原始的魚例圖像(圖4a)中手動截取出魚眼部分,灰度化后作為正樣本,如圖4b所示。將原始的魚例圖像灰度化后等分成若干個小圖像,將這些小圖像中包含魚眼的部分剔除,剩下的作為負樣本集,如圖4c所示。

圖4 魚的原始圖像和正負樣本圖
AdaBoost(adaptive boosting)算法[20]是一種自適應的Boost算法,通過改變同一個訓練集中樣本的權重,得到不同權重下的最優弱分類器,然后將這些弱分類器級聯起來,構成一個強分類。但是在此權重更新機制下,AdaBoost算法在下一輪的弱分類器訓練中重點關注錯分樣本[21]。隨著難以錯誤分類樣本的權重的增大,最后的分類器將會發生退化,導致分類效果很差[22-23]。針對此問題,本文提出權重約束的AdaBoost,對樣本的權重設置了一個約束閾值(式(2)),以限制其增長,改進的AdaBoost算法如下

3)迭代:為指定的迭代次數


4)輸出:強分類器:

采用構建好的魚眼分類器檢測魚眼區域的過程為:對整張魚例測試圖像灰度化,提取Haar-like特征值;利用一個滑動窗口,在整個圖像里滑動,將滑動到的圖像區域的Haar-like特征值輸入到魚眼分類器判斷是否存在魚眼,從而檢測出魚眼矩形區域;并計算矩形區域的內接圓得到魚眼圓形區域,將魚眼分離出來。
2.4.1 魚眼瞳孔檢測
魚眼瞳孔檢測是指:從前述得到的魚眼圓形區域中檢測魚眼瞳孔。魚眼瞳孔近圓形,檢測圓的方法有Hough變換[24-26]和擬合圓方法。由于Hough圓變換對噪聲相對來說不敏感,因此,本文采用該方法。經典Hough圓變換在經過Canny算子提取以及形態學開閉運算過濾、封閉修復[27]后的邊緣上隨機選取3點,再根據圓的方程和三點位置求取圓心和半徑,多次重復取點和計算圓的過程,最終選取圓心密集的位置作為待求圓的圓心。
但是在取點過程中,隨機取的3點必須先判斷是否在同一個圓上,且在不規則圓形中,這3點還可能由于分布緊密而對參數求解造成較大誤差。針對此缺陷,本文對于Hough圓變換中3點的選取方法進行了改進以提高準確度和檢測效率。具體步驟為:1)在前述封閉修復后的邊緣上選取2個點1和2,過這2個點做一條直線12,再過點2做12的垂線,并在此垂線上找第3個點3,即垂線與邊緣的交點。2)若此交點存在,則1、2、3這3個點構成直角三角形RT△123。3)根據直角三角形斜邊中點必為其外接圓圓心的定律,可以得出直線13的中點即為圓心,直線1即為圓的半徑。4)若3不存在,即12的垂線與邊緣無交點,則另選兩點1、2,重復以上步驟,直到找到直角三角形,確定圓心。
由圖5所示,所選取的點1、2和3一定在同一個圓上,因此可以省略判斷3點是否在同一個圓上的步驟;同時這3點不會由于過于密集而造成對參數求解帶來較大的誤差。魚眼瞳孔檢測的過程及結果圖如圖6所示。

圖5 改進Hough圓變換求取直徑原理

圖6 Hough圓變換瞳孔檢測
2.4.2 魚眼瞳孔直徑計算
通過上述步驟檢測到瞳孔,圓心的坐標可以直接通過計算直線13的中點的坐標而求得,圓的直徑,可以通過求直線13的長度而求得,提高了Hough圓檢測的效率。
上述得到魚眼瞳孔直徑為像素距離,實際使用時需轉換為實際距離。圖像采集裝置底長為L,對應采集所得圖像長為L,通過本文前述方法計算得到的瞳孔直徑像素距離記為L,轉換后的瞳孔直徑實際距離L可通過式(4)計算求得。

對700張魚眼的正樣本圖像(24×24像素),2 124張負樣本圖像(284×284像素)進行訓練。分別獲得基于AdaBoost和權重約束AdaBoost的魚眼分類檢測器,對100張金鯧魚圖像進行魚眼分類檢測,檢測的魚眼性能對比如表1所示。由表1可知基于權重約束的AdaBoost算法的魚眼分類檢測器對于魚眼的檢測正確率提高了1.7個百分點,漏檢率下降了1.7個百分點。

表1 傳統AdaBoost和權重約束AdaBoost算法性能對比
部分檢測的效果對比如圖7所示,其中圖7a為基于傳統AdaBoost的魚眼分類器檢測效果,圖7b為基于權重約束AdaBoost的魚眼分類器檢測效果。顯然,基于權重約束AdaBoost的分類檢測器能檢測出魚眼,雖然有些檢測結果沒有將魚眼完整地圈出,但是都能夠將魚眼瞳孔包括進來,在裁切過程中不會被漏掉,便于下一步對瞳孔直徑的測量。圖7c是在圖7b的基礎上采用經典Hough變換得到的瞳孔,采用未改進的方法是無法魯棒地圈出瞳孔區域的;圖7d是在圖7b的基礎上采用改進Hough圓變換得到的瞳孔,由圖7d可知,獲得的結果基本是準確有效的。
對100張金鯧魚圖像完成魚眼分類檢測后,采用基于Hough圓變化的方法對檢測出來的魚眼部分進行瞳孔直徑測量。為了驗證本文方法的有效性和準確性,對試驗素材中金鯧魚魚眼瞳孔直徑進行3次人工測量,并取平均值作為標準數據。人工測量的過程為:首先在魚排上將魚麻醉;然后平放在量魚板上;技術人員用卡尺對魚眼分別進行3次獨立的測量,每次測量不要求快速,但要求盡可能地準確,記錄測量結果。若采用本文方法測量所得數據與標準數據的相對偏差在5%之內,則認為正確檢測。

圖7 改進前后的魚眼檢測對比和瞳孔檢測結果對比
分別對前述檢測到的魚眼進行傳統Hough圓變換和改進后的Hough圓變換,進而計算魚眼瞳孔數據,統計分析結果如表2所示:正確檢測率達到了94.2%,與傳統Hough圓變換相比提高了10.5個百分點,漏檢率下降了5.8個百分點,誤檢率降低了4.7個百分點。因此,改進后的Hough圓變換能夠更加準確、快速地找到魚眼瞳孔的位置,從而提高了算法的性能。

表2 傳統Hough圓變換和改進Hough圓變換測量性能對比
與人工測量的直徑進行比較,由圖8可知,改進前的經典Hough變換的相對偏差均值為12.4%;而改進后的Hough圓變換測量的魚眼瞳孔直徑相對偏差的均值為6.5%,可知改進后的方法與人工測量的標準數據更加吻合,測量精度比改進前高出了5.9個百分點。算法測得的魚眼瞳孔直徑是有效可靠的,本文算法較為穩定,精度較高。

圖8 魚眼瞳孔直徑測量數據比較和相對偏差比較
另外,基于Hough圓變換的瞳孔檢測會在一定程度上依賴于魚眼區域質量,即通過分類器得到的魚眼的區域的效果將會影響到后續的Hough圓變換,如果魚眼區域效果較差,將造成后續canny算子邊緣提取時存在較多的干擾邊緣,影響到魚眼瞳孔的檢測。下一步的工作將考慮增加改進Hough圓變換的魯棒性,對測量瞳孔直徑的方法進行優化,達到更加精準的測量。
分別對100張試驗圖像利用改進后的算法以及原始算法進行計算測量,記錄經過圖像預處理、魚眼檢測、魚眼瞳孔直徑測量所需的時間,如圖9所示。本文所提出的魚眼檢測與瞳孔直徑測量方法平均耗時為324.371 ms,原始算法下的平均耗時為335.075 7 ms,本文所提出的改進方法可以節省10.707 ms,完全可達到實時測量的要求。

圖9 改進和經典Hough圓變換的消耗時間對比
以金鯧魚為研究對象,對拍攝到的魚例圖像提取Harr-like特征值,并用權重約束Adaboost算法訓練出魚眼檢測分類器;利用分類器從魚例圖像中檢測到魚眼區域,利用改進的Hough變換檢測瞳孔,并計算出實際直徑。采用該分類器對100條金鯧魚例圖像進行檢測得到魚眼區域,魚眼分類器的正確檢測率達到了97.1%。采用改進Hough圓變換方法能更準確、快速地從魚眼區域中檢測出瞳孔,進而計算瞳孔直徑。其正確檢測率達到了94.2%,與傳統Hough圓變換相比提高了10.5個百分點,漏檢率下降了5.8個百分點,誤檢率降低了4.7個百分點,檢測時間下降了10.707 ms。
參照人工測量的標準數據,本文提出方法所測得數據的相對偏差的平均值為6.5%;利用本文方法測量的平均時間為324.371 ms,遠小于人工測量時間,也比改進前的方法所用時間更少。研究結果表明,本文所提出的魚眼瞳孔直徑測量方法具有穩定性好、測量精度高、速度快的特點,能夠有效解決魚眼檢測效率低、數據主觀性高的問題,從而可實現實時、大批量的魚眼檢測和瞳孔直徑測量。
[1] 胡祝華,曹路,張逸然,等. 基于圖像處理和線性擬合的魚體尾柄測量方法研究[J]. 漁業現代化,2017,44(2):43-49. Hu Zhuhua, Cao Lu, Zhang Yiran, et al. Study on fish caudal peduncle measuring method based on image processing and linear fitting[J]. Fishery Modernization, 2017, 44(2): 43-49. (in Chinese with English abstract)
[2] 張天時,梁興明,李素紅. 一種快速測量魚體生長性狀的裝置:CN203323799U [P]. 2013-10-09.
[3] 段延娥,李道亮,李振波,等. 基于計算機視覺的水產動物視覺特征測量研究綜述[J]. 農業工程學報,2015,31(15):1-11. Duan Yan’e, Li Daoliang, Li Zhenbo, et al. Review on visual characteristic measurement research of aquatic animals based on computer vision[J]. Transactions of the Chinese Society of Agricultural Engineering (Transactions of the CSAE), 2015, 31(15): 1-11. (in Chinese with English abstract)
[4] 范興. 麻醉對羅非魚和金鯧魚離水保活的影響[D]. 南寧:廣西大學,2014. Fan Xing. Effect of Anesthetic on Transporting Live Tilapia and Golden Pompano Without Water[D]. Nanning: Guangxi University, 2014. (in Chinese with English abstract)
[5] 徐建瑜,崔紹榮,苗香雯,等. 計算機視覺技術在水產養殖中的應用與展望[J]. 農業工程學報,2005,21(8):174-178. Xu Jianyu, Cui Shaorong, Miao Xiangwen, et al. Application and prospect of computer vision technology in aquacul-ture [J]. Transactions of the Chinese Society of Agricultural Engineering (Transactions of the CSAE), 2005, 21(8): 174-178. (in Chinese with English abstract)
[6] 王文靜,徐建瑜,呂志敏,等. 基于機器視覺的水下鲆鰈魚類質量估計[J]. 農業工程學報,2012,28(16):153-157. Wang Wenjing, Xu Jianyu, Lü Zhimin, et al. Weight estimation of underwater cynoglossus semilaevis based on machine vision[J]. Transactions of the Chinese Society of Agricultural Engineering (Transactions of the CSAE), 2012, 28(16): 153-157. (in Chinese with English abstract)
[7] 張志強,牛智有,趙思明,等. 基于機器視覺技術的淡水魚質量分級[J]. 農業工程學報,2011,27(2):350-354. Zhang Zhiqiang, Niu Zhiyou, Zhao Siming, et al. Weight grading of freshwater fish based on computer vision[J]. Tran-sactions of the Chinese Society of Agricultural Engineering (Transactions of the CSAE), 2011, 27(2): 350-354. (in Chinese with English abstract)
[8] Benson B, Cho J, Goshorn D, et al. Field Programmable Gate Array (FPGA) Based Fish Detection Using Haar Classi-fiers[M]. Atlanta: American Academy of Underwater Sciences, 2009.
[9] Alsmadi M K, Omar K B, Noah S A, et al. Fish recognition based on robust features extraction from size and shape measurements using neural network[J]. Journal of Computer Science, 2010, 6(10):1059-1065.
[10] Hsieh C L, Chang H Y, Chen F H, et al. A simple and effective digital imaging approach for tuna fish length me-asur-ement compatible with fishing operations [J]. Computers & Electronics in Agriculture, 2011, 75(1): 44-51.
[11] Jeong S J, Yang Y S, Lee K, et al. Vision-based automatic system for non-contact measurement of morphometric char-acteristics of flatfish [J]. Journal of Electrical Engine-ering & Technology, 2013, 8(5): 1194-1201.
[12] Yao H, Duan Q, Li D, et al. An improved K-means clustering algorithm for fish image segmentation [J]. Mathematical and Computer Modelling, 2013, 58(3): 790-798.
[13] 余心杰,吳雄飛,王建平,等. 基于機器視覺的大黃魚形態參數快速檢測方法[J]. 集成技術,2014(5):45-51.Yu Xinjie, Wu Xiongfei, Wang Jianping, et al. Rapid detecting method for Pseudosciaena Crocea Morphological parameters based on the machine vision[J]. Journal of Integration Technology, 2014(5): 45-51. (in Chinese with English abstract)
[14] Ivorra E, Verdu S, Sánchez A J, et al. Predicting gilthead sea bream (sparus aurata) freshness by a novel combined tech-nique of 3D imaging and SW-NIR spectral analysis[J]. Sensors, 2016, 16(10): 1735.
[15] 龍伶敏. 基于Adaboost的人臉檢測方法及眼睛定位算法研究[D]. 成都:電子科技大學,2008.
Long Lingmin. Face detection method and eye location algorithm based on Adaboost [D]. Chengdu: University of Electronic Science and Technology of China, 2008. (in Chinese with English abstract)
[16] 王海川,張立明. 一種新的Adaboost快速訓練算法[J]. 復旦學報(自然科學版),2004,43(1):27-33. Wang Haichuan, Zhang Liming. A novel fast training algori-thm for Adaboost[J]. Journal of Fudan University (Natural Science), 2004, 43(1): 27-33. (in Chinese with English abstract)
[17] 武勃,黃暢,艾海舟,等. 基于連續Adaboost算法的多視角人臉檢測[J]. 計算機研究與發展,2005,42(9):1612-1621. Wu Bo, Huang Chang, Ai Haizhou, et al. A multi-view face detection based on real Adaboost algorithm[J]. Journal of Computer Research and Development, 2005, 42(9): 1612-1621. (in Chinese with English abstract)
[18] 徐來,周德龍. 人眼檢測技術的方法研究[J]. 計算機系統應用,2010,19(6):226-232. Xu Lai, Zhou Delong. Technology of human eyes detec-tion[J]. Computer Systems & Applications, 2010, 19(6): 226-232. (in Chinese with English abstract)
[19] 甘玲,朱江,苗東. 擴展Haar特征檢測人眼的方法[J]. 電子科技大學學報,2010,39(2):247-250. Gan Ling, Zhu Jiang, Miao Dong. Application of the ex-pansion Haar features in eye detection[J]. Journal of Univ-ersity of Electronic Science and Technology of China, 2010, 39(2): 247-250. (in Chinese with English abstract)
[20] Freund Y, Schapire R E. Experiments with a new boosting algorithm [C]//In Proceedings of the 13th Conference on Machine Learning, Morgan Kaufmann. USA, 1996, 148-156.
[21] 詹文田,何東健,史世蓮. 基于Adaboost算法的田間獼猴桃識別方法[J]. 農業工程學報,2013,29(23):140-146.
Zhan Wentian, He Dongjian, Shi Shilian. Recognition of kiwifruit in field based on Adaboost algorithm [J]. Transactions of the Chinese Society of Agricultural Engineering (Transactions of the CSAE), 2013, 29(23): 140-146. (in Chinese with English abstract)
[22] 郭喬進,李立斌,李寧. 一種用于不平衡數據分類的改進AdaBoost算法[J]. 計算機工程與應用,2008,44(21):217-221.
Guo Qiaojin, Li Libin, LI Ning. Novel modified AdaBoost algorithm for imbalanced data classification [J]. Computer Engineering and Applications, 2008, 44(21) : 217-221. (in Chinese with English abstract)
[23] Lienhart R, Kuranov A, Pisarevsky V. Empirical analysis of detection cascades of boosted classifiers for rapid object detection [C]// Proceedings of the 25th German Pattern Recognition Sysposium. Magdeburg, 2003, 297-304.
[24] Hough P V C. Method and means for recognizing complex patterns: 3069654 [P]. 1962-03-25.
[25] 孫亦南,劉偉軍,王越超. 一種用于圓檢測的改進Hough變換方法[J]. 計算機工程與應用,2003,39(20):35-37. Sun Yinan, Liu Weijun, Wang Yuechao. A method for circle detection using modified Hough transform[J]. Computer Systems & Applications, 2003, 39(20): 35-37. (in Chinese with English abstract)
[26] 馬翠花,張學平,李育濤,等. 基于顯著性檢測與改進Hough變換方法識別未成熟番茄[J]. 農業工程學報,2016,32(14):219-226. Ma Cuihua, Zhang Xueping, Li Yutao, et al. Identification of immature tomatoes base on salient region detection and improved Hough transform method[J].Transactions of the Chinese Society of Agricultural Engineering (Transactions of the CSAE), 2016, 32(14): 219-226. (in Chinese with English abstract)
[27] 吳露露,馬旭,齊龍,等. 改進Hough變換的農作物病斑目標檢測方法[J]. 農業工程學報,2014,30(10):152-159. Wu Lulu, Ma Xu, Qi Long, et al. A method of target detection for crop disease spots by improved Hough transform[J]. Transactions of the Chinese Society of Agricul-tural Engineering (Transactions of the CSAE), 2014, 30(10): 152-159. (in Chinese with English abstract)
胡祝華,張逸然,趙瑤池,曹 路,白 勇,黃夢醒.權重約束AdaBoost魚眼識別及改進Hough圓變換瞳孔智能測量[J]. 農業工程學報,2017,33(23):226-232. doi:10.11975/j.issn.1002-6819.2017.23.029 http://www.tcsae.org
Hu Zhuhua, Zhang Yiran, Zhao Yaochi, Cao Lu, Bai Yong, Huang Mengxing. Fish eye recognition based on weighted constraint AdaBoost and pupil diameter automatic measurement with improved Hough circle transform[J]. Transactions of the Chinese Society of Agricultural Engineering (Transactions of the CSAE), 2017, 33(23): 226-232. (in Chinese with English abstract) doi:10.11975/j.issn.1002-6819.2017.23.029 http://www.tcsae.org
Fish eye recognition based on weighted constraint AdaBoost and pupil diameter automatic measurement with improved Hough circle transform
Hu Zhuhua1,2, Zhang Yiran1, Zhao Yaochi1,3※, Cao Lu1, Bai Yong1,2, Huang Mengxing1,2
(1.570228,; 2.570228,; 3.330350,)
In aquaculture, fisheye pupil diameters are important for the assessment of the growth of fish, which provide reference for later breeding and selection. Since fisheye pupil is embedded in the body of fish, it is harder to measure the diameter of fisheye pupil than measure body length, width and tail length. Traditional measurement of fish eye diameter in aquaculture, which is direct touching of the fish body using measuring tools, has low efficiency as well as high subjectivity since it is only based on manual work. Considering the above factors, we introduce computer vision and machine learning to the measurement of fisheye pupil diameters. An improved AdaBoost algorithm based on weighted constraint is proposed in this paper, which is used in fisheye classifier training; and an improved Hough circle transform is put forward to achieve real-time fish eye pupil diameter measurement. Firstly, in natural light conditions, fishes are placed on the base plate of a customized measuring device and are photographed using CCD (charge-coupled device) installed in the device, in which the distance between base plate and the CCD is fixed. Secondly, the Haar-like features in fish images are extracted and used to train a classifier with the improved Adaboost algorithm to distinguish whether some region is fish eye or not. The improved Adaboost algorithm is proposed based on weighted constraint, in which the weight value does not change only according to error rate but is limited by the weight value constraint. With the trained classifier of fish eye, the whole region of fish image is scanned, and fish eye region can be detected and then separated from the full image. Thirdly, the edges in the fish eye region are obtained with canny operator; noise and interference are filtered to some extent using morphologic transform. Then, we use an improved Hough circle transformation method, proposed in this paper, to circle the fish eye pupil and get its diameter. In the processing of finding a circle, 3 points are selected randomly in traditional Hough circle transform to construct a circle, while in the improved Hough circle transform proposed in this paper, the position of the 3rd point is fixed relying on the 1st and 2nd point, avoiding the problem of parameters error caused by random points. Finally, the diameter of fish eye pupil can be calculated using the conversion ratio between pixel diameter and real diameter. To validate the feasibility of the proposed method, we compare the measured data obtained by our method with the already-known standard reference data obtained from manual measurement. If the relative deviation is less than or equal to 5%, the result is considered correct. The experimental results show that the accuracy has reached 94.2% and the average relative deviation is 6.5%, which prove the validity of the data obtained by our method. In addition, the average measuring time is 324.371 ms, which is shortened significantly, compared with that of artificial measurement. Hence, the method proposed in this paper can measure the diameter of fish eye pupil timely and accurately, and reduce the complexity of traditional methods and the subjectivity of measured data. Furthermore, the method can also prevent the situation that fishes are harmed or even killed during the measurement process and require no more manual work.
aquaculture; image processing; measurement; fish eye recognition; pupil; computer vision; AdaBoost; improved Hough circle transform
10.11975/j.issn.1002-6819.2017.23.029
TP301.6
A
1002-6819(2017)-23-0226-07
2017-06-01
2017-11-26
海南省重大科技計劃項目(ZDKJ2016015);海南省自然科學基金資助項目(617033);海南大學南海海洋資源利用國家重點實驗室開放項目子課題(2016013B);海南大學南海海洋資源利用國家重點實驗室導向課題(DX2017012)
胡祝華,男,湖南桃江人,博士研究生,副教授,主要從事智慧農業、圖像處理與計算機視覺的研究。Email:eagler_hu@hainu.edu.cn
趙瑤池,女,湖南湘潭人,副教授,主要從事圖像處理與計算機視覺的研究。Email:yaochizi@163.com