基于机器视觉的R型销间隙测量方法
来源:用户上传
作者:易焕银
摘要:为了解决产品制造企业对R型销的间隙测量难度大、效率低的问题,本文提出了一种基于机器视觉的R型销间隙测量方法,介绍了测量方法的整体结构,首先利用连通域分析进行图像预处理并提取对象边沿,然后利用Hough变换检测外边沿直线并分区搜索两个较宽间隙端点的大致位置,再利用最小二乘法拟合得到内边沿直线并获取各间隙拐点的准确位置,最后搜索各间隙的另一端点并计算出各间隙的宽度。实验表明,此方法自动适应被测对象型号、位置和角度的变化,用C++实现的该算法平均运行时间约为50 ms。在5个对象各100次随机摆放的重复性测量实验中,窄、中、宽三g隙的最大绝对误差分别为0.038 mm、0.059 mm和0.071 mm,最大相对误差分别为3.360%、1.059%和0.670%,满足企业实际应用的需要。
关键词:机器视觉R型销间隙测量霍夫变换最小二乘法
中图分类号: TP391.4 文献标志码: A
R-pin Gap Measurement Method Based on Machine Vision
YI Huanyin
(Guangdong Communication Polytechnic, Guangzhou, Guangdong Province, 510800 China)
Abstract: In order to solve the problem of high difficulty and low efficiency in the gap measurement of R-pins by manufacturers, a method for measuring the gap of R-pins based on machine vision is proposed. The overall structure of the measurement method is introduced. Firstly, connected component analysis is used to preprocess the image and the edge of the object is extracted. Then, the Hough transform is used to detect the outer edge line and partitioned search for the approximate positions of the two wide gap endpoints. After that, least square method is used to fit the inner edge straight line and obtain the accurate position of the inflection point of each gap. Finally, the other endpoints of each gap is searched and the width of each gap is calculated. Experiments show that the method automatically adapts to changes in the model, position and angle of the measured object. The average running time of the algorithm implemented in C++ is about 50 ms. In the repeatability measurement experiment with 5 objects each placed 100 times randomly, the maximum absolute errors of the narrow, medium, and wide gaps are 0.038 mm, 0.059 mm and 0.071 mm, and the maximum relative errors are 3.360%, 1.059% and 0.670% respectively, meeting the actual application needs of enterprises.
Key Words: Machine vision; R-pin; Gap measurement; Hough transform; Least square method
R型销,又称B型开口销或弹簧销,作为一种限位类零件,因其锁紧程度高,在汽车、铁路、机械、电力等行业应用广泛[1]。由于R型销的间隙大小对装配后产品整体的可靠性和运行性能有重要影响,因此生产企业要求在装配前检测其间隙值是否在工艺要求的范围内。而产品或零部件的间隙测量一直是工业测量的痛点问题,人工测量R型销间隙的方法效率过低、可重复性精度不高。
关于开口销的视觉检测方法,相关文献[2-6]基于深度学习和传统图像处理技术,提出了多种应用场景下的开口销缺失、松脱等各类缺陷的视觉检测方法。马官兵等人[7]搭建了一套水下核电厂堆内构件的控制棒导向筒开口销的超声检测系统。而关于间隙的工业测量方法,张鹏贤等人[8]提出了一种基于激光的管道焊口间隙的视觉检测方法,路亚缇、陈健等人[9-10]提出了基于OpenCV的盾尾间隙视觉测量系统,张智森等人[11]设计了一种测量柱塞组件轴向间隙的夹具。
为了解决制造企业检测R型销的各间隙难度大、效率低的问题,本文提出了一种基于机器视觉的对R型销的各间隙进行快速、无接触的测量方法,实现了对不同型号和位置随机摆放的对象的自动识别与间隙测量。经过实验验证,此方法在速度和精度方面都达到了企业实际应用的要求。
nlc202206241552
转载注明来源:https://www.xzbu.com/1/view-15434562.htm