首页 | 本学科首页   官方微博 | 高级检索  
     检索      

基于OpenCV的动态葡萄干色泽实时识别
引用本文:刘星星,王烁烁,徐丽明,袁全春,马帅,于畅畅,牛丛,陈晨,袁训腾,曾鉴.基于OpenCV的动态葡萄干色泽实时识别[J].农业工程学报,2019,35(23):177-184.
作者姓名:刘星星  王烁烁  徐丽明  袁全春  马帅  于畅畅  牛丛  陈晨  袁训腾  曾鉴
作者单位:中国农业大学工学院,北京 100083,中国农业大学工学院,北京 100083,中国农业大学工学院,北京 100083,中国农业大学工学院,北京 100083,中国农业大学工学院,北京 100083,中国农业大学工学院,北京 100083,中国农业大学工学院,北京 100083,中国农业大学工学院,北京 100083,中国农业大学工学院,北京 100083,中国农业大学工学院,北京 100083
基金项目:现代农业产业技术体系建设专项资金资助(CARS-29)
摘    要:为了实现新疆吐鲁番地区"无核白"葡萄干的自动化色泽识别,该文利用OpenCV对无核白葡萄干的表面色泽识别进行研究,设计了一套可以实时、动态、多条输送通道同时处理的葡萄干色泽识别设备。为保证葡萄干色泽特征提取的正确率,对实时获取的每一帧图像进行预处理,获得平滑无孔洞的葡萄干二值图像;去除每一帧二值图像两侧边缘处不完整的葡萄干轮廓,从而保证获取葡萄干的完整色泽信息;定义图像上、下2部分掩膜,并分别仅保留图像右侧第一个葡萄干轮廓,利用上、下掩膜对每一帧图像分别处理,实现2条输送带上葡萄干的同时识别,以提高葡萄干色泽识别效率;在HSV空间下对保留的图像右侧第一颗葡萄干提取各通道的均值,以绿色、黄色、褐色葡萄干各40粒进行测试取值,统计数据并分析,确定色调通道H值23、亮度通道V值80为阈值进行葡萄干色泽识别;以3种颜色葡萄干各150粒分3次进行试验,结果表明,绿、黄、褐色葡萄干的识别正确率分别为89.33%,92.00%和96.67%,识别效率为21s/百粒葡萄干,识别方法简单有效。该方法的识别效率高于人工分选方式的110s/百粒葡萄干,但识别正确率低于人工分选方式的100%;相比于现有研究方法对各色葡萄干93%以上的识别正确率,该识别方法对褐色葡萄干的识别正确率较高,但对黄、绿色葡萄干的识别正确率较低;市场上现有的葡萄干分级设备使用的识别方法几乎无法区分黄、绿色葡萄干,与其相比,该文提供了一个可以较好区分黄、绿色葡萄干的方法。该文基于OpenCV设计的葡萄干色泽识别算法具有分选可行性和较好的识别正确率,可为后续分选执行机构和控制系统的搭建提供算法基础,为葡萄干色选的商业化提供算法参考。

关 键 词:农产品加工  图像处理  OpenCV  颜色空间  葡萄干  色泽识别
收稿时间:2019/8/6 0:00:00
修稿时间:2019/11/18 0:00:00

Real time color recognition of moving raisin based on OpenCV
Liu Xingxing,Wang Shuoshuo,Xu Liming,Yuan Quanchun,Ma Shuai,Yu Changchang,Niu Cong,Chen Chen,Yuan Xunteng and Zeng Jian.Real time color recognition of moving raisin based on OpenCV[J].Transactions of the Chinese Society of Agricultural Engineering,2019,35(23):177-184.
Authors:Liu Xingxing  Wang Shuoshuo  Xu Liming  Yuan Quanchun  Ma Shuai  Yu Changchang  Niu Cong  Chen Chen  Yuan Xunteng and Zeng Jian
Institution:College of Engineering, China Agricultural University, Beijing 100083, China,College of Engineering, China Agricultural University, Beijing 100083, China,College of Engineering, China Agricultural University, Beijing 100083, China,College of Engineering, China Agricultural University, Beijing 100083, China,College of Engineering, China Agricultural University, Beijing 100083, China,College of Engineering, China Agricultural University, Beijing 100083, China,College of Engineering, China Agricultural University, Beijing 100083, China,College of Engineering, China Agricultural University, Beijing 100083, China,College of Engineering, China Agricultural University, Beijing 100083, China and College of Engineering, China Agricultural University, Beijing 100083, China
Abstract:In order to realize the automatic colour and lustre recognition of "seedless white" raisins in Turpan, Xinjiang, in this paper, OpenCV open source function library was used as an image processing tool, a multi-channel moving raisin color and lustre real-time recognition algorithm was proposed. In order to ensure the accuracy of raisin colour and lustre feature extraction, it is necessary to preprocess every image acquired in real time. In this paper, component method was used to obtain the gray scale image of each image, the gray histogram of RGB image components was obtained by OpenCV open source function library, and finally the B-channel gray scale image was selected for threshold segmentation through observation. Through the B-channel gray histogram, 55 was selected as the segmentation threshold, and the image after threshold segmentation was obtained, i.e. binary image. Through morphological operation, the binary image was processed by etching first and then expanding, and the smooth and burr free binary image of raisin was obtained. A method to remove the incomplete raisin outline at the two sides of each binary image was proposed. The complete color information of raisin was obtained by the image boundary expansion, overflow filling and image clipping of binary image. The pper and lower area mask were established, and each frame image was processed separately by the mask, the image segmentation was realized, and the raisins on the two conveyor belts was recognized at the same time, and the recognition processing efficiency was improved. The rightmost contour of upper and lower region was found by traversing every raisin contour in the image, and only the rightmost raisin was recognized in the process of processing each frame of the image (the synchronized conveyor belt was transported from left to right), so as to simplify the data processing. In HSV space, the mean value of each channel was extracted from the first raisin on the rightmost of the two synchronized conveyor belt, and 40 raisins of green, yellow and brown were tested for value taking. Statistical data were analyzed and plotted with MATLAB, the results were that the threshold value of H component was 23, and that of V component was 80, which were used to identify and sort the raisins of three colors. 150 raisins of each color were selected were selected for the validation test, and each color was divided into three groups, 50 raisins in each group, 9 groups of tests were conducted. The results showed that the average recognition accuracy of green raisins was 89.33%, that of yellow raisins was 92.00%, and that of brown raisins was 96.67%, the recognition efficiency was 21 s/100 raisins, the method was simple and effective. The recognition efficiency of this method was higher than 110 s / 100 raisins of manual sorting, but the recognition accuracy was lower than 100% of manual sorting. Compared with the existing research methods, the recognition accuracy of this method for brown raisins was higher, but the recognition accuracy for yellow and green raisins was lower. The current raisin grading equipment in the market can hardly distinguish the yellow and green raisins, the paper provides a better method to distinguish the yellow and green raisins. The raisin colour and lustre recognition algorithm based on OpenCV open source function library was feasible and accurate, the coordinate information, colour and lustre information of the identified raisins were obtained, which provided the algorithm basis for the construction of the subsequent sorting actuator and control system, and provides the reference for the commercialization of raisin colour and lustre selection.
Keywords:agriculture products  image processing  OpenCV  color space  raisin  color recognition
本文献已被 CNKI 等数据库收录!
点击此处可从《农业工程学报》浏览原始摘要信息
点击此处可从《农业工程学报》下载免费的PDF全文
设为首页 | 免责声明 | 关于勤云 | 加入收藏

Copyright©北京勤云科技发展有限公司  京ICP备09084417号