To solve the problems of low detection efficiency and subjectivity in defect identification during the current manual welding defect detection process, a welding defect image detection and recognition scheme based on Halcon was proposed. The scheme involves preprocessing X-ray images of welding seams, enhancing the display of fish scale patterns through high-frequency enhancement, and extracting the ROI through mean filtering and binarization. Discrimination conditions have been added to the ordinary region growing algorithm to automatically select the most suitable parameters for identifying pores and tungsten slag. The ordinary opening convolution kernel has also been improved to identify unfused parts. Compared with machine learning, this approach does not require a large number of training sets. In experiments, a total of 222 images were detected with an accuracy of 89.19%. The results show that the welding defects DR image automatic identification to improve the efficiency and quality of enterprise parts inspection is of great significance: The computer recognition of weld defects can eliminate the error caused by subjective factors in the workers’ determination of defects; Can be a long time, high-intensity identification of weld defects; Can realize real-time preservation and long-distance transmission of weld defects.