针对焊接之后的焊缝提取误差大、不易提取的问题,文章提出了一种DBSCAN聚类(density-based spatial clustering of applications with noise)与改进主成分分析(principal component analysis,PCA)算法融合的焊缝提取算法.首先对焊缝图像进行灰度化、自适应中值滤波等预处理;其次对图像应用Canny边缘检测算法提取焊缝边缘,并使用DBSCAN密度聚类算法聚类焊缝边缘;之后依据改进的PCA算法寻找焊缝的主成分,将焊缝向主向量映射统计,根据图像分辨率自动分配一个阈值获取焊缝的左右边界,再将焊缝的左右边界反映射到次主向量获取焊缝的上下边界;最后按照文章提出的算法完成了三组对比实验,分析了算法受分辨率、焊接方式、光照强度等因素的影响.实验证明,文章提出的算法对直缝提取效果良好,提取精度超过了 95%.
Research on welding seam extraction based on PCA-DBSCAN
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%.