基于机器视觉的蓝莓果实分级检测算法Blueberries grading detection algorithm based on machine vision
王伟,房银杰,刘九庆,王智琦
摘要(Abstract):
为了实现蓝莓果实的无损检测和自动分级,提出一种基于机器视觉的蓝莓果实分级检测算法。应用Open CV,Visual Studio 2015开发环境编写算法程序,并搭建了一套基于机器视觉的蓝莓果实自动分级检测实验装置。通过实验装置的CCD摄像头获取蓝莓果实图像后,应用图像处理技术对其进行降噪、HSV加权运算、开运算、二值化处理及边缘检测,获取蓝莓果实图像的边缘像素点集。对边缘像素点集进行椭圆拟合后,应用最小二乘法确定蓝莓果实的实际值与计算机测量值之间的数学关系,求取蓝莓果实直径。为了验证算法的可行性,使用数字式游标卡尺对蓝莓果实的测量值与检测装置的测量值进行实验对比分析。实验结果表明,测量误差低于3.1%,验证了算法的有效性。
关键词(KeyWords): 蓝莓果实;机器视觉;边缘检测;最小二乘法;分级检测;图像处理
基金项目(Foundation): 中央高校基本科研业务费专项资金支撑项目(2572015CB08)~~
作者(Author): 王伟,房银杰,刘九庆,王智琦
DOI: 10.16652/j.issn.1004-373x.2018.13.009
参考文献(References):
- [1]中华人民共和国国家质量监督检验检疫总局.GB/T 27658-2011.蓝莓[S].北京:中华人民共和国国家质量监督检验检疫总局,2011.General Administration of Quality Supervision,Inspection and Quarantine of the People′s Republic of China.GB/T 27658-2011,blueberry[S].Beijing:General Administration of Quality Supervision,Inspection and Quarantine of the People′s Republic of China,2011.
- [2]朱江丽,田绪顺,李景彬,等.红枣自动分级技术的研究现状及展望[J].安徽农业科学,2011,39(36):22864-22867.ZHU Jiangli,TIAN Xushun,LI Jingbin,et al.Research status and prospect of ziziphus jujuba automatic grading technology[J].Journal of Anhui agricultural sciences,2011,39(36):22864-22867.
- [3]左飞.数字图像处理技术详解与Visual C++实践[M].北京:电子工业出版社,2014.ZUO Fei.Digital image processing and Visual C++practice[M].Beijing:Electronic Industry Press,2014.
- [4]肖锋,李丽莎.HSV彩色空间的亚像素边缘检测[J].计算机与数字工程,2015,43(6):1107-1112.XIAO Feng,LI Lisha.Sub-pixel edge detection of HSV color space[J].Computer&digital engineering,2015,43(6):1107-1112.
- [5]李志明.基于机器视觉的鲜枣群体大小检测算法[J].工业仪表与自动化装置,2016(5):29-32.LI Zhiming.Fresh jujubes group size detection algorithm based on machine vision[J].Industrial instrumentation&automation,2016(5):29-32.
- [6]毛星云,冷飞雪.Open CV3编程入门[M].北京:电子工业出版社,2015.MAO Xingyun,LENG Feixue.Introduction to programming of Open CV3[M].Beijing:Electronic Industry Press,2015.
- [7]薛武,张永生,董广军,等.Canny算子子像素边缘检测方法[J].遥感信息,2013,28(1):8-10.XUE Wu,ZHANG Yongsheng,DONG Guangjun,et al.An edge detection method of sub-pxel based on Canny operator[J].Remote sensing information,2013,28(1):8-10.
- [8]黎自强,滕弘飞.广义Hough变换:多个圆的快速随机检测[J].计算机辅助设计与图形学学报,2006,18(1):27-33.LI Ziqiang,TENG Hongfei.Generalized Hough transform:fast randomized multi-circle detection[J].Journal of computer aided design&computer graphics,2006,18(1):27-33.
- [9]GANDER W,GOLUB G H,STREBEL R.Least-squares fitting of circles and ellipses[J].Bit numerical mathematics,1994,34(4):558-578.
- [10]李秀明,石照耀.基于不变矩的椭圆(圆)识别方法[J].北京工业大学学报,2007(11):1136-1140.LI Xiuming,SHI Zhaoyao.Eillpses and circles recognition based on invariant moments[J].Journal of Beijing University of Technology,2007(11):1136-1140.
- [11]钮毅.部分遮挡条件下椭圆目标识别[D].上海:上海交通大学,2007.NIU Yi.Detection of partially occluded ellipses[D].Shanghai:Shanghai Jiao Tong University,2007.
- [12]闫蓓,王斌,李媛.基于最小二乘法的椭圆拟合改进算法[J].北京航空航天大学学报,2008(3):295-298.YAN Bei,WANG Bin,LI Yuan.Optimal ellipse fitting method based on least-square principle[J].Journal of Beijing University of Aeronautics and Astronautics,2008(3):295-298.
- [13]陈海峰,雷华,孔燕波,等.基于最小二乘法的改进的随机椭圆检测算法[J].浙江大学学报(工学版),2008,42(8):1360-1364.CHEN Haifeng,LEI Hua,KONG Yanbo,et al.An improved randomized algorithm for detecting ellipses based on least square approach[J].Journal of Zhejiang University(engineering science),2008,42(8):1360-1364.
- [14]LI Liangfu,FENG Zuren,HE Kailiang.A randomized algorithm for detecting multiple ellipses based on least square approach[J].Optoelectronics review,2005,13(1):61-67.
- [15]颜宁生.带插值条件的最小二乘法[J].北京服装学院学报(自然科学版),2007(2):42-48.YAN Ningsheng.Least squares with interpolation condition[J].Journal of Beijing Institute of Clothing Technology(natural science edition),2007(2):42-48.