摘要
为了解决产品制造企业对R型销的间隙测量难度大、效率低的问题,本文提出了一种基于机器视觉的R型销间隙测量方法,介绍了测量方法的整体结构。首先,利用连通域分析进行图像预处理,并提取对象边沿;然后,利用Hough变换检测外边沿直线,并分区搜索两个较宽间隙端点的大致位置;再利用最小二乘法拟合得到内边沿直线,并获取各间隙拐点的准确位置;最后,搜索各间隙的另一端点,并计算出各间隙的宽度。实验表明,此方法自动适应被测对象型号、位置和角度的变化,用C++实现的该算法平均运行时间约为50ms。在5个对象各100次随机摆放的重复性测量实验中,窄、中、宽三间隙的最大绝对误差分别为0.038mm、0.059mm和0.071mm,最大相对误差分别为3.360%、1.059%和0.670%,满足企业实际应用的需要。
In order to solve the problem of high difficulty and low efficiency in the gap measurement of R-pins by product manufacturers,this paper proposes a method for measuring the gap of R-pins based on machine vision,and is introduces the overall structure of the measurement method.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 search for the approximate positions of the two wide gap endpoints in a partition.After that,least squares fitting method is used to obtain the inner edge straight line and the accurate position of the inflection point of each gap is obtained.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.
作者
易焕银
YI Huanyin(Guangdong Communication Polytechnic,Guangzhou,Guangdong Province,510800 China)
出处
《科技创新导报》
2022年第4期56-60,共5页
Science and Technology Innovation Herald
基金
广东省高校青年人才科研项目(项目编号:2020KQNCX166)
广东交通职业技术学院校级科研项目(项目编号:GDCP-ZX-2021-010-N1)。
关键词
机器视觉
R型销
间隙测量
霍夫变换
最小二乘法
Machine vision
R-pin
Gap measurement
Hough transform
Least squares fitting method