对含有夹渣、气孔和裂纹缺陷的直焊缝X射线图像进行缺陷的边缘检测时,传统的Canny算法虽然可以检测出缺陷的边缘,但具有自适应差和容易出现伪边缘的缺点。提出了一种改进的Canny算法,对经过非极大值抑制后的梯度直方图,利用像素最值梯度和像素最值梯度方差自适应获取连接缺陷边缘所需的高、低阈值;同时也改进了计算梯度图像所需的模板。实验结果证明,改进的Canny算法不仅进一步抑制了噪声,也避免了伪边缘的出现,在保留缺陷的边缘细节方面具有良好的效果。
When defect edge detection traditional false is conducted to the X-ray image of to a straight detect weld with clamp is slag,pores and cracks,the and Canny algorithm,though improved being able edge in defects,paper,and poorly adaptable prone to edges.pixels An Canny algorithm value,and is the presented required this suppressing threshold gradient histogram of by non-maximal edges high low the The also are adaptively acquired to connect defect by using the maximal image pixel gradient and maximal gradient variance;it also the improves improved the Canny template algorithm for not gradient calculation.the experimental avoids results show that only restrains noise,but false edges,and has favorable effect on retaining details of defect edge details.