A Dynamic Threshold Segmentation Algorithm for(Zhejiang University of Technology2009)_第1頁(yè)
A Dynamic Threshold Segmentation Algorithm for(Zhejiang University of Technology2009)_第2頁(yè)
A Dynamic Threshold Segmentation Algorithm for(Zhejiang University of Technology2009)_第3頁(yè)
A Dynamic Threshold Segmentation Algorithm for(Zhejiang University of Technology2009)_第4頁(yè)
全文預(yù)覽已結(jié)束

下載本文檔

版權(quán)說(shuō)明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)

文檔簡(jiǎn)介

1、A Dynamic Threshold Segmentation Algorithm for Cucumber Identification in GreenhouseLiyong Qi, Qinghua Yang, Guanjun Bao, Yi Xun, Libin ZhangThe MOE Key Laboratory of Mechanical Manufacture and AutomationZhejiang University of TechnologyHangzhou, ChinaAbstract Aiming at realizing cucumber identifica

2、tion and location for cucumber harvesting robot in greenhouse, a segmentation algorithm for cucumber image was presented. Using M (M=2G) component as the threshold segmentation channel, choosing an initial threshold to segment the images. The threshold was dynamic revised based on shape characterist

3、ics of cucumber fruits after the initial segmentation threshold was judged. The pixel region which did not belong to fruit was removed by erosion and dilation using structure elements. Final segmentation images were obtained after region marking. Thirty images were tested to verify the correctness o

4、f the algorithm, and twenty-three images were segmented correctly with satisfactory results. Experimental results show that the segmentation success rate is 76.7%, and the segmentation effect is acceptable which can be used in greenhouse cucumber identification.Keywords-cucumber identification; segm

5、entation algorithm; dynamic threshhold; shape characteristicsI. INTRODUCTIONAs a vegetable with fast growth and good economic benefits cucumber is widely planted around the world. The fruits are consumed by fresh, so it is necessary to harvest in time, or it tends to be over -mature, which will affe

6、ct its quality and reduce its value 1. A considerable amount of time will be taken in large area at harvesting time. Thereby it is essential to enhance the productivity of cucumber harvesting. Identification of cucumber location is the key issue need to be solved for cucumber picking robot. In order

7、 to solve this issue the ripe cucumber fruit image must be extracted from the complex color image when using machine vision. Image segmentation was one of the important steps in this process.Many methods were proposed on recognizing fruits in natural scene. Sergey N.K. used neural network for color

8、image segmentation. In the RGB color space, each image pixel is expressed as an eigenvector composed of nine components includes R, G, B and their mean values and variances 2. The eigenvector are the input layer of the neural network for image segmentation, and the output layer neurons correspond to

9、 the pre-defined color number for segmentation. The method of Sergey N. K. has two limitations: First one is that it needs a learning process, which means there must be a teaching image in advance for learning to generate the correct output; The second one is that the neurons number of output layer

10、node must be given, which means that we must know the colornumber for segmentation in advance. In fact, the output color number is not consistent for many color images. Thus, the algorithm is very limited in its usefulness.Lucchese L. and S. K. Mitra introduced a new method of clustering, which clus

11、ter in two-dimensional space 3. Firstly, it seeks clustering in the two dimension space which contains chroma information, which associated with an appropriate cluster in the brightness of one dimension space, ultimately resulting in the formation of the final cluster. A C-means algorithm is used in

12、 this method, and the entire cluster need one iteration. Due to the number of clusters changes with the cluster process, it is not necessary to know the number of clustering in advance. This method relies on two parameters: the average distance between categories and the average distance within a ca

13、tegory. As different images have different midpoint distribution in chromatic diagram, it is impossible to set one group as applicable parameters for all images.Arthur R. Weeks proposed a modified C-means algorithm. HIS color space is used in his algorithm 4. Firstly each pixel of the image is regar

14、ds as a 3D vector which consists of hue, saturation and luminance, and then K-means algorithm is used to cluster. Using this algorithm, m initial cluster centers should be randomly selected at first, then each pixel will be scanned to determine the best clustering to describe each pixel. Therefore,

15、the final segmentation results are related to the initial cluster centers. As people are more sensitive to hue, thus one modification of the above algorithm is to make hue separate from saturation and brightness, then cluster separately.Eli Saber proposed a segmentation algorithm using a region spli

16、tting and merging method for color image in YES color space 5. This method is in such an assumption condition that the three color channels are independent, and each color area is marked firstly using adaptive Bayesian method, then regional segmentation is done meaningful with the combination of edg

17、e information. However, it is unreasonable to expect three independent color channels in most images.II. MATERIAL AND METHODA. Cucumber Image AcquisitionThe cucumbers in this paper were planted in greenhouse. Thirty images of cucumber were obtained using CCD camera (KODAK Z650) between 8:00am and 4:

18、00pm in a sunny day at978-1-4244-4131-0/09/$25.00 2009 IEEEthe temperature of 20 degree centigrade. Each image contains at least one piece of cucumber. All images were obtained in 24-bit RGB color format with effective pixels 480(V) 640(H). The camera was placed horizontally. The distances between c

19、amera and fruits were 0.5m approximately. Leaves and stems were thinner and more transparent than fruits, thus under backlighting condition, light can easily permeate through leaves and stems but hardly permeate through the fruits. Due to these characteristics the brightness of cucumber was much low

20、er than leaves and stems in images which were useful in image segmentation.B.Characteristics of Cucumber ImageColor property is regarded as one of the main fruit characteristics, choosing the right color feature plays an important role on image segmentation. Fig. 1a shows a cucumber image in RGB for

21、mat, the object is cucumber and the background include leaves, stems, soil and sky. The color image was decomposed into three different channels those are R channel, G channel and B channel, as shown in Fig. 1b 1c 1d. By analyzing the gray values of each component image, it can be seen from the G co

22、mponent image that there were obvious differences on gray value between object and background. The average gray value of G component is 71 through artificial calculation by software MATLAB while the background average gray value is 153. (Gray value ranges from 0 to 255.) In order to enhance the diff

23、erences in gray value of G component between background and object, M component was used as the color characteristic of image segmentation which can be calculated by (1). Fig. 1c shows the G component image of cucumbers. Fig. 1e shows the M component of the same image. The value above 255 will be gi

24、ven the M value of 255.a RGB imageb R component imagec G component imaged B component imageeM component imageFigure 1. Cucumber image in different channel.M=2 G .(1)Where: G is the gray value of G component, M is the enhanced gray value.The difference in shape between cucumber and leaves or stems wa

25、s obvious. For those ripe ones, the fruit image area is much bigger than those of leaves and stems. In the image acquisition, distance between camera and fruit is about 0.5m, which kept constant in the process. Thus to those ripe cucumbers, their image area is basically stable. The aspect ratio of c

26、ucumber was about 7:1 through artificial calculation by software MATLAB, and cucumber pixels in a single image were about 13500, image total pixels were 307200. Based on this, the aspect ratio and pixel area of cucumber were taken as shape characteristics for the followed image segmentation.C.Segmen

27、tation Algorithm for Cucumber ImageThreshold segmentation to cucumbers M component image was carried out according to color characteristics of cucumber, and then the threshold was modified according to shape characteristics of cucumber. Then cucumber image segmentation will be finished by a new thre

28、shold. The detailed algorithm was listed as follows:1) The initial RGB color image was decomposed into R, G and B component images. M component image was obtained by (1).2) Initial threshold segmentation to M component image was carried out by an initial threshold t according to cucumbers distributi

29、on in M component image. M component image was defined as M (x, y) . The image after initialthreshold was defined as n(x, y) which can be calculated by (2) 6.1M ( x , y ) tn(x, y) =.(2)0M ( x , y ) t3) A 480 50 pixel region was chosen according to the shape characteristics of cucumber. The region wa

30、s chosen first at the top left corner of the image, the pixel n(x, y) in thisregion was scanned. The number of pixel which equals to 0 will be calculated in the region and be recorded as Np. In the same region the number of pixels which belongs to cucumber was N0 through artificial calculation by MA

31、TLAB. Then Np and N0 were compared to determine whether cucumber pixels were in this region or not. If not, the 480 50 region will be moved forward by 10 pixels and the same operation will be carried out again. Those steps will not be stopped until the region is found in which Np N0, If the eligible

32、 region was not found until it scanned to the end of the image, it means that the threshold chosen in step 2 was too small. The cucumber pixels have not been segmented completely. At this time, the initial threshold in step 2 will be modified. The new threshold value will be obtained by adding 5 to

33、the original threshold. Steps 2 and 3 will be repeated again until the pixels belonged to cucumber was existed and be found. This threshold will be the best segmentation threshold we select.D.Image Post-processingMorphological operation was used to remove background pixels in image after the dynamic

34、 threshold segmentation. Firstly, the image was eroded to separate cucumber and background, and then the image was dilated to make pixel area of cucumber unchanged compared to the original one. At last, region marking of image was carried out to finish the whole segmentation.MATLAB programs using Im

35、age Processing and Statistics Toolbox were written and used for analysis of different component images and image segmentation.III. EXPERIMENT AND ANALYSISThe greenhouse cucumber was selected as the experimental object in this paper. Original images were taken by digital camera under natural scene. T

36、he segmentation algorithm was verified by experiment on images which contains target cucumber. The original images were shown in Fig. 2.A. Results on Target SegmentationAccording to (1), the M component image used for segmentation can be obtained after the original RGB image was transformed into R c

37、omponent image, G component image and B component image. From the former analysis it can be known that the average gray value of G component image of cucumber was 71, and the average gray value of G component image of background was 153. (Gray value ranges from 0 to 255.) The initial threshold value

38、 t was set as 140, and the pixel number N0 belonged to cucumber in a 480 50 pixel region through artificial calculation by MATLAB was about 13500. According to the algorithm described in section above, the segmented images are shown in Fig. 3. It was a binary image, in which the fruit targets were b

39、lack and others were white.From Fig. 3 it can be seen that most leaves, stems, sky and soil regions were removed. However, some stem regions were still reserved because the color was more similar to fruits. Asmall part of cucumber fruit region was lost at the edge. Although most fruit regions were s

40、egmented, there were still background pixels in the image. Erosion and dilation was used to remove background pixels and fill some target region holes. 33 diamond-shaped and 90 degree line structure elements were used in the morphological processing. Region marking of image was carried out after tha

41、t. The average area of an integrate cucumber were about 13500 pixels in an image mentioned above. Considering this condition, an area threshold was set at 13000. Those small targets were removed from the image and the largest target which could be fruit was kept. Fig. 4 was the images after post-pro

42、cessing, and it was also the final segmentation images.B.Results AnalysisIn this paper, three different images were selected to illustrate the experimental results. Fig. 2a shows a standard cucumber fruit with uniform shape and color, experimental results are satisfactory shown in Fig. 4a, the optim

43、al threshold value is 160(0 to 255). Fig. 2b shows a curved cucumber with non-uniform shape, but the experimental results are still good shown in Fig. 4b, the optimal threshold value is 155. Fig. 2c shows a short cucumber, as the image was obtained under strong background light, so the G component v

44、alue of the image is lower than that in the two images above. Thus the M component value which used for segmentation is also lower than that in the two images above. If we adopt the uniform segmentation threshold, it will not be suitable for this segmentation obviously. This will cause over segmenta

45、tion, a large number of background pixels will be introduced. It will be avoid in this paper using the dynamic threshold. Finally the optimal threshold value is 145 which is smaller than that in the images above, the experimental results is acceptable shown in Fig. 4c.For the obtained 30 images, 23

46、images were segmented correctly with satisfactory results, and the success rate is 76.7%. The main reasons for failed images include too strong backlight and that cucumber fruit hidden in the leaves.aaabbbcccFigure 2.Original imagesFigure 3. Images after segmentationFigure 4. Images after post-processingIV.CONCLUSIONSACKNOWLEDGMENTBased on color and shape characteristics of greenhouseThis work is supported by National Hi-tech Research andcucumbers under backlight condition, the following worksDevelopment Program of China (863 Program, No.have been done.2007AA04Z222), Zhejiang Na

溫馨提示

  • 1. 本站所有資源如無(wú)特殊說(shuō)明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁(yè)內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒(méi)有圖紙預(yù)覽就沒(méi)有圖紙。
  • 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫(kù)網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
  • 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。

評(píng)論

0/150

提交評(píng)論