The invention discloses a stainless
steel tube surface defect detection method and
system. The method comprises the following steps: S1, collecting stainless
steel tube scanning images under dark field and bright field illumination; s2, splicing the
line scanning images into dark field and bright field cylindrical expanded images, and executing brightness
equalization and reflection suppression
processing; s3, carrying out pixel-
level fusion on the dark field and bright field cylindrical expansion images according to a set weight; s4, inputting the fusion cylinder expansion image into a YOLO network
trunk of an integrated Swin Transform module, and extracting a multi-scale feature map; s5, performing
feature fusion and bounding box prediction, and outputting a bounding box, confidence and a category
label of the defect; s6, performing semantic segmentation, gray segmentation and weighted fusion in the detection frame area to generate a final defect
mask; and S7, calculating the area, length, width and
centroid coordinates of the defect, and converting the actual size and the spatial position. The stainless
steel tube surface defect recognition accuracy and stability are improved.