下载本文档
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
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. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 中国数据标注行业研究及出海趋势 2026
- 2025年江苏省东台市高考历史自测卷含完整答案(历年真题)
- 2025年浙江省余姚市高二生物上册期末考试真题及答案(各地真题)
- 2026 山东 退役军人岗 结构化面试
- 2026下半年下半年高中生物教资面试遗传专题试卷
- 2026年宠物健康护理员职业技能等级认定(五级)理论知识高频考点试题
- 2026年陶瓷产品设计师职业技能等级认定(四级)操作技能考前冲刺试题
- 2026年河北省高碑店市高考历史试卷附参考答案【B卷】
- 2025年山东省莱阳市高二历史下册期末考试试卷含完整答案【名校卷】
- 2026杯装饮料行业专利技术布局与创新力报告
- 《礼赞伟大祖国 争做时代少年-小学四年级国庆主题班会》
- 《医疗器械临床使用管理办法》培训考试测试题含答案
- 综合管理竞聘测试题及答案
- 湖北武汉市2026-2027学年高三年级上学期9月调研考试英语试卷
- 2026年部编版新教材道德与法治五年级上册全套教学设计(共4个单元有教学计划)
- 混凝土结构设计原理中国建筑工业出版社
- 人教版初中英语八年级上册第一单元完整教案
- 高考英语谓语与非谓语组合练100题(含答案)
- 国药数科2026届春季校园招聘建设笔试备考试题及答案解析
- 内分泌科护理服务质量管理标准
- 煤矿职业病危害培训课件
评论
0/150
提交评论