自行式割草機的傳動部件、罩殼部件設計含19張CAD圖帶開題
自行式割草機的傳動部件、罩殼部件設計含19張CAD圖帶開題,自行,割草機,傳動,部件,罩殼,設計,19,cad,開題
Computers and electronics in agriculture
36 (2002) 215 -223
Computer vision based system for apple surface defect detection
Qingzhong Lia, Maohua Wangb, Corresponding author
E-mail address: mhw@public.bta.net.cn (M. Wang).
0168-1699/02/$ - see front matter ? 2002 Elsevier Science B.V. All rights reserved. PII: S0168- 1 699(02)00093-5
, Weikang Gua
11 Department of Information and Electronic Engineering, Zhejiang University, Hangzhou, People's Republic
of China
b Research Centre for Precision Agriculture, China Agricultural University, Beijing, People's Republic
of China
Abstract
A novel automated apple surface defect sorting experimental system based on computer image technology has been developed. The hardware system has the advantage of being able to inspect simultaneously four sides of each apple on the sorting line. The methods, including image background removal, defects segmentation and identification for stem-end and calyx areas, were developed. The results show that the experimental hardware system is practical and feasible,and that the proposed algorithm of defect detection is effective.
? 2002 Elsevier Science B.V. All rights reserved.
Keywords: Machine vision; Apple; Surface defect
1. Introduction
China is a large agricultural country. Its annual apple production is over 17 million tons. Much of the sorting and grading process, however, is still not automated. Hand inspection of fruit is tedious and can cause eye fatigue; it is also subject to sorting errors due to different judgment by different persons. Although some quality inspection procedures such as color, size, and shape are performed by automated systems in western countries, the automation of the defect sorting process is still a challenging subject due to the complexity of the problem. Currently there are two main problems blocking the implementation of automatic apple grading. One is how to acquire the whole surface image of an apple by cameras at an on-line speed. The other is how to quickly identify the stem and calyx. To solve the first problem, Growe and Delwiche (1996), Tao (1996) used a roller conveyer system. The drawback of this method was that the camera above the conveyor cannot inspect the two end sides of the horizontal axes of the rolling fruits. For the second problem, Throop et al. (1997) developed two kinds of orienting devices. These devices were used to rotate apples of different varieties along the stem—calyx axes. But the results showed that the varieties that were successfully oriented with one system would not orient using the other device. Yang (1993) used structured lighting to identify the stem and calyx of apples. The major problem with the structured lighting is the misclassification of laser lines on the image. Wen aad Tao (1998) successfully developed a dual-camera NIR/MIR imaging method for apple defect recognition and stem-calyx identification. But the MIR camera is too expensive to use in China.
The objective of the work described in this paper was to develop an experimental system that can inspect four sides of each apple,simultaneously, at on-line throughput (over three to four fruits per s) and the corresponding methods for effective defects segmentation and recognition.
2. System setup overview
A system capable of inspecting four directions of each apple at on-line throughput was developed. The setup of the system is shown in Fig. 1. It consisted of a feeding unit,an apple uniform spacing unit,a machine vision system,and a sorting conveyor. The basic feeding conveyor transported the apples to the uniform spacing conveyor. Then, the apples were fed to the machine vision system for the defect
inspection. Finally,the automatic sorting unit accomplished the apple grading operation.
The machine vision system included a cup type conveyor, a lighting chamber for the desired spectrum and light distribution for fruit illumination, two cameras, and an image grabbing card with four input channels inserted in a microcomputer (processor speed: 500 MHz). . As an experimental system, the fruit-feeding system and the automatic sorting system were not constructed in the first stage of the research.
To achieve a basically complete inspection of apples on the fruit sorting line,two identical monochromatic cameras were mounted above and below the conveyor, respectively. The setup of the vision system is shown in Fig. 2. The image sensors in the cameras had an actual resolution of 580 horizontal and 350 vertical TV lines. Each camera was synchronized to another timing source and had a variable electronic shutter. Identical 8.5 mm focal length C-mount lenses were attached to the cameras,with interference band-pass optical filters (840 nm) attached to the outside of each lens. The conveyor was composed of fruit cups without bottoms as shown in Fig. 2. Two mirrors were fixed on both sides of the conveyor; thus the camera above the conveyor took three side views of an apple, i.e. top and two sides. The camera below the conveyor took a bottom view of the fruit. Moreover, this imaging system was able to inspect several apples on the conveyor simultaneously. This scheme had the advantage of being able to inspect simultaneously four sides of each apple while it was traveling on the conveyor.
3. Algorithm description
The algorithm developed for the surface defect detection mainly included modules of image preprocessing, defect segmentation, stem-calyx recognition, and defect area calculation and grading. The algorithm is shown schematically in Fig. 3.
3.1. Image background removal through a method of subtraction
The image backgrounds in the mirror and on the conveyor were different, so it was impossible to segment the parts of fruit by a simple threshold process. Therefore, a subtracting method was used, as depicted below:
where g(x, y) is the image after its background has been removed, f(x, y)is the original image, b(x, y) is the background image, and T is the threshold..
3.2 Defects segmentation by using reference apple images
Apples under inspection had substantially spherical shapes, resulting in curved distributed image intensity. This curved distribution caused the intensity values of the normal surface near the boundary to be lower than the intensity of the defect patches on the surface of the fruit. It is difficult to use any simple global threshold segmentation algorithm for defect extraction. Local adaptive methods could be used for defect segment extraction. However, the processing time prevents their practical use in real-time fruit sorting operations. Based on the reference image of an apple, Li and Wang (1999) developed a method to accomplish defect segmentation for a curved fruit image. In this method, a reference fruit image (RFI) was generated first and the original fruit image for inspection was then normalized to achieve the normalized reference fruit image (NRFI). Finally by subtracting normalized original fruit image (NOFI) from the NRFI and then by simple threshold processing, the defects could be extracted easily.
3.3 Stem—calyx identification based on fractal features and artificial neural network
During the defect inspection process, it is difficult to distinguish the stem and calyx from true defects,because they are similar to defective spots in the image. Based on fractal dimensions and neural networks (NN), the authors of this paper developed a novel method to distinguish the stem-calyx concave area from true defects.
Fractal is a term used to describe the shape and appearance of the objects, which have the properties of self-similarity and . scale invariance. Fractal dimension is a scale independent measure of the degree of surface roughness or boundary irregularity. Although the intensity of stem-calyx and true defects are similar, their fractal features may be different. Moreover,fractal analysis in the frequency domain only depends on the frequency distribution of the image surface. These fractal textural features would be independent of the variation of ambient light intensity and orientation of the apples being sorted. So this method is suitable for apple sorting operations where apples are in random orientations. The image distribution can be regarded as a three-dimensional curved surface. Based on the above consideration, five fractal dimensions including one traditional fractal dimension and four oriented fractal dimensions were selected as the features of the image spots produced by stem-calyx concave area or true defects. The four oriented fractal dimensions (D1, D12, D3, D4) are shown in Fig. 4. In fact,the oriented fractal dimensions were the fractal dimensions of the curves in the corresponding directions (Fig. 5). The five fractal dimensions are calculated by the method derived by Li and Wang (2000). The digital image can be depicted as: Z=f(x, y), where (x,y) is the coordinates of a pixel; Z is the gray value. Assuming the area of the image is M x M the x-y plane of the image is divided into grids with area δ×δ. The maximum and the minimum of gray values in the grid are expressed as uδ(i,j) and bδ(i,j),respectively. And their difference is dδ= uδ(i,j)- bδ(i,j).Then the total nonempty box number (Nδ) for all the δ×δ grids is calculated as:
For all the given δ a data set from a series of points log δ, log Nδ can be obtained. Through linear regression of the points (log δ, log Nδ), the minus slope of the regression line gives the estimated fractal dimension. The four oriented dimensions can be estimated by using a similar method.
A feedforward backpropagation (BP) NN algorithm was used to classify stem- calyx from true defect areas. The feedforward network structure was suitable for handling nonlinear relationships between input and output variables of prediction-
D4 D3 D2
related problems. The designed BP network is shown in Fig. 6. The NN model had five input nodes, one hidden layer with four hidden nodes,and one output node. During the training process, the weights of the network were updated after each pass through all the training samples. The convergence of the learning was judged by two conditions: whether the mean squared error for all training samples were smaller than a tolerance value, and whether the output errors for each training sample were smaller than another predefined tolerance value
Fig. 5. Oriented fractal curve. Hidden layer
3.4 Real-time implementation of apple surface defect detection
The real-time implementation of apple surface defect detection is divided into two stages. The first is the segmentation of doubtful spot areas, including defects and stem-calyx areas,by the method described in Section 3.2. The segmentation results show that the stem-calyx areas are often with bigger areas. So in the second stage, the segmented spots with areas bigger than a given value are further processed for distinguishing stem-calyx concave areas from defects by the method presented in Section 3.3.
4 Tests and results
The algorithm was used to detect defects and stem-calyx areas in forty samples of Fuji apples. Some results are shown in Fig. 7,where (a), (c) , (e), and (g) are the
(a) (b) (c) (d)
(e) (f) (g) (h)
Fig. 7. Defects segmentation results. (a)} (c), (e), (g) Original image; (b), (c), (f), (h) segmented defects.
original image of the apples to be inspected, and (b), (d),(f),and (h) are the defect segmentation results. These results show that the defects and stem—calyx areas were basically extracted. The segmented spots with area bigger than a given value were further processed for distinguishing stem-calyx concave area from defects by the method in Section 3.3. Table 1 lists some results of the stem-calyx recognition by the BP network. If the output value of the network is near 1,the detected patch is the stem-calyx area. Similarly, if the output value is near 0,the detected patch is a true defect area. The test results show that the accuracy of the network classifier was over 93%. The Number 16 and 23 defect patches in Table 1 were rotten areas and the degree of rot was so high that their surfaces were concave. The results show that the input fractal features are effective for classifying concave surfaces from normal fruit surfaces. Because the stem-calyx patches are usually concave in shape, the proposed method for stem-calyx recognition is feasible. The processing time for the defect detection and grading for one apple was 320 ms with microcomputer (processor speed: 500 MHz)
5.Conclusions
The results show that the input fractal features are effective for classifying concave surfaces from the normal fruit surfaces. Because the stem-calyx particles are usually concave in shape the proposed method for stem-calyx recognition is feasible.
The system has the advantage of being able to inspect, simultaneously, four aspects of each apple on a sorting line. Furthermore, based on the reference image of an apple, the developed method of defect segmentation can extract most of the surface defects on apples at a speed commensurate with the requirements of a practical grading system,which is the objective of further research.
Acknowledgements
It is gratefully acknowledged that this work is supported under University Doctoral Course Special Fund (Project No. 950801).
References
Growe,T.G., Delwiche, M.J., 1996. Real-time defect detection in fruit—part I: design concepts and development of prototype hardware. Trans. ASAE 39 (6) ,2299—2308.
Li, Q. ,Wang, M. ,1999. Study on high-speed apple surface defect segment algorithm based on computer vision. Proceedings of International Conference on Agricultural Engineering (99-ICAE) ,Beijing, People’s Republic of China, 14-17 December 1999,pp. V27-31.
Li, Q., Wang, M., 2000. A fast identification method for fruit surface defect based on fractal characters. J.Image Graphics (China) 5 (2) ,144-148
Tao, Y. ,1996. Spherical transform of fruit images for on-line defect extraction of mass objects. Opt. Eng. 35 (2), 344-350.
Throop, J.A. ,Aneshansley, D.J., Upchurch, B.L. ,1997. Apple orientation on automatic sorting equipment. Proceedings of the Sensors for Nondestructive Testing International Conference, NRAES, Ithaca,NY, pp. 328-342.
Yang, Q. ,1993. Finding stalk and calyx of apples using structured lighting. Comput. Electron. Agric. 8, 31-42.
Wen, Z. ,Tao,Y. ,1998. Method of dual-camera NIR/MIR image for fruit sorting. ASAE paper 983043. St. Joseph, MI.
基于計算機視覺系統(tǒng)對蘋果表面的缺陷探測
Qingzhong Lia, Maohua Wangb,
, Weikang Gua
Department of Information and Electronic Engineering,Zhejiang University,Hangzhou, People's Republic of China
Research Centre for Precision Agriculture, China Agricultural University, Beijing, People's Republic of China
摘要:一種基于計算機圖像處理,對蘋果表面缺陷進行探測的視覺技術得到發(fā)展。 硬件系統(tǒng)能同時檢查分類線上每個蘋果的四邊。其方法包括圖像的背景移除,缺 陷的分類,莖和花萼的辨別。實驗結果表示其系統(tǒng)是實際可行的,探測表面缺陷 的運算法則也被證明是有效的。? 2002 Elsevier Science B.V版權所有。
關鍵詞:計算機視覺系統(tǒng),蘋果,表面探測
1.緒論
中國是一個農(nóng)業(yè)大國,其一季的蘋果產(chǎn)量達到1700萬噸,但是其等級分 類并沒有實現(xiàn)自動化。人工檢查是非常乏味的,而且會引起視覺疲勞。另外, 每個人判別標準各不相同。盡管,在一些西方國家可以通過計算機自動檢查 水果的質量,如:顏色,尺寸和外形,但由于環(huán)境的復雜性其自動控制方法 還是具有一定的挑戰(zhàn)性。一般蘋果的自動分級有兩個主要問題:一是怎樣通 過照相機及時獲得蘋果的完整圖像,二是如何快速辨別莖和花萼。為解決第 一個問題,Growe and Delwiche (1996), Tao (1996)使用了一種滾軸運輸系統(tǒng)。這 種方法的缺點是運送裝置上方的照相機不能同時檢查旋轉中蘋果的兩個邊緣。為 解決第二個問題,Throopetal.(1997)發(fā)明了兩種相應的裝置。這些裝置使蘋果沿著 壟干旋轉不同的角度。?但是結果顯示其中一個裝置的分級方法不能在另外的裝置上 實行。Yang (1993)發(fā)明了一種照明裝置來辨別蘋果的莖干和花萼。其照明裝置的 主要問題是圖像處理中光線的誤分類。Wen and Tao (1998)成功發(fā)明了一種雙重照 相NIR/MIR成像法來識別蘋果的莖和花萼。但是在中國使用MIR照相機花費太 昂貴了。本論文的目的是介紹一種實驗裝置和實驗方法,使其在生產(chǎn)線上(每秒 3至4個蘋果)能檢查蘋果的四側,并有效的進行識別和分級。
2.關于系統(tǒng)裝置的總體看法
圖1實驗裝置示意圖
一種在生產(chǎn)線上能同時檢查蘋果四側的裝置被發(fā)明,其機構形式如圖1。 它由輸送裝置,形似于蘋果的空間間隔,機械視覺系統(tǒng)和信息傳輸裝置組成。 輸送裝置將蘋果分到每一小格,再反饋給視覺系統(tǒng)以檢查蘋果表面。最終, 分類系統(tǒng)將蘋果分成各個等級。
機械視覺系統(tǒng)包括一個杯狀的運送裝置,一個能發(fā)出不同光譜和對水果表面 色澤進行分類的裝置,兩個照相機,一個連接于微型電子計(處理速度500MHz) 帶有四個輸入通道的圖像抓取裝置。作為一個實驗系統(tǒng),水果輸送裝置和自動分 類系統(tǒng)在第一階段沒有被建立。 .
為完成蘋果的初步檢查,兩個相同的單色照相機被分別安置在輸送裝置的下 方。其視覺系統(tǒng)的機構如圖2。照相機里的攝像傳感器的分辨率為580X350。每 個照相機和另一個是同步的,并有多個電子快門。同樣的8. 5mm焦距的透鏡被安 裝在照相機內(nèi),光學帶通濾波器(840nm)安裝在每個透鏡外。傳送裝置由多個無 底的杯狀物體組成(如圖2),兩邊固定有兩面鏡子,因此,其上方的照相機可 以拍攝到蘋果的三面(頂部和兩邊),而底部的照相機可以拍攝到蘋果的仰視圖。 此外,這個系統(tǒng)可以同時檢查運送機上的數(shù)個蘋果。其好處就是可以同時檢查運 送機上蘋果的四面。
3.運算法則的描述
蘋果表面檢測的運算法則主要包括圖像預處理、缺點分割、莖和花萼的識別、缺陷區(qū)域的計算和分類。運算法則示意圖如圖3。
圖3缺陷識別運算法則流程圖
3.1 圖像背景的移除
運送機兩邊鏡子里的圖像背景是不同的,所以不能通過簡單的處理將水果的圖像進行分割。因此,一種減法法則被運用,如下所述。
g(x, y)是移除背景圖像后的圖像,f(x, y)是原始圖像,b(x, y)是背景圖像,T是初始值。
3.2參考蘋果圖像進行區(qū)域分割
在檢驗時,由于蘋果形狀,造成了圖像強度的曲線分布。這導致邊界 附近的表面亮度比有缺陷的表面亮度更低,因此難以使用簡單的運算法則 辨別出真正的缺陷表面。參考蘋果的圖像,Li and Wang (1999)發(fā)明了一種方法完成水果曲線圖像缺陷區(qū)域的分割。在這個方法中,首先產(chǎn)生一個水果的參 考圖像,經(jīng)過檢驗后,使其變成規(guī)格化后的水果參考圖像。經(jīng)過初始階段處理后, 表面的缺點會被更容易地識別。
3. 3基于幾何學和人工神經(jīng)網(wǎng)絡辨別莖和萼
在缺陷識別過程中,因為莖和萼的圖像與缺陷類似,導致系統(tǒng)難以對它們進 行識別?;趲缀螌W和人工神經(jīng)網(wǎng)絡,本文作者發(fā)明了一種方法來區(qū)分莖和萼的 凹面區(qū)域與真正的表面缺陷。不規(guī)則碎片形:一種幾何形狀,被以越來越小的比 例反復折疊而產(chǎn)生不能被標準幾何所定義的不標準的形狀和表面。雖然莖和花萼 與真實的缺點表面很相似,但它們不規(guī)則碎片形狀還是不同的。而且,在頻域中, 不規(guī)則碎片形狀分析只依賴于表面的頻率分布。組織上的這些不規(guī)則碎片形狀特 征與周圍光強和蘋果的方位無關。因此,此方法可以對任意方位的蘋果進行分類。 圖像的分布形狀可看作是三位曲線表面?;谏鲜隹紤],包括傳統(tǒng)的不規(guī)則碎片 形狀和四導向的不規(guī)則碎片形狀的五維不規(guī)則碎片被用來描述莖-花萼彎曲區(qū)域 和真實缺陷區(qū)域圖像的特征。四導向的不規(guī)則碎片形尺寸(Dl,D2,D3,D4)如 圖4所示。事實上,導向的不規(guī)則碎片形尺寸是對應方向(圖5)的曲線不規(guī)則 碎片形尺寸。五個不規(guī)則碎片形尺寸被Li and Wang (2000)的方法計算出來。 其數(shù)字式可寫為:Z=f(X,y),(x,y)是象素的坐標,Z是灰度值。假定圖像的 分辨率為M×M,在x-y平面內(nèi),圖像被分成數(shù)個δ×δ的區(qū)域。柵格灰度的最大值和最小值分別表達為uδ(i,j)和bδ(i,j),它們的差值為dδ= uδ(i,j)- bδ(i,j),非空的δ×δ柵格總數(shù)為:
對于所有給定的S取其對數(shù)得到一系列的點,可獲得logNδ。通過點(logδ,logNδ)的線,其斜率為負,由此估算出不規(guī)則碎片形的尺寸。用近似法 求出另外四個不規(guī)則碎片形的尺寸。
NN (神經(jīng)網(wǎng)絡)運算法則用來前饋來自真實缺陷區(qū)域的花萼。前饋網(wǎng)絡結構 可適當預測輸入和輸出間的非線性關系的相關問題。被設計的BP網(wǎng)絡結構如圖 6所示。NN模型有五個輸入點,一個含有四個隱藏輸入點的層和一個輸出點。在 程序學習過程中,網(wǎng)絡結構的權重不斷被刷新。其收斂性有兩個條件:是否每個 區(qū)域誤差比允許誤差值更小,是否每個樣品的輸出誤差比預先確定的允許誤差值 小。
圖6關于莖-萼缺陷分類的神經(jīng)網(wǎng)絡
3. 4蘋果表面缺陷的即時檢查
蘋果表面缺陷的即時檢查分為兩個階段。第一階段是3. 2中描述的方法對可 疑缺陷區(qū)域的分割(包括莖、萼和缺陷表面),其結果顯示蓮-萼區(qū)域時常為較 大的區(qū)域。在第二階段中,對較大的分割區(qū)域進一步處理以區(qū)別真正的表面缺陷。
4.實驗和結果
運算法則被用于探測四個富士蘋果的表面缺陷和莖-萼區(qū)域。結果如圖7, (a)、(c)、(e)和(g)是蘋果的原始探測圖像。(b)、(d)、(f)和(h)是 缺陷區(qū)域分割后的結果。這些結果顯示缺陷區(qū)域和莖-萼區(qū)域基本上被提取出來, 大于指定值的分割區(qū)域被進一步分割。表1為BP對莖-萼區(qū)域的識別結果。如果 神經(jīng)網(wǎng)絡的輸出值接近1,則為莖-萼區(qū)域。如果神經(jīng)網(wǎng)絡的輸出值接近0,則為 真實的缺陷區(qū)域。實驗結果顯示不規(guī)則碎片形狀對正常的水果凹入表面和缺陷表 面的分類是非常有效的。因為莖-花萼的片在外形上通常是凹的,被提出的方法對 莖-花萼的識別是可行的。對每個蘋果的表面缺陷的識別和分級的時間為320ms, 微電子計處理速度為500Hz。
(a) (b) (c) (d) (e) (f) (g) (h)
圖7缺陷區(qū)域和莖-萼區(qū)域(a)、(c)、(e)和(g)是蘋果的原始探測圖像。(b)、(d)、(f)和(h)是缺陷區(qū)域分割后的結果
序號
輸入?yún)^(qū)域
神經(jīng)網(wǎng)絡的輸出
1
莖-萼31×31
0. 9854
2
莖-萼38×38
0. 9949
3
莖-萼32×32
0. 6393
4
莖-萼37×37
0. 9854
5
莖-萼39×39
0. 9526
6
莖-萼40×40
0. 9783
7
莖-萼44×44
0. 8639
8
蓮-萼44×44
0. 9840
9
蓮-萼44×44
0. 8314
10
莖-萼46×46
0. 9725
11
莖-萼48×48
0. 8874
12
莖-萼48×48
0.9314
13
莖-萼43×43
0. 9956
14
莖-萼47×47
0. 9434
15
莖-萼47×47
0.8373
16
缺陷區(qū)域42×42
0. 9948
17
缺陷區(qū)域49×49
0. 0593
18
缺陷區(qū)域54×54
0. 0356
19
缺陷區(qū)域61×61
0. 0539
20
缺陷區(qū)域62×62
0. 2743
21
缺陷區(qū)域81×81
0. 2659
22
缺陷區(qū)域48×48
0. 0994
23
缺陷區(qū)域55×55
0.8194
24
缺陷區(qū)域54×54
0. 0312
25
缺陷區(qū)域63×63
0. 0883
26
缺陷區(qū)域66×66
0. 2093
27
缺陷區(qū)域51×51
0.2150
28
缺陷區(qū)域62×62
0. 0743
29
缺陷區(qū)域84×84
0. 2016
表1 BP對莖-萼區(qū)域和缺陷區(qū)域的識別
5.結論
結果顯示不規(guī)則碎片形狀特征對正常的水果凹入表面和缺陷表面的分類是非 常有效的。因為莖-花萼外形通常是凹的,本文提出的方法是切實可行的。而且, 此系統(tǒng)具有同時檢查生產(chǎn)線上每個蘋果表面的四個方位?;谔O果的原始圖像和 缺陷區(qū)域的分割方法,根據(jù)等級分類系統(tǒng)相應的要求來檢查一個蘋果真正的缺陷 區(qū)域,是較進一步的研究目的。
感謝
特別感謝支持此工作的大學博士學業(yè)特別基金會(Project No. 950801)。
參考書目
1,Growe, T.G.,Delwiche. M.J.,1996. Real-time defect detection in fruit—part I: design concepts and development of prototype hardware. Trans. ASAE 39 (6),2299-2308.
2,Li,Q. , Wang, M.,1999. Study on high-speed apple surface defect segment algorithm based on computer vision. Proceedings of International Conference on Agricultural Eigneering(99-ICAE) ,Beijing,People's Republic of China,14-17 December 1999,pp. V27-31.
3,Li,Q.,Wang, M.,2000. A fast identification method for fruit surface defect based on fractal characters. J.Image Graphics (China) 5 (2), 144-148.
4,Tao, Y.,1996. Spherical transform of fruit images for on-line defect extraction of mass objects. Opt. Eng.35 (2), 344-350.
收藏