Research on welding seam extraction based on PCA-DBSCAN
-
摘要: 针对焊接之后的焊缝提取误差大、不易提取的问题,文章提出了一种DBSCAN聚类(density-based spatial clustering of applications with noise)与改进主成分分析(principal component analysis,PCA)算法融合的焊缝提取算法。首先对焊缝图像进行灰度化、自适应中值滤波等预处理;其次对图像应用Canny边缘检测算法提取焊缝边缘,并使用DBSCAN密度聚类算法聚类焊缝边缘;之后依据改进的PCA算法寻找焊缝的主成分,将焊缝向主向量映射统计,根据图像分辨率自动分配一个阈值获取焊缝的左右边界,再将焊缝的左右边界反映射到次主向量获取焊缝的上下边界;最后按照文章提出的算法完成了三组对比实验,分析了算法受分辨率、焊接方式、光照强度等因素的影响。实验证明,文章提出的算法对直缝提取效果良好,提取精度超过了95%。Abstract: Aiming at the problem that the welding seam extraction after welding has a large error and is not easy to extract, the article proposes a welding seam extraction algorithm that is a fusion of DBSCAN clustering (density-based spatial clustering of applications with noise) and the improved principal component analysis (PCA) algorithm. Firstly, the weld image is pre-processed with grey scale and adaptive median filtering; secondly, the Canny edge detection algorithm is applied to the image to extract the weld edges, and the weld edges are clustered using the DBSCAN density clustering algorithm; after that, the principal components of the weld are searched for based on the improved PCA algorithm, and the weld is mapped to the principal vectors for statistical mapping, and the left and right boundaries of the weld are obtained by automatically assigning a threshold value according to the image resolution. The left and right boundaries of the weld are then reflected to the secondary principal vectors to obtain the upper and lower boundaries of the weld; finally, three groups of comparison experiments were completed according to the method of this paper, which analysed the influence of the algorithm of this paper by the resolution, welding method, light intensity and other factors. The experiment proves that the algorithm of this paper has good effect on straight seam extraction, and the extraction accuracy is more than 95%.
-
表 1 不同分辨率对比
分辨率/像素 图像数量/幅 提取率/(%) 640×480 50 89.41 800×600 50 95.24 1280×720 50 96.08 表 2 不同焊接方式对比
焊接方式 图像数量/幅 提取率/(%) 钨极氩弧焊 50 94.51 CO2保护手工焊 50 90.2 表 3 不同方法对比
不同光照强度/lux 方法 图像数量/幅 提取率/(%) 100~159 本文算法 50 91.57 曲线拟合法 50 86.43 中心线提取法 50 80.52 160~239 本文算法 50 96.08 曲线拟合法 50 90.67 中心线提取法 50 86.77 240~359 本文算法 50 93.54 曲线拟合法 50 89.93 中心线提取法 50 84.44 -
[1] 段岳飞,马嵩华,胡天亮. 基于全卷积神经网络的焊缝识别方法[J]. 制造技术与机床,2023(4):44-49. [2] 张帅,杨龙兴,丁力. 基于自适应双边滤波的V型焊缝特征提取研究[J]. 制造技术与机床,2021(7):125-129. [3] 李盛前,张小帆. 基于小波变换的双阈值水下焊缝图像边缘检测研究[J]. 机床与液压,2022,50(23):173-178. doi: 10.3969/j.issn.1001-3881.2022.23.030 [4] You X C,Zhao B S. Research on laser welding seam tracking system with auto-calibration function[J]. Foundry Technology,2015,36(7):1829-1832. [5] 张帆,泮佳俊,刘腾,等. 基于机器视觉的焊缝识别研究现状与发展趋势[J]. 电焊机,2022,52(7):24-33,61. [6] 李冰,杨旭,何煊,等. 基于线阵CCD与小波去噪的薄板对焊焊缝识别系统研究[J]. 热加工工艺,2021,50(11):141-146. [7] Kiddee P,Fang Z J,Tan M. An automated weldseam tracking system for thick plate using cross markstructured light[J]. The International Journal ofAdvanced Manufacturing Technology,2016,87(9-12):3589-3603. doi: 10.1007/s00170-016-8729-7 [8] 胡丹,张艳喜,王静静,等. 焊缝成形线结构光视觉检测方法研究[J]. 制造技术与机床,2022(3):132-137. [9] Zhang K,Chen Y X,Gui H,et al. Identification of the deviation of seam tracking and weld cross typefor the derusting of ship hulls using a wall-climbingrobot based on three-line laser structural light[J].Journal of Manufacturing Processes ,2018,35:295-306. [10] Wang Z G,Zhang K,Chen Y X,et al. A real-time weld line detection for derusting wall-climbing robot using dual cameras[J].Journal of Manufacturing Processes,2017, 27 :76–86. [11] 刘涛,左继业,张晓森,等. 环形焊缝的双目视觉定位与跟踪研究[J]. 机械科学与技术,2021,40(6):928-933. [12] Zhang M L,Desrosiers C. Image denoising based on sparse representation and gradient histogram[J]. IET Image Processing,2017,11(1):54-63. doi: 10.1049/iet-ipr.2016.0098 [13] 莫玲,高向东,萧振林,等. 微间隙焊缝磁光图像增强方法[J]. 焊接技术,2015,44(6):17-22. [14] 刘东来,崔亚飞,罗辉,等. 基于机器视觉的弧焊机器人焊缝识别及路径生成研究[J]. 制造技术与机床,2021(12):26-32. [15] Jafarzadegan M,Safi-Esfahani F,Beheshti Z. Combining hierarchical clustering approaches using the PCA method[J]. Expert Systems With Applications,2019,37:1-10. [16] 刘美菊,姜金怿. 基于主动形状模型的焊缝定位算法[J]. 沈阳工业大学学报,2019,41(2):194-198. [17] 纪象民,曹志峰,任传鹤,等. 基于本征图像分解的焊缝提取算法[J]. 无损检测,2023,45(2):33-39.