周楚洋臺灣大學:生物產業機電工程學研究所陳立恩Chen, Li-EnLi-EnChen2010-05-052018-07-102010-05-052018-07-102008U0001-0601200802534000http://ntur.lib.ntu.edu.tw//handle/246246/180173為達到豬舍自動除糞之目的,本研究發展了一套電腦視覺定位系統,針對模擬豬舍影像進行準確的豬糞定位。首先建構一組模擬豬舍,其中包括模擬豬隻與模擬豬糞。其次建立一套調光取像系統,包含攝影機、調光器、白光燈泡、光照度感測器及光度計等。攝影機架設於模擬豬舍上方,藉由調光器改變環境光照度,以攝影機擷取模擬豬舍上視影像,並進行電腦視覺定位系統的辨識效果試驗。試驗時使用9種分布型態、5種光照度,共計45種環境條件進行取像。影像經由電腦視覺定位系統進行物體辨識與定位紀錄,系統使用的初始化參數,分別為外接矩形範圍、密集度範圍、使用者「自定義遮罩範圍」及梯度門檻值。辨識效果試驗於45種環境條件下進行取像,而辨識與定位過程中,使用10種梯度門檻值,試驗總次數共計450次,並於每次辨識試驗完後,記錄該光照度與梯度門檻值下的辨識效果。辨識效果使用兩種指標,分別為漏判率與誤判率。實驗數據以X軸為環境光照度、Y軸為梯度門檻值、Z軸為漏判率(或誤判率),繪出各分布型態條件下的漏判率及誤判率的三維曲面圖及曲面上視圖,探討最佳辨識效果所需的環境光照度與梯度門檻值。結果顯示電腦視覺定位系統於環境光照度為500 lux、梯度門檻值為40時,可達到平均漏判率4.57%、平均誤判率8.21%的最佳辨識效果。而除了「散佈豬群、群聚糞便」、「聚散豬群、群聚糞便」及「群聚豬群、群聚糞便」三種分布狀態外,系統漏判率與誤判率皆小於10%。In order to achieve the automatic manure removal in pig pens, a computer vision system was developed to accurately position the simulated manures thru the camera image of the simulated pig pen in this study. The simulated pig pen including simulated pigs and simulated manures was constructed. An image acquiring system, including camera, dimmer, incandescent lamp, photometric sensor and photometer was set up for testing the computer vision system. The top view image was taken by the camera mounted on top of the simulated pig pen while the ambient luminosity was adjusted by using the dimmer. In experimental design, 9 different distribution patterns and 5 levels of luminosity, totally 45 conditions were tested for evaluating the positioning efficiency of the system. The parameters used in tests include the minimum enclosing rectangle (MER), density, self-defined mask and the gradient threshold value. The image was acquired at the previous 45 different conditions, and there were 10 gradient threshold levels for each condition, thereafter 450 tests were conducted in this study. Two indices of positioning efficiency, error rate and missing rate, were recorded for each test. These data were presented by drawing the three-dimension curved surfaces and their top views by using the luminosity as the x-axis, the gradient threshold value as the y-axis and the missing rate (or error rate) as the z-axis. The optimal condition was then investigated through the above three-dimension drawings. Experimental results showed that the optimal recognizing effect of 4.57% of average missing rate and 8.21% of average error rate was achieved under the condition of 500 lux of luminosity and gradient threshold value of 40. Also, except the three distribution patterns - “scattered pigs, clustered manures”, “randomized pigs, clustered manures” and “clustered pigs, clustered manures”, the missing rate and error rate of the system were all less than 10%.誌謝 i文摘要 iiBSTRACT iii錄 v目錄 vii目錄 xi一章 前言與研究目的 1-1 前言 1-2 研究目的 2二章 文獻探討 3-1 固體豬糞收集系統 3-2畜牧影像處理技術 5-2-1 灰階化(Gray-Level Transformation) 5-2-2 二值化(Binarize) 6-2-3 邊緣偵測(Edge Detection) 6-2-4中值濾波器(Median Filter) 9-2-5 形態學處理(Morphology) 9-2-6 連通物件標記法(Component Connection Labeling ) 9-3 電腦視覺於養豬產業之應用 10-3-1 電腦視覺於豬隻行為監控 10-3-2 電腦視覺用於豬隻體重估算 12-3-3 電腦視覺用於豬場自動化清潔 14三章 材料與方法 15-1 實驗設備 15-1-1 硬體設備 15-1-2 軟體設備 16-1-3 實驗材料 16-2 調光取像系統 17-3 電腦視覺定位系統 18-3-1 影像前處理 19-3-2連通物件的辨識與定位 20-4 模擬豬隻與模擬豬糞的分布型態 24-5 辨識效果實驗流程 25四章 實驗結果與討論 27-1 散佈豬群與散佈豬糞之辨識效果實驗 27-2 群聚豬群與散佈豬糞之辨識效果實驗 33-3 聚散豬群與散佈豬糞之辨識效果實驗 39-4 散佈豬群與群聚豬糞之辨識效果實驗 45-5 群聚豬群與群聚豬糞之辨識效果實驗 51-6 聚散豬群與群聚豬糞之辨識效果實驗 57-7 散佈豬群與聚散豬糞之辨識效果實驗 63-8 群聚豬群與聚散豬糞之辨識效果實驗 69-9 聚散豬群與聚散豬糞之辨識效果實驗 75-10 平均漏判率與平均誤判率 81-11實際豬場之辨識效果實驗 89五章 結論與建議 95-1 結論 95-2 建議 97考文獻 98錄 100錄一 使用設備規格表 101application/pdf1255792 bytesapplication/pdfen-US模擬豬舍豬舍集糞電腦視覺影像處理simulated pig penmanure collectioncomputer visionimage processing應用電腦視覺於模擬豬舍中豬糞之辨識與定位Recognizing and Positioning of the Pig Manure in a Simulated Pig Pen by Computer Visionthesishttp://ntur.lib.ntu.edu.tw/bitstream/246246/180173/1/ntu-97-R93631015-1.pdf