基于OTSU自适应阈值分割的油气管道焊缝缺陷X射线检测方法研究

    X-Ray Detection Method for Weld Defects in Oil and Gas Pipelines Using OTSU Adaptive Threshold Segmentation

    • 摘要: 针对油气管道焊缝缺陷样本稀缺和低对比度X射线检测焊缝缺陷图像中的小缺陷容易漏检问题,提出一种基于OTSU(最大类间方差法)自适应阈值分割的X射线焊缝缺陷检测方法。设计动态伽马的调整规则,以增强X射线图像中的弱信号;引入全局偏移补偿C和OTSU全局阈值TOTSU,计算滑动窗口的自适应阈值,实现基于OTSU自适应阈值分割图像。采用掩码操作-反转操作-开运算去噪-缺陷外部轮廓提取,实现了缺陷的检测、分类、参数提取和定位。实验结果表明:该方法处理像素为449×594的图片仅需约1.59 s,检测的最小缺陷面积为0.237 mm2,不仅能实时、高效地检测微小焊缝缺陷,实现缺陷参数提取和定位,还不依赖缺陷样本数量大小,更易于在石油管线安全监测中应用推广。

       

      Abstract: To address the challenges of limited weld defect samples of oil and gas pipelines and frequent missed detection of small defects in low-contrast X-ray weld inspections, a X-ray weld defect detection method based on OTSU(maximum between-class variance method) adaptive threshold segmentation was proposed. Dynamic gamma adjustment rules was developed to enhance the weak signals in X-ray images, the global offset compensation C and otsu global threshold TOTSUwere introduced to calculate the adaptive threshold of the sliding window and realize image segmentation based on OTSU adaptive threshold. Defect detection, classification, parameter extraction and positioning were realized by using the mask operation,inversion operation, opening operation for denoising, and external defect contour extraction. The experimental results demonstrate that the method only takes about 1.59 s to process images with a pixel size of 449 ×594, and the minimum detectable defect area is 0.237 mm2. It can detect tiny weld defects in real time and efficiently, complete defect parameter extraction and positioning, and does not depend on the number of defect samples, making it easier to apply and popularize in safety monitoring of petroleum pipelines.

       

    /

    返回文章
    返回