为实现不规则形状超薄热管宽度测量自动化,提出一种基于机器视觉的中轴线梯度角逐像素宽度测量算法。首先采用Canny算法获取像素边缘,并进一步使用改进二次插值法提取亚像素边缘。然后利用细化算法提取边缘内封闭区域中轴线并适当裁剪。接着使用形态学膨胀与高斯滤波构造中轴线区域边缘,计算梯度角,并借助双侧均值滤波逼近真实梯度角的光滑变化。最后沿梯度角两侧搜索亚像素边缘点,边缘点对距离即为所测宽度。解决了常规测量算法无法确定不规则形变轮廓对应宽度测量点和高次过渡曲线区域无法测量的问题,并实现在轴线方向密集测量宽度,最大程度逼近真实边缘宽度分布。实验结果表明,测量对象宽度在10 mm以内时,文中算法测量不确定度为±0.026 mm,能很好地适应超薄热管的不规则外形,实现稳定可靠、高精度的自动化测量。
In order to realize the automatic measurement of width of irregular ultra-thin heat pipe, a pixel-by-pixel width search algorithm based on the central axis gradient of machine vision is proposed. First, the Canny algorithm is used to obtain pixel edges, and the improved quadratic interpolation method is further used to extract sub-pixel edges. Then, the thinning algorithm is used to extract the central axis of the enclosed area within the edge and crop it appropriately. Next, to construct the edge of the central axis area by morphological expansion and Gaussian filtering algorithm, to calculate the gradient angle, to approximate the smooth change of the true gradient angle with the help of two-sided mean filtering. Finally, searching for sub-pixel edge points along both sides of the gradient angle, and the edge point pair distance is the target width. It solves the problem that the conventional measurement algorithm cannot determine the width measurement point corresponding to the irregular deformation contour and the high-order transition curve area cannot be measured, and realizes the dense measurement of the width in the axial direction, which approximates the true edge width distribution to the greatest extent. The experimental results show that when the width of measured object is within 10 mm, the measurement uncertainty of the algorithm in the article is ±0.026 mm, which can well adapt to the irregular shape of the ultra-thin heat pipe, and realize stable, reliable, and high-precision automated measurement.