As the construction of oil and gas pipelines continues to advance, the safety of pipelines has garnered increasing attention. Pipeline welds represent a crucial factor in ensuring the safe transportation of pipelines over the long term. Therefore, to guarantee the quality and safety of pipeline welding, it is necessary to inspect the welds of oil and gas pipelines. Currently, manual detection is the most common method for inspection. However, as the number of pipeline detection points continues to increase, manual detection has revealed issues such as low detection efficiency and the susceptibility of detection results to subjective judgments. To address these shortcomings, this study introduces machine vision technology to the detection and recognition of oil and gas pipeline welds, which holds significant guidance implications for the detection and recognition of oil and gas pipeline welds.