摘要
介绍一种基于机器视觉的测量工件宽度的新方法,在开源计算机视觉库OpenCV的支持下,设计并实现一种对工件宽度进行动态实时测量的系统;为了降低其它光的影响,在CCD镜头下面固定一块红光滤光片,系统通过采集经红光线激光器投射的工件图像,对图像进行二值化、截取感兴趣区域、轮廓提取等处理,最后实现工件宽度的自动测量;对不同尺寸的工件进行了自动测量实验,实验结果表明,采用的测量方法在实际工件测量中是可用的,整个测量过程用时在100 ms左右,最大相对误差不超过1.5%。
A new method of measurement about the width of the workpiece based on the computer vision was introduced.Under the support of the open source computer vision library OpenCV,designing and implementing a dynamic real—time measurement system on the width of the workpiece.In order to reduce the effects of other light,a red filter was fixed under the CCD camera,by grabing the photo of the workpiece with the structured light that the red line laser projected,the system takes measures to deal with the image binarization、the interception of region of interest、 contour extraction and so on,and finally realizes the automatic measurement.In the automatic measurement experiment on the different size of workpieces,the experimental results show that the method used in this paper is available in the actual workpiece measurement,the entire measurement process takes about 100 milliseconds,the maximum relative error does not exceed 1.5%.
引文
[1]周传宏,王怀虎,康少博.OpenCV在装箱缺条视觉检测系统中的应用[J].制造业自动化,2011(17):85-87.
[2]姚坤,葛广英,肖海俊,等.基于OpenCV的透明瓶装无色液体液位实时检测[J].计算机测量与控制,2015,23(1):34-36.
[3]谭同德,王三刚.基于OpenCV的车牌定位方法[J].计算机工程与设计,2013,34(8):2816-2820.
[4]李朝晖,郝建军,杨新桦.视觉检测技术在曲轴锻件尺寸检测中的应用[J].中国测试,2009,35(6):9-13.
[5]黄凯.余学才,唐飞,等.基于OpenCV的六角钢坯尺寸测量研究[J].计算机测量与控制,2013,21(5):1137-1139.
[6]蒋明.激光飞行标刻系统及激光加工机器人控制与仿真研究[D].武汉:华中科技大学,2011.
[7]Gary Bradski,Adrian Kaebler.学习OpenCV(中文版)[M].北京:清华大学出版社,2009:100-380.