Weld detection method, apparatus, and medium

CN122689786APending Publication Date: 2026-09-04GUANGDONG POWER GRID CO LTD DONGGUAN POWER SUPPLY BUREAU
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202610704729.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-05-20
Publication Date
2026-09-04

AI Technical Summary

Technical Problem

[0004]然而,上述现有技术在实际应用中仍存在以下局限性:焊缝识别精度差

Benefits of technology

[0071]The weld inspection method, equipment, and medium provided in this application relate to the field of nondestructive testing technology. The method includes: acquiring three-dimensional geometric data of the weld area to be inspected; determining, based on the three-dimensional geometric data, whether an assembly gap exists in the weld area; if no assembly gap is determined, magnetizing the weld area to be inspected to obtain target magnetic indication image data; extracting magnetic indication features from the target magnetic indication image data to obtain magnetic indication topological features; and quantitatively evaluating and analyzing the magnetic indication topological features to determine the weld inspection result for the weld area to be inspected. This application acquires three-dimensional geometric data of the weld area to be inspected and determines whether there is an assembly gap in the weld area based on the three-dimensional geometric data. This enables the identification of structural factors that easily cause interference in magnetic flux leakage characterization before inspection, thereby reducing the risk of misjudgment caused by assembly gaps and weld waveform morphology. By magnetizing the weld area to be inspected when it is determined that there is no assembly gap, target magnetic trace image data is obtained, and magnetic trace features are extracted from the target magnetic trace image data to obtain magnetic trace topological features. This can overcome the limitation of relying solely on grayscale or edge information for identification, thereby enhancing the ability to distinguish between real cracks and structural and process interference. By quantitatively evaluating and analyzing the magnetic trace topological features to determine the weld inspection results of the weld area to be inspected, the accuracy and stability of weld crack identification can be improved, thereby enhancing the reliability of weld inspection under complex surface morphology conditions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122689786A_ABST
    Figure CN122689786A_ABST
Patent Text Reader

Abstract

The welding seam detection method, device and medium provided by the application relate to the technical field of nondestructive testing. The method comprises the following steps: acquiring three-dimensional geometric data of a welding seam area to be detected; judging whether there is an assembly gap in the welding seam area to be detected based on the three-dimensional geometric data; in the case where it is determined that there is no assembly gap, performing magnetization treatment on the welding seam area to be detected to obtain target magnetic trace image data; extracting magnetic trace features in the target magnetic trace image data to obtain magnetic trace topological features; and performing quantitative evaluation and analysis on the magnetic trace topological features to determine a welding seam detection result of the welding seam area to be detected. Through the application, the accuracy and detection stability of welding seam crack identification can be improved, and the reliability of welding seam detection under complex surface conditions can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of nondestructive testing technology, and in particular to a weld inspection method, equipment and medium. Background Technology

[0002] As a critical connecting component in industrial equipment, building construction, and large machinery load-bearing structures, the structural strength and reliability of T-joints directly affect the operational safety of the overall system. With the continuous improvement of industrial manufacturing standards, quality control and defect detection of microcracks in the weld area of ​​T-joints have become a core aspect of ensuring structural safety.

[0003] Currently, the industry mainly uses magnetic particle inspection technology and automated inspection technology based on two-dimensional vision for weld quality assessment. Magnetic particle inspection reveals defects by using magnetic particles to accumulate at cracks under the influence of a leakage magnetic field, forming magnetic traces. Automated inspection methods based on two-dimensional vision acquire images of the weld surface and combine image processing and pattern recognition technologies to identify cracks.

[0004] However, the aforementioned existing technologies still have the following limitations in practical applications: poor weld seam recognition accuracy. Summary of the Invention

[0005] This application provides a weld inspection method, equipment, and medium to improve the accuracy of weld identification.

[0006] In a first aspect, this application provides a weld inspection method, comprising:

[0007] Acquire the three-dimensional geometric data of the weld area to be inspected;

[0008] Based on three-dimensional geometric data, determine whether there is an assembly gap in the weld area to be inspected;

[0009] If no assembly gap is found, the area of ​​the weld to be inspected is magnetized to obtain target magnetic trace image data.

[0010] Extract magnetic trace features from the target magnetic trace image data to obtain the magnetic trace topological features;

[0011] Quantitative evaluation and analysis of magnetic indication topological characteristics are performed to determine the weld inspection results for the weld area to be inspected.

[0012] In one possible embodiment, acquiring the three-dimensional geometric data of the weld region to be inspected includes:

[0013] A non-contact three-dimensional measurement method is used to scan the weld area to be inspected and obtain three-dimensional geometric data. The non-contact three-dimensional measurement method includes at least one of the following: a line structured light-based visual measurement method, a binocular stereo vision measurement method, a phase measurement profilometry method, or a time-of-flight-based three-dimensional measurement method.

[0014] In one possible embodiment, determining whether an assembly gap exists in the weld area to be inspected, based on three-dimensional geometric data, includes:

[0015] Extract the continuity features of the cross-sectional profile at the weld root from the three-dimensional geometric data;

[0016] Analyze the continuity characteristics to determine whether there are regions of height abrupt change in the weld area to be inspected;

[0017] If a region of height abrupt change exists, it is determined that there is an assembly gap in the area of ​​the weld to be inspected;

[0018] If there is no region of height abrupt change, it is determined that there is no assembly gap in the weld area to be inspected.

[0019] In one possible embodiment, magnetic trace features are extracted from the target magnetic trace image data to obtain magnetic trace topological features, including:

[0020] The magnetic trace topology feature extraction algorithm is used to extract magnetic trace features from the target magnetic trace image data to obtain magnetic trace topology features. The magnetic trace topology feature extraction algorithm includes one of the following: a local iterative thinning algorithm, a distance transformation-based median extraction algorithm, a mathematical morphology-based extraction algorithm, or a deep learning-based feature extraction algorithm.

[0021] In one possible embodiment, when the magnetic smudge topology feature extraction algorithm is a local iterative thinning algorithm, the magnetic smudge features in the target magnetic smudge image data are extracted using the magnetic smudge topology feature extraction algorithm to obtain the magnetic smudge topology features, including:

[0022] The target magnetic trace image data is binarized to obtain a binary image, which includes foreground pixels and background pixels.

[0023] The following sub-steps are iteratively performed on the binary image until the state of all pixels in the binary image remains unchanged: First, a first group of foreground pixels to be deleted is marked based on a first preset rule, wherein the first preset rule includes: the number of connections in the first group of foreground pixels is 1, the number of background pixels in the 8-neighborhood of the first group of foreground pixels is 2 to 6, and the 8-neighborhood of the first group of foreground pixels satisfies a first topological constraint condition, wherein the first topological constraint condition is: there is no pattern satisfying a preset connectivity break within the 8-neighborhood of the first group of foreground pixels; Second, a second group of foreground pixels to be deleted is marked based on a second preset rule, wherein the second preset rule includes: the number of connections in the second group of foreground pixels is 1, the number of background pixels in the 8-neighborhood of the second group of foreground pixels is 2 to 6, and the 8-neighborhood of the second group of foreground pixels satisfies a second topological constraint condition, wherein the second topological constraint condition is: there is no pattern satisfying a preset symmetry violation within the 8-neighborhood of the second group of foreground pixels; The marked first group of foreground pixels and second group of foreground pixels are updated to background pixels;

[0024] The binary image after the iteration stops is used as the skeleton image data, and magnetic trace features are extracted from the skeleton image data to obtain the magnetic trace topological features.

[0025] In one possible embodiment, if it is determined that there is no assembly gap, the area of ​​the weld to be inspected is magnetized to obtain target magnetic indication image data, including:

[0026] When it is determined that there is no assembly gap, magnetic particle testing is used to magnetize the weld area to be inspected and obtain initial magnetic trace image data.

[0027] Image preprocessing is performed on the initial magnetic indication image data to obtain preprocessed initial magnetic indication image data;

[0028] The preprocessed initial magnetic trace image data is enhanced to obtain the target magnetic trace image data. The enhancement process includes any one or more combinations of multi-scale morphological filtering enhancement, contrast stretching, histogram equalization, or frequency domain filtering enhancement.

[0029] In one possible embodiment, when the enhancement process is a multi-scale morphology-based filtering enhancement, the initial magnetic trace image data is enhanced to obtain the target magnetic trace image data, including:

[0030] The initial magnetic trace image data is processed using a first morphological operator to generate a first intermediate image;

[0031] The initial magnetic trace image data is processed using a second morphological operator to obtain a second intermediate image;

[0032] The first and second intermediate images are weighted and summed to obtain the target magnetic trace image data.

[0033] In one possible embodiment, a quantitative evaluation and analysis of the magnetic indication topological features is performed to determine the weld inspection results for the weld region to be inspected, including:

[0034] Quantitative evaluation and analysis of the topological characteristics of magnetic traces are performed, and evaluation indicators characterizing the morphology of magnetic traces are calculated. Among them, the evaluation indicators include fractal dimension, skeleton connectivity coefficient and skeleton curvature.

[0035] The weld inspection results are determined based on the evaluation indicators.

[0036] Secondly, this application provides a weld inspection device, comprising:

[0037] The acquisition module is used to acquire the three-dimensional geometric data of the weld area to be inspected;

[0038] The judgment module is used to determine whether there is an assembly gap in the weld area to be inspected based on three-dimensional geometric data.

[0039] The magnetization module is used to magnetize the weld area to be inspected when it is determined that there is no assembly gap, so as to obtain target magnetic trace image data.

[0040] The extraction module is used to extract magnetic trace features from the target magnetic trace image data to obtain the magnetic trace topological features;

[0041] The determination module is used to quantitatively evaluate and analyze the topological features of magnetic traces to determine the weld inspection results for the weld area to be inspected.

[0042] In one possible embodiment, the acquisition module is specifically used for:

[0043] A non-contact three-dimensional measurement method is used to scan the weld area to be inspected and obtain three-dimensional geometric data. The non-contact three-dimensional measurement method includes at least one of the following: a line structured light-based visual measurement method, a binocular stereo vision measurement method, a phase measurement profilometry method, or a time-of-flight-based three-dimensional measurement method.

[0044] In one possible embodiment, the determination module is specifically used for:

[0045] Extract the continuity features of the cross-sectional profile at the weld root from the three-dimensional geometric data;

[0046] Analyze the continuity characteristics to determine whether there are regions of height abrupt change in the weld area to be inspected;

[0047] If a region of height abrupt change exists, it is determined that there is an assembly gap in the area of ​​the weld to be inspected;

[0048] If there is no region of height abrupt change, it is determined that there is no assembly gap in the weld area to be inspected.

[0049] In one possible embodiment, the extraction module is specifically used for:

[0050] The magnetic trace topology feature extraction algorithm is used to extract magnetic trace features from the target magnetic trace image data to obtain magnetic trace topology features. The magnetic trace topology feature extraction algorithm includes one of the following: a local iterative thinning algorithm, a distance transformation-based median extraction algorithm, a mathematical morphology-based extraction algorithm, or a deep learning-based feature extraction algorithm.

[0051] In one possible embodiment, the extraction module is specifically used for:

[0052] The target magnetic trace image data is binarized to obtain a binary image, which includes foreground pixels and background pixels.

[0053] The following sub-steps are iteratively performed on the binary image until the state of all pixels in the binary image remains unchanged: First, a first group of foreground pixels to be deleted is marked based on a first preset rule, wherein the first preset rule includes: the number of connections in the first group of foreground pixels is 1, the number of background pixels in the 8-neighborhood of the first group of foreground pixels is 2 to 6, and the 8-neighborhood of the first group of foreground pixels satisfies a first topological constraint condition, wherein the first topological constraint condition is: there is no pattern satisfying a preset connectivity break within the 8-neighborhood of the first group of foreground pixels; Second, a second group of foreground pixels to be deleted is marked based on a second preset rule, wherein the second preset rule includes: the number of connections in the second group of foreground pixels is 1, the number of background pixels in the 8-neighborhood of the second group of foreground pixels is 2 to 6, and the 8-neighborhood of the second group of foreground pixels satisfies a second topological constraint condition, wherein the second topological constraint condition is: there is no pattern satisfying a preset symmetry violation within the 8-neighborhood of the second group of foreground pixels; The marked first group of foreground pixels and second group of foreground pixels are updated to background pixels;

[0054] The binary image after the iteration stops is used as the skeleton image data, and magnetic trace features are extracted from the skeleton image data to obtain the magnetic trace topological features.

[0055] In one possible embodiment, the magnetization processing module is specifically used for:

[0056] When it is determined that there is no assembly gap, magnetic particle testing is used to magnetize the weld area to be inspected and obtain initial magnetic trace image data.

[0057] Image preprocessing is performed on the initial magnetic indication image data to obtain preprocessed initial magnetic indication image data;

[0058] The preprocessed initial magnetic trace image data is enhanced to obtain the target magnetic trace image data. The enhancement process includes any one or more combinations of multi-scale morphological filtering enhancement, contrast stretching, histogram equalization, or frequency domain filtering enhancement.

[0059] In one possible embodiment, the determining module is specifically used for:

[0060] The initial magnetic trace image data is processed using a first morphological operator to generate a first intermediate image;

[0061] The initial magnetic trace image data is processed using a second morphological operator to obtain a second intermediate image;

[0062] The first and second intermediate images are weighted and summed to obtain the target magnetic trace image data.

[0063] In one possible embodiment, the determining module is specifically used for:

[0064] Quantitative evaluation and analysis of the topological characteristics of magnetic traces are performed, and evaluation indicators characterizing the morphology of magnetic traces are calculated. Among them, the evaluation indicators include fractal dimension, skeleton connectivity coefficient and skeleton curvature.

[0065] The weld inspection results are determined based on the evaluation indicators.

[0066] Thirdly, this application provides an electronic device, including: a memory and a processor;

[0067] The memory stores the instructions that the computer executes;

[0068] The processor executes computer execution instructions stored in memory, causing the processor to perform the first aspect and / or various possible implementations of the first aspect as described above.

[0069] Fourthly, this application provides a computer-readable storage medium storing computer-executable instructions, which, when executed, are used to implement the first aspect and / or various possible embodiments of the first aspect.

[0070] Fifthly, this application provides a computer program product, including a computer program that, when executed, implements the first aspect and / or various possible implementations of the first aspect.

[0071] The weld inspection method, equipment, and medium provided in this application relate to the field of nondestructive testing technology. The method includes: acquiring three-dimensional geometric data of the weld area to be inspected; determining, based on the three-dimensional geometric data, whether an assembly gap exists in the weld area; if no assembly gap is determined, magnetizing the weld area to be inspected to obtain target magnetic indication image data; extracting magnetic indication features from the target magnetic indication image data to obtain magnetic indication topological features; and quantitatively evaluating and analyzing the magnetic indication topological features to determine the weld inspection result for the weld area to be inspected. This application acquires three-dimensional geometric data of the weld area to be inspected and determines whether there is an assembly gap in the weld area based on the three-dimensional geometric data. This enables the identification of structural factors that easily cause interference in magnetic flux leakage characterization before inspection, thereby reducing the risk of misjudgment caused by assembly gaps and weld waveform morphology. By magnetizing the weld area to be inspected when it is determined that there is no assembly gap, target magnetic trace image data is obtained, and magnetic trace features are extracted from the target magnetic trace image data to obtain magnetic trace topological features. This can overcome the limitation of relying solely on grayscale or edge information for identification, thereby enhancing the ability to distinguish between real cracks and structural and process interference. By quantitatively evaluating and analyzing the magnetic trace topological features to determine the weld inspection results of the weld area to be inspected, the accuracy and stability of weld crack identification can be improved, thereby enhancing the reliability of weld inspection under complex surface morphology conditions. Attached Figure Description

[0072] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.

[0073] Figure 1 A flowchart illustrating the weld inspection method provided in this application embodiment. Figure 1 ;

[0074] Figure 2 A schematic diagram of the structure of the three-dimensional imaging device provided in this application;

[0075] Figure 3 A three-dimensional point cloud topography image provided in the embodiments of this application when there is no assembly gap;

[0076] Figure 4 This application provides a three-dimensional point cloud topography diagram with assembly gaps.

[0077] Figure 5 Comparison diagram of cross-sectional contour lines provided for embodiments of this application;

[0078] Figure 6 A flowchart illustrating the weld inspection method provided in this application embodiment. Figure 2 ;

[0079] Figure 7A flowchart illustrating the extraction of magnetic trace topological features provided in an embodiment of this application;

[0080] Figure 8 A pixel intensity distribution comparison diagram provided in the embodiments of this application;

[0081] Figure 9 Comparison diagram of magnetic trace topology skeleton of cracks provided in the embodiments of this application;

[0082] Figure 10 A comparison diagram of the magnetic trace topology skeleton with that of a rough weld wave provided in the embodiments of this application;

[0083] Figure 11 This is a schematic diagram of the weld inspection device provided in the embodiments of this application;

[0084] Figure 12 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application.

[0085] The accompanying drawings illustrate specific embodiments of this application, which will be described in more detail below. These drawings and descriptions are not intended to limit the scope of the concept in any way, but rather to illustrate the concept of this application to those skilled in the art through reference to particular embodiments. Detailed Implementation

[0086] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numbers in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this application. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this application as detailed in the appended claims.

[0087] Non-destructive testing (NDT) technology for welds is widely used in quality control and operation and maintenance of industrial equipment, building steel structures, shipbuilding, pressure vessels, and large mechanical load-bearing components. T-joints, in particular, are often located in areas of concentrated structural stress and high safety requirements due to their functions of connection, force transmission, and local stiffness transition. These T-joints typically require crack screening after welding to prevent minute defects from gradually propagating under alternating loads, vibration, thermal cycling, or corrosive environments, which could lead to weld failure, component cracking, or even structural failure.

[0088] In actual engineering sites, to complete the weld inspection of this type of T-joint, it is usually necessary to construct an inspection system consisting of the workpiece to be tested, a magnetic particle inspection device, an image acquisition device, and a back-end analysis unit. After the weld area to be tested is positioned on the workpiece conveying platform, robot actuator, or manual workstation, the inspection system first performs flaw detection preparation on the weld and its adjacent areas, then forms observable magnetic trace information through magnetization, and the corresponding image data is acquired by an industrial camera or other vision acquisition unit. Subsequently, the acquisition results are transmitted to the analysis module for judgment. This type of inspection process is a common and critical quality assurance method at the T-joints between bridge node plates and web plates, the joints between ship bulkhead stiffeners and shell plates, the corner joints between pressure vessel accessories and cylinders, and the welding positions of reinforcing ribs in engineering machinery housings.

[0089] Because T-joints have complex characteristics such as weld toe, weld root, weld wave undulation, and assembly transition, the inspection scenario not only requires the ability to detect minute cracks, but also requires the ability to maintain stable and accurate identification under complex geometric conditions. Therefore, this technical field places high demands on the applicability, anti-interference ability, and engineering feasibility of the inspection methods.

[0090] Current T-joint weld crack detection technology typically relies on magnetic particle testing, combined with manual observation or two-dimensional image analysis to identify defects. The basic idea is to magnetize the weld area to be tested, creating a leakage magnetic field at potential surface or near-surface cracks. This attracts magnetic particles, forming strip-shaped, linear, or aggregated magnetic traces. Inspectors then determine the presence of cracks based on the morphology, length, continuity, and positional relationship of these magnetic traces.

[0091] In automated scenarios, magnetic trace images are typically acquired by image acquisition equipment. Features are then extracted using methods such as threshold segmentation, edge extraction, grayscale analysis, morphological processing, or template matching. Detection results are output based on indicators such as grayscale intensity, contour continuity, or area. This approach is applicable to flat welds and welds with regular surfaces, but its effectiveness in T-joints is often limited by structural morphology and manufacturing processes. These limitations mainly manifest in two aspects:

[0092] On the one hand, during the assembly stage, T-joints may experience insufficient root fit, uneven local gaps, or minor misalignments caused by welding shrinkage. These geometric anomalies alter the local magnetic field distribution, causing areas that are not cracks to exhibit similar linear magnetic leakage characteristics, forming pseudo-magnetic traces that closely resemble actual cracks. On the other hand, the rough weld waves, variations in weld reinforcement, spatter adhesion, and uneven surface reflection formed after welding can also lead to abnormal accumulation of magnetic powder in localized areas, resulting in fine branches, discontinuous stripes, or bright noise areas in the image.

[0093] Due to the interference of the aforementioned structural and technological factors, existing detection methods have the following limitations:

[0094] 1. Limitations of traditional manual interpretation: It relies heavily on experience and is prone to subjective bias when faced with complex false magnetic traces and interference, making it difficult to guarantee consistency and accuracy;

[0095] 2. Existing two-dimensional image analysis methods are limited, mostly focusing on pixel grayscale and edge information, and lacking the ability to identify the macroscopic geometric state of the weld area in advance.

[0096] Due to these limitations, under complex lighting conditions, significant surface undulations, or substantial fluctuations in assembly quality, existing technologies are prone to false positives and false negatives, and also result in insufficient stability and poor repeatability of test results. This situation makes it difficult to meet the stringent requirements for highly reliable weld inspection in critical load-bearing structures.

[0097] Therefore, how to suppress the interference caused by assembly gaps and weld surface morphology during the inspection of T-joint welds, and accurately identify real cracks in magnetic trace information, has become an urgent technical problem to be solved.

[0098] To address the aforementioned issues, this application provides a weld inspection method. This method does not directly rely on magnetic indication images for judgment. Instead, it first acquires the three-dimensional geometric data of the weld area to be inspected and determines whether an assembly gap exists in the weld area based on the three-dimensional geometric data. Only when it is determined that no assembly gap exists is the weld area to be inspected magnetized to obtain target magnetic indication image data. Subsequently, magnetic indication features are extracted from the target magnetic indication image data to obtain magnetic indication topological features, and the magnetic indication topological features are quantitatively evaluated and analyzed to finally determine the weld inspection result for the weld area to be inspected.

[0099] The method provided in this application employs a technical path of first determining the geometric assembly state, then performing magnetization imaging, and finally evaluating based on topological features. This method systematically connects structural factors affecting the detection results with the subsequent magnetic indication discrimination process, thereby improving the accuracy of identifying real cracks and the reliability of the detection results. In specific application scenarios, this method can be deployed in inspection systems that include non-contact 3D measurement equipment, magnetic particle flaw detectors, and image processing systems to meet the automated inspection needs of T-joint welds in bridge steel structures, pressure vessels, ship welded joints, and large mechanical load-bearing structures.

[0100] The technical solution of this application and how the technical solution of this application solves the above-mentioned technical problems are described in detail below with specific embodiments. These specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described again in some embodiments. The embodiments of this application will now be described with reference to the accompanying drawings.

[0101] Figure 1 A flowchart illustrating the weld inspection method provided in this application embodiment. Figure 1 ,like Figure 1 As shown, the method includes:

[0102] S101: Obtain the three-dimensional geometric data of the weld area to be inspected.

[0103] In this step, three-dimensional geometric data serves as the information basis for characterizing the macroscopic morphology of the weld area to be inspected. Specifically, the three-dimensional geometric data can reflect the spatial contour, surface undulation information, and geometric boundary information of the weld surface, weld toe transition zone, web and flange connection zone, and adjacent area of ​​the weld root, thus providing basic data for subsequent determination of whether assembly gaps exist.

[0104] Obtaining the three-dimensional geometric data of the weld area to be inspected requires a three-dimensional imaging device. A schematic diagram of the three-dimensional imaging device can be found here. Figure 2 .like Figure 2 As shown, the three-dimensional imaging device includes a laser sensor 2, an industrial camera 3, and a linear sliding module 4.

[0105] Optionally, taking the weld area to be inspected as an example of a T-joint, the method for acquiring three-dimensional geometric data is explained. Specifically, firstly, the T-joint 1 is driven at a constant speed through the laser detection area using a linear sliding module 4. During this constant speed passage, the laser sensor 2 emits a laser beam to illuminate the weld area to be inspected on the T-joint. The industrial camera 3 is set at a predetermined triangulation angle, and the optical path 5 of the industrial camera points towards the weld area to be inspected on the T-joint 1. The industrial camera is used to acquire images of the laser reflection spot. Through the principle of triangulation, the three-dimensional point cloud is reconstructed based on the relative motion between the T-joint 1, the laser triangulation sensor 2, and the camera 3. Further, the three-dimensional point cloud reconstruction stage includes the following key steps: 1. Centerline positioning of the light stripe: The centerline of the light stripe formed by laser illumination is accurately located using the Steger algorithm; 2. Collaborative noise reduction processing: Statistical outlier filtering and Gaussian smoothing algorithms are integrated to collaboratively reduce noise in the point cloud data; 3. Three-dimensional point cloud generation: A high-density three-dimensional point cloud representing the macroscopic features of the weld is generated through contour space stitching and surface reconstruction techniques.

[0106] For T-joints, issues such as misalignment, localized misalignment, and root openings often alter the local magnetic field distribution and induce false magnetic traces. Relying solely on two-dimensional magnetic trace images is insufficient to eliminate such interference at its source. This step, however, uses non-contact three-dimensional acquisition to obtain spatial continuity information and local geometric anomaly information of the weld area. This allows the detection system to identify structural factors that may lead to false detections before magnetization, thus laying the foundation for improving the accuracy and stability of subsequent crack identification.

[0107] S102: Based on three-dimensional geometric data, determine whether there is an assembly gap in the weld area to be inspected.

[0108] Among them, assembly gap is used to characterize whether there is a misfit in the weld area to be inspected, and it is a preliminary screening condition before magnetization detection. Assembly gap can be manifested as an abnormal opening formed at the connection position of the web and flange, an abnormal interval between adjacent edges, or as a local contour discontinuity interruption reflected by three-dimensional geometric data, an abnormal height jump at the root position, or a discontinuous geometric transition.

[0109] When determining whether an assembly gap exists, geometric relationship analysis needs to be performed on the three-dimensional geometric data obtained in S101. For example, firstly, the weld centerline, the reference planes of the base materials on both sides, and the contour curve of the connecting root region can be extracted from the point cloud or depth map. Then, using the weld extension direction as a reference, the area to be inspected is divided into multiple analysis windows, and the cross-sectional geometry within each analysis window is fitted. Subsequently, key geometric parameters are calculated based on the fitting results, such as the minimum distance between adjacent edges, the opening width of the root region, the local height difference, the abrupt change in contour curvature, and the cross-sectional continuity score. These parameters are then compared with preset geometric thresholds to determine whether an assembly gap exists at the corresponding location.

[0110] If the determination result indicates the presence of an assembly gap, the weld area is marked as a structural anomaly area, and the magnetization flaw detection process for that area is terminated. Instead, an intermediate conclusion is output indicating that reassembly is required before further inspection, or that geometric anomalies will not be included in crack analysis. Simultaneously, the corresponding 3D anomaly location is recorded in the detection database. If the determination result indicates the absence of an assembly gap, subsequent magnetization processing steps are triggered.

[0111] Because assembly gaps in T-joints can cause magnetic leakage characteristics in non-cracked areas to resemble actual cracks, screening out areas with misalignment using three-dimensional geometric data first can suppress the source of false magnetic traces at the beginning of the inspection process, preventing subsequent magnetic particle testing from mistaking structural anomalies for crack defects. This leads to a technical approach of first determining the geometric state and then performing magnetization imaging. Compared to methods that directly rely on magnetic trace images for discrimination, this significantly reduces the probability of false detections caused by fluctuations in assembly condition and improves the repeatability and engineering applicability of the inspection results.

[0112] S103: If it is determined that there is no assembly gap, magnetize the area of ​​the weld to be inspected to obtain target magnetic trace image data.

[0113] Magnetization is used to create observable magnetic traces in the weld area at locations where defects may exist, thus providing an image basis for subsequent crack identification. The target magnetic trace image data carries the image information of the magnetic traces formed after magnetization and serves as input data for subsequent extraction of magnetic trace features.

[0114] In practice, after S102 confirms that there are no assembly gaps in the weld area to be inspected, the inspection controller sends an execution command to the magnetic particle inspection device, controlling the weld area to be inspected to maintain a preset inspection posture, and setting corresponding magnetization parameters according to the weld direction, plate thickness, and material permeability. The magnetization method can be AC ​​magnetization, DC magnetization, AC / DC composite magnetization, coil magnetization, yoke magnetization, or contact magnetization, in order to establish a magnetic field of appropriate direction and intensity in the weld and its adjacent areas.

[0115] Furthermore, considering that cracks in T-joints may be distributed along the weld toe direction, weld root direction, or at an angle to the weld extension direction, this step can use at least two different magnetization directions to sequentially magnetize, so that the magnetic field direction forms a large angle with the main extension direction of the potential crack, thereby enhancing the leakage magnetic field effect at the crack location.

[0116] In the specific operation process, magnetic powder medium can be sprayed or sprinkled onto the weld area to be inspected. The magnetic powder medium can be dry magnetic powder or wet magnetic powder suspended in a carrier liquid. By controlling the spraying flow rate, particle size, and coverage uniformity, the magnetic powder can form a stable distribution on the surface of the weld area to be inspected. Subsequently, the magnetization device applies a preset magnetic field to the weld area to be inspected. At locations where there are cracks, lack of fusion, or other abnormalities on or near the surface that cause changes in magnetic resistance, the magnetic lines of force will be distorted and a leakage magnetic field will be formed. Under the action of the leakage magnetic field, the magnetic powder will accumulate along the abnormal area to form strip-shaped, linear, or aggregated magnetic traces.

[0117] To avoid imaging instability caused by variations in weld wave height and local surface roughness, in one possible embodiment, the magnetization process can also be combined with synchronous vibration, uniform powder spraying, and constant illuminance light source control to make the magnetic powder distribution more uniform and reduce the accumulation of irrelevant particles.

[0118] After the magnetic traces are formed, an industrial camera is used to capture images of the magnetized area to obtain magnetic trace images.

[0119] Based on the above analysis, it is clear that this step does not involve indiscriminate magnetic particle testing across all weld areas. Instead, magnetization and imaging are performed only after assembly gap interference has been eliminated. This makes it more likely that abnormal features in the subsequent magnetic trace images correspond to real defects rather than assembly artifacts. Simultaneously, by controlling multi-directional magnetization and image acquisition parameters, the ability to reveal micro-cracks and discontinuous magnetic traces can be improved, enhancing the identifiability and stability of the target magnetic trace image data.

[0120] S104: Extract magnetic trace features from the target magnetic trace image data to obtain magnetic trace topological features.

[0121] Among them, magnetic trace features are used to characterize the feature information of magnetic trace morphology in the target magnetic trace image, and are an intermediate result for generating magnetic trace topological features; magnetic trace topological features are used to describe the morphological features of magnetic traces at the topological level, so as to distinguish between real cracks and interfering magnetic traces caused by surface roughness, spatter adhesion or local noise.

[0122] In practice, the detection controller reads the target magnetic trace image data obtained in S103 and first performs magnetic trace region separation processing on the image. This separation processing may include grayscale enhancement, local contrast enhancement, threshold segmentation, edge detection, and morphological operations to extract the suspected magnetic trace from the background.

[0123] Since magnetic powder traces typically exhibit a slender, continuous, or quasi-continuous high-contrast structure, this embodiment can combine adaptive thresholding and directional filters to enhance the linear response, and then use opening and closing operations to remove isolated noise points and small pseudo-regions, making the remaining area closer to the true magnetic trace morphology.

[0124] After initial separation of the magnetic trace region, further extraction of magnetic trace features is performed. These features can include the boundary contours of the magnetic traces, the skeleton centerline, connectivity, extension direction, bifurcation, closure, local width variations, and spatial distribution. Specifically, the binarized magnetic trace region can be refined to obtain a skeleton structure with a single pixel width. Then, a graph structure model is constructed based on the adjacency relationships between pixels in the skeleton structure. Skeleton intersections can be defined as branch nodes, skeleton endpoints as termination nodes, and adjacent skeleton segments as edges. This graph structure model allows for the statistical analysis of the number of connected components, the trunk length of each component, the number of branches, the number of endpoints, the number of closed loops, and local curvature variations.

[0125] Real cracks in magnetic trace images typically appear as slender structures with a clear main extension direction, high connectivity, few branches, and relatively gentle curvature changes. In contrast, pseudo-magnetic traces caused by weld wave reflections, spatter particles, or surface roughness often exhibit short, fragmented, scattered, chaotically branched, or closed and disordered morphologies. Based on this difference, this embodiment characterizes magnetic traces from a structural perspective rather than solely from a grayscale level, making the feature representation closer to the crack formation mechanism.

[0126] Based on the above analysis, this step extracts the internal skeleton structure, connectivity, and morphological organization of magnetic traces to form topological features that reflect the essential structural properties of the magnetic traces, thereby distinguishing real cracks from disordered magnetic traces induced by process noise and surface undulations. Furthermore, this step essentially elevates the discrimination criterion from surface image representation to the structural level, which is beneficial for maintaining stable recognition capabilities under complex welding waves, rough surfaces, and lighting fluctuations.

[0127] S105: Quantitatively evaluate and analyze the topological characteristics of magnetic traces to determine the weld inspection results for the weld area to be inspected.

[0128] In practical implementation, the magnetic trace topological features obtained through S104 are received, and each magnetic trace topological feature is numerically processed based on a preset evaluation rule. This evaluation rule can be established based on experimental data from standard test blocks, statistical results of historical test samples, or expert-annotated samples.

[0129] For example, indicators such as fractal dimension, skeleton connectivity coefficient, skeleton curvature, trunk length, branch density, and directional consistency can be calculated for each connected magnetic trace structure, and these indicators can be input into a scoring model to output the defect confidence score. Among them, fractal dimension can be used to characterize the complexity of the magnetic trace morphology. If the fractal dimension is too high, it usually indicates that the magnetic trace exhibits disordered branches and irregular propagation, and is more likely to be an interfering magnetic trace. Skeleton connectivity coefficient can be used to measure the continuity of the main structure. Magnetic traces corresponding to real cracks often have high connectivity. Skeleton curvature can reflect the degree of bending of the magnetic trace extension path. When the curvature fluctuation is too large, it usually indicates that it is strongly affected by surface noise.

[0130] In one possible embodiment, a comprehensive judgment function F is constructed. F can be expressed as the weighted sum of various topological indices, i.e., F = a1×C + a2×L + a3×D - a4×B - a5×K, where C represents the skeleton connectivity coefficient, L represents the normalized length of the main skeleton, D represents the directional consistency index (i.e., fractal dimension), B represents the branch density per unit length, K represents the curvature fluctuation index (i.e., skeleton curvature), and a1 to a5 represent the corresponding weight parameters. The meaning of this comprehensive judgment function is that higher connectivity, longer main trunks, and more consistent directions result in a closer approximation to the true crack magnetic indication; denser branches and more chaotic bends result in a greater deviation from the true crack characteristics. By comparing F with a preset threshold, the weld detection result can be output. For example, when F is greater than or equal to the crack judgment threshold, a crack is determined to exist; when F is in the re-inspection range, manual review or re-magnetization is required; when F is below the safety threshold, no crack is detected. The aforementioned weight parameters and thresholds can be determined through sample training, experimental calibration, or standard control calibration. Their purpose is to improve the recall rate of real crack detection and reduce the false magnetic trace misjudgment rate.

[0131] In another possible implementation, the magnetic trace topological features can be matched with a preset reference feature library, and the detection category and defect level can be output based on the matching similarity.

[0132] When outputting inspection results, a corresponding inspection report can also be generated. The report includes the workpiece number, weld location, 3D geometric judgment results, magnetic indication image summary, topological feature index value, comprehensive score, and final conclusion. The report is then uploaded to the Manufacturing Execution System, quality traceability platform, or local database to support subsequent review and maintenance analysis. If the inspection result indicates the presence of cracks, the suspected start and end points of the cracks, estimated length, and the area of ​​the weld toe can be further marked to enable rework personnel to quickly locate the defects.

[0133] Based on the above analysis, this step achieves an interpretable mapping from structural features to detection conclusions by quantitatively evaluating and analyzing the topological characteristics of magnetic indices. This makes the weld detection results no longer dependent on a single subjective experience, but based on a quantifiable, comparable, and traceable indicator system.

[0134] This application's embodiments acquire three-dimensional geometric data of the weld area to be inspected and determine whether there is an assembly gap in the weld area based on the three-dimensional geometric data. This enables the identification of structural factors that easily cause interference in magnetic flux leakage characterization before inspection, thereby reducing the risk of misjudgment caused by assembly gaps and weld waveform morphology. By magnetizing the weld area to be inspected when it is determined that there is no assembly gap, target magnetic trace image data is obtained, and magnetic trace features are extracted from the target magnetic trace image data to obtain magnetic trace topological features. This can overcome the limitation of relying solely on grayscale or edge information for identification, thereby enhancing the ability to distinguish between real cracks and structural and process interference. By quantitatively evaluating and analyzing the magnetic trace topological features to determine the weld inspection results of the weld area to be inspected, the accuracy and stability of weld crack identification can be improved, thereby enhancing the reliability of weld inspection under complex surface morphology conditions.

[0135] Based on the above embodiments, obtaining three-dimensional geometric data of the weld area to be inspected includes: scanning the weld area to be inspected using a non-contact three-dimensional measurement method to obtain three-dimensional geometric data, wherein the non-contact three-dimensional measurement method includes at least one of the following: a line structured light-based visual measurement method, a binocular stereo vision measurement method, a phase measurement profilometry method, or a time-of-flight-based three-dimensional measurement method.

[0136] In this embodiment, the line structured light-based visual measurement method can project light stripes using a line laser and collect the offset information of the stripes on the surface to be measured using a camera, then reconstruct the three-dimensional coordinates through triangulation; the binocular stereo vision measurement method can acquire images of the same weld area from two perspectives and recover depth information by combining parallax; the phase measurement profilometry method can project an coded phase pattern onto the weld area and calculate the surface height based on phase changes; the time-of-flight-based three-dimensional measurement method can calculate distance information based on the round-trip time of the emitted light and the echo light. The above measurement methods can be used individually or selected based on site conditions, measurement accuracy, and cycle time requirements; this embodiment does not impose any limitations on this.

[0137] This application embodiment acquires the spatial morphology of the weld area through non-contact three-dimensional measurement, avoiding interference with the surface caused by contact measurement and improving the adaptability to complex weld surfaces. Since the obtained three-dimensional geometric data can accurately reflect the geometric relationship between the weld toe, weld root, and adjacent base material, it can provide reliable input for subsequent judgment of assembly gaps based on three-dimensional geometric data, thereby reducing the probability of misjudgment caused by structural undulations or assembly deviations and improving the stability and consistency of weld inspection results.

[0138] Based on the above embodiments, in some examples, determining whether there is an assembly gap in the weld area to be inspected based on three-dimensional geometric data includes: extracting the continuity features of the cross-sectional profile of the weld root in the three-dimensional geometric data; analyzing the continuity features to determine whether there is a height jump region in the weld area to be inspected; if there is a height jump region, it is determined that there is an assembly gap in the weld area to be inspected; if there is no height jump region, it is determined that there is no assembly gap in the weld area to be inspected.

[0139] In this example, the continuity feature of the weld root cross-sectional profile is used to reflect the degree of coherence of the weld root cross-section in the spatial direction, and the height jump region is used to indicate whether there are abrupt steps or discontinuous transitions in the local profile.

[0140] In practical implementation, after performing a three-dimensional scan of the weld area to be inspected, a cross-section perpendicular to the weld extension direction is first taken at the weld root. This cross-section is then contoured to obtain a continuous curve or discrete contour point set that characterizes the root boundary. Subsequently, the height values ​​of the discrete contour point set are analyzed for continuity. When the height difference between adjacent points remains gradual within a local range and the overall contour is continuous, the region is determined to have no significant height jump. When the discrete contour point set exhibits a height abrupt change exceeding a preset threshold at a local location, and this abrupt change has a continuous extension characteristic, the region is identified as a height jump region. This preset threshold can be set according to the weld joint type, measurement resolution, and workpiece material; for example, it can be taken as several times the average height fluctuation of the contour to improve the ability to identify misaligned edges, root misfitting, and local gaps.

[0141] When a height jump region is identified, the corresponding geometric anomaly is interpreted as an opening in the root space caused by the assembly gap, and a judgment result indicating the existence of an assembly gap is output accordingly. When no height jump region is identified, the root fit of the weld area to be inspected is considered to be continuous, and a judgment result indicating the absence of an assembly gap is output.

[0142] Figure 3 This is a three-dimensional point cloud topography image provided in an embodiment of this application when there is no assembly gap. Figure 4 This is a three-dimensional point cloud topography image provided in an embodiment of this application when there is an assembly gap. Figure 5 A comparison diagram of the cross-sectional contour lines provided for embodiments of this application. For example... Figure 3 , 4 As shown in Figure 5, the root transition of the 3D point cloud topography without assembly gaps is smooth; the root of the 3D point cloud topography with assembly gaps has obvious geometric jumps; by extracting the discontinuous features of the contour lines, the numerical values ​​of the height jump regions can be quantitatively obtained, thus providing a basis for determining the assembly gaps.

[0143] In summary, the embodiments of this application distinguish structural anomalies from crack-like anomalies by identifying regions of height abrupt changes, thereby improving the stability and accuracy of subsequent weld inspection and enhancing the engineering applicability in complex T-joint scenarios.

[0144] Based on the aforementioned embodiments, further, magnetic trace features are extracted from the target magnetic trace image data to obtain magnetic trace topological features, including: using a magnetic trace topological feature extraction algorithm to extract magnetic trace features from the target magnetic trace image data to obtain magnetic trace topological features, wherein the magnetic trace topological feature extraction algorithm includes one of the following: a local iterative thinning algorithm, a distance transformation-based median extraction algorithm, a mathematical morphology-based extraction algorithm, or a deep learning-based feature extraction algorithm.

[0145] Among them, magnetic trace features refer to image information in the target magnetic trace image data that can characterize the magnetic powder aggregation morphology, connectivity, extension direction and branching features. Magnetic trace topological features are used to further describe the connectivity, skeleton morphology and local curvature changes of the magnetic trace in structure, so as to convert the original pixel information into a structured representation that is easy to quantitatively evaluate later. Specifically, magnetic trace topological features include any one or more of the following: statistical features that characterize the complexity of the magnetic trace, geometric features that characterize the continuity of the magnetic trace extension, and morphological features that characterize the degree of local curvature of the magnetic trace.

[0146] In practical implementation, when using a local iterative thinning algorithm, the target magnetic smear image data is first binarized, and then the magnetic smear region is subjected to local iterative shrinkage to gradually remove boundary pixels while retaining the central skeleton, until a one-pixel-wide main structure of the magnetic smear is obtained, thereby extracting topological features that reflect the continuity of the magnetic smear. When the target magnetic smear image has a lot of noise or the magnetic smear boundaries are irregular, this algorithm can reduce skeleton breakage through local neighborhood constraints and maintain the coherence of the main branches of the magnetic smear.

[0147] When using a distance-transform-based centerline extraction algorithm, the distance distribution from each pixel within the magnetic trace region to the background boundary can be calculated first. Then, the centerline or centerline curve can be extracted along the peak distance position to obtain the center direction and main distribution trend of the magnetic trace. This algorithm is suitable for extracting the topological structure of elongated, curved, or locally expanded magnetic traces and can effectively characterize the centerline offset, width variation, and local aggregation features of the magnetic trace.

[0148] When using mathematical morphology-based extraction algorithms, erosion, dilation, opening, closing, or thinning operations can be sequentially performed on the target magnetic trace image data to suppress isolated noise, fill in small fractures, and preserve the effective magnetic trace structure. Combined with connected component analysis, the number of branches, connectivity length, and endpoint distribution of the magnetic traces are obtained, thus forming the topological features of the magnetic traces. This method has good adaptability to local interference caused by surface reflections on welds.

[0149] When using a deep learning-based feature extraction algorithm, the target magnetic trace image data can be input into a pre-trained feature extraction network. The feature extraction network automatically learns the edge, texture, and structural association information of the magnetic trace and outputs the topological representation of the magnetic trace. This feature extraction network may include a convolutional feature extraction module and a structure mapping module to achieve semantic representation of complex magnetic trace morphologies. In practical applications, other models can also be selected for this network, and this application embodiment does not limit this.

[0150] This implementation converts the original magnetic field image into magnetic field topological features, enabling subsequent evaluation to be based directly on the connectivity, trunk morphology, and branching relationships of the magnetic field, avoiding misjudgments caused by relying solely on grayscale intensity. Since different extraction algorithms can output structured magnetic field information in various scenarios, this technical solution can adapt to detection environments with varying magnetic field morphologies and complex weld backgrounds.

[0151] By adopting this specific method, the representation of magnetic trace features is transformed from two-dimensional pixel information into topological structure information, which helps improve the identification stability of crack-type magnetic traces and reduces interference caused by weld waves, reflections, and stray magnetic particles. At the same time, the extracted magnetic trace topological features have strong comparability and quantifiability, facilitating subsequent evaluation of length, connectivity, branching degree, and morphological complexity, thereby improving the accuracy and consistency of weld inspection results.

[0152] In one possible implementation, when the magnetic trace topology feature extraction algorithm is a local iterative thinning algorithm, the magnetic trace features in the target magnetic trace image data are extracted using the magnetic trace topology feature extraction algorithm to obtain the magnetic trace topology features. This includes: performing image binarization processing on the target magnetic trace image data to obtain a binary image, which includes foreground pixels and background pixels; iteratively executing the following clauses on the binary image until the state of all pixels in the binary image remains unchanged: marking the first group of foreground pixels to be deleted based on a first preset rule, wherein the first preset rule includes: the number of connections of the first group of foreground pixels is 1, the number of background pixels in the 8-neighborhood of the first group of foreground pixels is 2 to 6, and the 8-neighborhood of the first group of foreground pixels satisfies a first topological constraint. The conditions are as follows: the first topological constraint is that there is no pattern that satisfies the preset connectivity break within the 8-neighborhood of the first group of foreground pixels; the second group of foreground pixels to be deleted is marked based on the second preset rule, wherein the second preset rule includes: the number of connections of the second group of foreground pixels is 1, the number of background pixels within the 8-neighborhood of the second group of foreground pixels is 2 to 6, and the 8-neighborhood of the second group of foreground pixels satisfies the second topological constraint, which is that there is no pattern that satisfies the preset symmetry violation within the 8-neighborhood of the second group of foreground pixels; the marked first group of foreground pixels and the second group of foreground pixels are updated to background pixels; the binary image after the iteration stops is used as skeleton image data, and magnetic trace features are extracted from the skeleton image data to obtain magnetic trace topological features.

[0153] Image binarization converts the grayscale information in the target magnetic trace image data into a binary representation. Typically, a global threshold or a local adaptive threshold is used to distinguish bright areas of the magnetic trace from dark areas of the background, thus separating the magnetic trace outline from complex textures. Foreground pixels represent the main region of the magnetic trace, while background pixels represent non-trace regions. This division facilitates subsequent topological processing of the slender magnetic trace structure. The connectivity number represents the number of foreground connected components within a pixel's neighborhood, the 8-neighborhood describes the state of pixels in eight directions surrounding the target pixel, and the skeleton image data represents the thinned, single-pixel-wide magnetic trace backbone.

[0154] In practical implementation, the acquired magnetic trace image can first be denoised and contrast-enhanced, and then a binary image can be obtained by fixed threshold segmentation or adaptive threshold segmentation. Subsequently, the foreground pixels in the binary image are used as the processing objects. During the iterative thinning process, it is determined whether the pixels can be deleted based on the local constraints in two directions, and the connectivity and endpoint structure of the magnetic trace backbone are maintained after deletion.

[0155] The skeleton image data obtained after the iteration stops retains the extension direction, bifurcation relationship, endpoint distribution and local connectivity features of the magnetic traces. Based on this, the topological features of the magnetic traces, such as length, number of branches, tortuosity, endpoint position and connectivity path, are extracted to form a structured description for crack identification.

[0156] This processing method compresses a wide magnetic smear region into a single-pixel skeleton through local iterative refinement. This reduces the impact of magnetic smear width fluctuations, grayscale inhomogeneity, and local adhesion on feature extraction, while preserving the slender and continuous topological structure typically found in real cracks. By employing two local deletion rules combined with connectivity and neighborhood constraints, the refinement process reduces erroneous deletion of endpoints and key branches, resulting in a skeleton that more closely approximates the centerline morphology of the original magnetic smear. Consequently, it improves the stability and repeatability of the magnetic smear topological features and provides more reliable input features for subsequent quantitative assessment of weld cracks, thereby enhancing the accuracy and anti-interference capability of weld detection results.

[0157] In one possible implementation, when it is determined that there is no assembly gap, the weld area to be inspected is magnetized to obtain target magnetic indication image data, including: when it is determined that there is no assembly gap, using magnetic particle testing to magnetize the weld area to be inspected to obtain initial magnetic indication image data; performing image preprocessing on the initial magnetic indication image data to obtain preprocessed initial magnetic indication image data; and performing enhancement processing on the preprocessed initial magnetic indication image data to obtain target magnetic indication image data, wherein the enhancement processing includes any one or more combinations of multi-scale morphological filtering enhancement, contrast stretching, histogram equalization, or frequency domain filtering enhancement.

[0158] Magnetic particle inspection is a non-destructive testing method that utilizes the leakage magnetic field on and near the surface of a magnetized workpiece to attract magnetic particles and form magnetic traces. The initial magnetic trace image data is the raw image data obtained by an image acquisition device imaging the magnetic trace area. Image preprocessing may include noise reduction, grayscale normalization, background subtraction, and region of interest cropping to suppress the influence of weld wave reflections, spatter particles, and local shadows on the image. Enhancement processing is used to highlight the linear or discontinuous magnetic traces corresponding to cracks, making the magnetic trace boundaries more continuous and the contrast more obvious, thereby facilitating subsequent feature extraction.

[0159] In practice, after confirming the absence of assembly gaps in the weld area to be inspected, the area enters the magnetization stage. Fluorescent magnetic suspension is sprayed onto the gap-free sample, with a concentration ranging from 0.1 mL / 100 mL to 0.5 mL / 100 mL; for example, the concentration can be set to 0.2 mL / 100 mL. The T-joint is then magnetized using a magnetic particle inspection machine (e.g., CDX-III). Subsequently, an ultraviolet excitation light source directly irradiates the weld area to be inspected, causing the magnetic particles at the defect to aggregate into a distinct fluorescent magnetic trace. During image acquisition, a camera captures the initial magnetic trace image data under ultraviolet excitation. Furthermore, to ensure imaging quality in a non-darkroom environment, the camera exposure parameters can be adjusted or a filter can be added to suppress ambient background light and highlight the magnetic trace features.

[0160] Next, the initial magnetic field image data is enhanced to obtain the target magnetic field image data. The enhancement process includes any one or more combinations of multi-scale morphological filtering enhancement, contrast stretching, histogram equalization, or frequency domain filtering enhancement.

[0161] After adopting the above enhancement processing method, the clarity and contrast of the magnetic trace image are improved, and the crack magnetic trace is more easily separated from the complex background, thereby improving the stability and reliability of the weld detection results and enhancing the engineering applicability of the method in complex weld scenarios such as T-joints.

[0162] In one possible implementation, when the enhancement processing is a multi-scale morphological filtering enhancement, the initial magnetic trace image data is enhanced to obtain the target magnetic trace image data, including: processing the initial magnetic trace image data with a first morphological operator to generate a first intermediate image; processing the initial magnetic trace image data with a second morphological operator to obtain a second intermediate image; and performing a weighted summation of the first intermediate image and the second intermediate image to obtain the target magnetic trace image data.

[0163] In this implementation, multi-scale morphological filtering enhancement is used to differentiate the processing of subtle magnetic traces and background noise in the image using structuring elements of different scales, thereby enhancing the linear or strip-like features corresponding to the crack. The first and second morphological operators can be selected as two of the following: opening operation, closing operation, top-hat transformation, or bottom-hat transformation, respectively. Their structuring elements can be linear, disk, or cross-shaped structuring elements of different sizes. When using structuring elements of different scales, smaller-scale structuring elements are used to preserve the edges of fine cracks and discontinuous magnetic traces, while larger-scale structuring elements are used to smooth weld reinforcement, weld wave undulations, and local background abrupt changes. Therefore, image features can be extracted at different spatial levels.

[0164] In the specific implementation, a first morphological operator is applied to the initial magnetic field image data to form a first intermediate image. This first intermediate image is used to highlight narrow magnetic fields, weak magnetic fields, and local continuous textures. A second morphological operator is applied to the same initial magnetic field image data to form a second intermediate image. This second intermediate image is used to suppress local bright spots, splash noise, and irregular background undulations. Subsequently, the first and second intermediate images are weighted and summed according to preset weight coefficients. These weight coefficients can be set based on image contrast, background complexity, or magnetic field response intensity, so that the target magnetic field image data enhances the grayscale difference between the target area and the background area while preserving detailed information. This weighted summation process can be performed at the pixel level or linearly fused after normalization to avoid over-smoothing or edge loss caused by a single morphological processing.

[0165] This enhancement process extracts magnetic indication information from different scales using two morphological operators, and then uses weighted fusion to form the final image. This simultaneously enhances crack details and suppresses false magnetic indication interference under complex background conditions, thereby improving the stability and accuracy of subsequent magnetic indication feature extraction. Because the crack edges in the target magnetic indication image data are more continuous and clear, and the magnetic indication topology is easier to separate and identify, it effectively reduces the probability of false detections and missed detections, and improves the reliability of T-joint weld crack detection results.

[0166] Based on the aforementioned embodiments, a further step is to quantitatively evaluate and analyze the topological features of magnetic indications to determine the weld detection results of the weld area to be detected. This includes: quantitatively evaluating and analyzing the topological features of magnetic indications, calculating evaluation indicators characterizing the morphology of magnetic indications, wherein the evaluation indicators include fractal dimension, skeleton connectivity coefficient, and skeleton curvature; and determining the weld detection results based on the evaluation indicators.

[0167] The fractal dimension D, using box-counting dimension, characterizes the complexity of the magnetic trace topological features. A higher fractal dimension generally indicates a more irregular magnetic trace morphology, and is more likely to correspond to leakage magnetic field propagation features caused by cracks. The fractal dimension D can be calculated using the following formula:

[0168] .

[0169] in, Indicates the grid side length. The number of meshes required to cover the magnetic trace topology framework. Real crack lines are simple, and their value is usually close to 1; while coarse weld waves, due to their numerous and fragmented branches, have a value significantly greater than 1.

[0170] The skeleton connectivity coefficient C is used to characterize the continuity and connectivity of the magnetic trace skeleton. A high skeleton connectivity coefficient indicates strong continuity of the magnetic trace backbone, which is beneficial for identifying linear defects. A low skeleton connectivity coefficient indicates that the magnetic trace may have breaks, bifurcations, or noise interference. The skeleton connectivity coefficient C can be calculated using the following formula:

[0171] .

[0172] in, The pixel length of the largest connected component (i.e., the longest backbone) in the topological skeleton; This represents the total pixel length of all skeleton branches within this region.

[0173] The skeleton curvature K is used to characterize the degree of bending variation of the magnetic trace skeleton. It can reflect the turning points, offsets, and curve undulations of the magnetic trace in local areas, thus helping to determine whether the magnetic trace has a typical crack morphology. The skeleton curvature K can be calculated using the following formula:

[0174] .

[0175] in, This represents the total number of pixels along the skeleton line. For the first Local curvature at each pixel.

[0176] In the specific implementation, the extracted magnetic trace topological features are first subjected to skeleton analysis and contour analysis. A topological representation is constructed based on the magnetic trace pixel set, and then the fractal dimension, skeleton connectivity coefficient, and skeleton curvature are calculated. The fractal dimension can be obtained through box counting or equivalent dimension estimation. The skeleton connectivity coefficient can be calculated by normalizing the relationship between the number of skeleton connected branches, the number of broken segments, and the length of the main trunk. The skeleton curvature can be obtained by calculating the curvature integral or average curvature value based on the coordinates of discrete points on the skeleton centerline. Subsequently, each evaluation index is compared with a preset threshold, reference interval, or discriminant model. When the fractal dimension exceeds the preset complexity threshold and the skeleton connectivity coefficient meets the continuity criterion, and the skeleton curvature exhibits bending characteristics matching the crack magnetic trace, it is determined that a defect exists in the weld area to be detected. When all evaluation indices fall within the normal reference range, it is determined that no weld defect was detected in the weld area to be detected.

[0177] By jointly evaluating the topological features of magnetic indications using fractal dimension, skeleton connectivity coefficient, and skeleton curvature, the original reliance on manual experience in magnetic indication judgment can be transformed into a quantifiable and objective discrimination process. This enhances the ability to distinguish between linear crack magnetic indications, discontinuous magnetic indications, and noise artifacts. This method maintains good stability and consistency under complex weld surface conditions, reduces the probability of false positives and false negatives, and improves the accuracy and repeatability of weld inspection results.

[0178] Next, taking the detection of weld cracks in a T-joint as an example, we will explain how to utilize the weld detection method provided in the embodiments of this application. Figure 6 A flowchart illustrating the weld inspection method provided in this application embodiment. Figure 2 .like Figure 6 As shown, the method includes the following steps:

[0179] Step S1: Obtain the three-dimensional geometric data of the weld area to be inspected in the T-joint;

[0180] Step S2: Based on the three-dimensional geometric data, compare it with the preset assembly standard to determine whether there is an assembly gap in the T-joint; if there is an assembly gap, terminate the detection process of the current sample and proceed to the detection of the next sample; if there is no assembly gap, proceed to step S3.

[0181] Step S3: Magnetize the weld area to be inspected in the T-joint without assembly gap using magnetic particle testing technology to obtain magnetic trace image data;

[0182] Step S4: Enhance the magnetic trace image data and extract features from the enhanced magnetic trace image data to obtain the magnetic trace topological features;

[0183] Step S5: Perform quantitative evaluation and analysis based on the topological characteristics of magnetic traces, and calculate the quantitative evaluation index characterizing the morphology of magnetic traces;

[0184] Step S6: Based on the quantitative evaluation indicators, determine the cracks in the weld area to be inspected in the T-joint, that is, determine whether the weld area to be inspected in the T-joint is a real weld crack or a rough weld bead.

[0185] Furthermore, Figure 7 A flowchart illustrating the extraction of magnetic trace topological features provided in an embodiment of this application. Figure 7 As shown, the enhancement processing of magnetic trace image data and the extraction of magnetic trace topological features specifically include the following steps:

[0186] Image preprocessing. The green channel is extracted from the magnetic trace image data to achieve preliminary separation of the magnetic trace region from the background, resulting in the extracted magnetic trace image data.

[0187] Magnetic Imprint Enhancement. To address the issue that traditional single-scale top-hat transform cannot simultaneously capture the characteristics of magnetic imprints at different sizes, a dual-scale morphological operator cascade strategy is employed, combined with a small-scale kernel. With large-scale nuclei The extracted magnetic trace image data is then subjected to magnetic trace feature enhancement, as shown in the following formula:

[0188] .

[0189] In the above formula, This represents the enhanced magnetic trace image data. , These are preset small-scale and large-scale feature weight coefficients. By adjusting the weights, the details of magnetic traces of different thicknesses in the same image can be enhanced synchronously.

[0190] It should be noted that the values ​​of k1 and k2 can be set according to the actual situation; for example, k1 can be set to 25 and k2 to 55. , The value can be flexibly adjusted between 0.1 and 1.0 according to actual working conditions (such as magnetic powder concentration, ambient light intensity, and sensor sensitivity) to achieve the best background suppression effect and magnetic indication signal-to-noise ratio. For example, Set to 0.5. Set it to 0.5.

[0191] Figure 8 This is a comparison diagram of pixel intensity distribution provided in an embodiment of this application. Figure 8 As shown, the original image has high and fluctuating background noise; the single-scale algorithm causes attenuation of the target signal while reducing noise; the dual-scale morphological operator cascade strategy provided in this application embodiment filters out background clutter while completely preserving the peak intensity of the magnetic indices. In summary, the dual-scale morphological operator cascade strategy adopted in this application embodiment has significant advantages in suppressing complex background noise and improving the signal-to-noise ratio of fine cracks, providing a high-quality data foundation for subsequent topological feature extraction.

[0192] Image binarization. A dynamic thresholding method is used to binarize the enhanced magnetic trace image data. This method constructs a threshold function by extracting the mean and standard deviation of the local neighborhood of each pixel in the enhanced magnetic trace image data, thereby obtaining a binary image, as shown in the following formula:

[0193] .

[0194] in, Represents the mean of the local neighborhood of a pixel. That is the standard deviation. The final binary image, The adjustment is used to adjust the background noise suppression intensity. The value can be set according to the actual situation, for example, by setting... Set it to 0.5.

[0195] Morphological processing. Closure operations are used to fill internal holes in the binary image to repair broken magnetic traces and ensure the connectivity of the magnetic trace network.

[0196] Region segmentation. Based on connected component analysis, aspect ratio and area are used as dual indicators to filter the morphologically processed binary image to segment the magnetic trace region;

[0197] Feature extraction. The Zhang-Suen algorithm is applied to the segmented magnetic smudge region to converge the magnetic smudge network into a topological skeleton with a width of one pixel, thus obtaining the final magnetic smudge topological features. The principle of the Zhang-Suen algorithm has been explained in detail in the previous embodiments.

[0198] Furthermore, Figure 9 Comparison diagrams of the magnetic trace topology of cracks provided in embodiments of this application. Figure 10 A comparison diagram of the magnetic trace topology skeleton with that of a rough weld wave, provided for an embodiment of this application. From Figure 9 , 10 It can be seen that there are significant differences in their topological morphology. The magnetic traces of a crack are continuous, smooth, linear structures, while the magnetic traces of a rough weld wave exhibit numerous short, burr-like branches. In the quantitative calculations of this embodiment, the crack's fractal dimension is approximately 1.05, its skeleton connectivity coefficient reaches 0.92, and its skeleton curvature is 2.48. In contrast, the fractal dimension of the rough weld wave significantly increases to over 1.25, its skeleton connectivity coefficient decreases to 0.2, and its skeleton curvature is 1.184. Therefore, by extracting the topological features of the magnetic traces, and based on the fractal dimension, skeleton curvature, and skeleton connectivity coefficient, cracks can be effectively identified.

[0199] In summary, compared with the prior art, the method provided in this application has the following beneficial effects:

[0200] By utilizing three-dimensional imaging technology, assembly gap interference can be eliminated at the macroscopic source. This application's embodiments extract the spatial morphological features of the weld seam using three-dimensional imaging technology, enabling pre-identification of assembly gaps before magnetic particle inspection, thus eliminating structural pseudo-magnetic trace interference caused by poor assembly at its source.

[0201] By extracting the topological features of magnetic indices, a distinction is achieved between real cracks and rough weld beads at the microscopic level. This application's embodiments extract the single-pixel topological skeleton of magnetic indices using a dual-scale top-hat transform and the Zhang-Suen thinning algorithm, achieving a precise quantitative description of magnetic indices' features at the microscopic morphological level. By combining fractal dimension, skeleton connectivity coefficient, and skeleton curvature, the single linear features of real microcracks can be effectively decoupled from the dendritic pseudo-magnetic indices caused by surface roughness.

[0202] A macro- and micro-level multi-feature collaborative discrimination mechanism is adopted to reduce the false detection rate. This application's embodiments construct a macro- and micro-level combined collaborative discrimination mechanism, breaking through the limitations of traditional two-dimensional vision, effectively overcoming the interference of false magnetic traces caused by assembly gaps and rough weld waves, and improving the overall accuracy and reliability of detection.

[0203] Figure 11 This is a schematic diagram of the weld inspection device provided in the embodiments of this application, as shown below. Figure 11 As shown, the weld inspection device provided in this embodiment includes:

[0204] The acquisition module 1101 is used to acquire the three-dimensional geometric data of the weld area to be inspected;

[0205] The judgment module 1102 is used to determine whether there is an assembly gap in the weld area to be inspected based on three-dimensional geometric data.

[0206] The magnetization processing module 1103 is used to magnetize the weld area to be inspected when it is determined that there is no assembly gap, so as to obtain target magnetic trace image data.

[0207] Extraction module 1104 is used to extract magnetic trace features from the target magnetic trace image data to obtain magnetic trace topological features;

[0208] The determination module 1105 is used to quantitatively evaluate and analyze the topological features of magnetic traces and determine the weld inspection results of the weld area to be inspected.

[0209] In one possible embodiment, the acquisition module 1101 is specifically used for:

[0210] A non-contact three-dimensional measurement method is used to scan the weld area to be inspected and obtain three-dimensional geometric data. The non-contact three-dimensional measurement method includes at least one of the following: a line structured light-based visual measurement method, a binocular stereo vision measurement method, a phase measurement profilometry method, or a time-of-flight-based three-dimensional measurement method.

[0211] In one possible embodiment, the determining module 1102 is specifically used for:

[0212] Extract the continuity features of the cross-sectional profile at the weld root from the three-dimensional geometric data;

[0213] Analyze the continuity characteristics to determine whether there are regions of height abrupt change in the weld area to be inspected;

[0214] If a region of height abrupt change exists, it is determined that there is an assembly gap in the area of ​​the weld to be inspected;

[0215] If there is no region of height abrupt change, it is determined that there is no assembly gap in the weld area to be inspected.

[0216] In one possible embodiment, the extraction module 1104 is specifically used for:

[0217] The magnetic trace topology feature extraction algorithm is used to extract magnetic trace features from the target magnetic trace image data to obtain magnetic trace topology features. The magnetic trace topology feature extraction algorithm includes one of the following: a local iterative thinning algorithm, a distance transformation-based median extraction algorithm, a mathematical morphology-based extraction algorithm, or a deep learning-based feature extraction algorithm.

[0218] In one possible embodiment, the extraction module 1104 is specifically used for:

[0219] The target magnetic trace image data is binarized to obtain a binary image, which includes foreground pixels and background pixels.

[0220] The following sub-steps are iteratively performed on the binary image until the state of all pixels in the binary image remains unchanged: First, a first group of foreground pixels to be deleted is marked based on a first preset rule, wherein the first preset rule includes: the number of connections in the first group of foreground pixels is 1, the number of background pixels in the 8-neighborhood of the first group of foreground pixels is 2 to 6, and the 8-neighborhood of the first group of foreground pixels satisfies a first topological constraint condition, wherein the first topological constraint condition is: there is no pattern satisfying a preset connectivity break within the 8-neighborhood of the first group of foreground pixels; Second, a second group of foreground pixels to be deleted is marked based on a second preset rule, wherein the second preset rule includes: the number of connections in the second group of foreground pixels is 1, the number of background pixels in the 8-neighborhood of the second group of foreground pixels is 2 to 6, and the 8-neighborhood of the second group of foreground pixels satisfies a second topological constraint condition, wherein the second topological constraint condition is: there is no pattern satisfying a preset symmetry violation within the 8-neighborhood of the second group of foreground pixels; The marked first group of foreground pixels and second group of foreground pixels are updated to background pixels;

[0221] The binary image after the iteration stops is used as the skeleton image data, and magnetic trace features are extracted from the skeleton image data to obtain the magnetic trace topological features.

[0222] In one possible embodiment, the magnetization processing module 1103 is specifically used for:

[0223] When it is determined that there is no assembly gap, magnetic particle testing is used to magnetize the weld area to be inspected and obtain initial magnetic trace image data.

[0224] Image preprocessing is performed on the initial magnetic indication image data to obtain preprocessed initial magnetic indication image data;

[0225] The preprocessed initial magnetic trace image data is enhanced to obtain the target magnetic trace image data. The enhancement process includes any one or more combinations of multi-scale morphological filtering enhancement, contrast stretching, histogram equalization, or frequency domain filtering enhancement.

[0226] In one possible embodiment, the determining module 1105 is specifically used for:

[0227] The initial magnetic trace image data is processed using a first morphological operator to generate a first intermediate image;

[0228] The initial magnetic trace image data is processed using a second morphological operator to obtain a second intermediate image;

[0229] The first and second intermediate images are weighted and summed to obtain the target magnetic trace image data.

[0230] In one possible embodiment, the determining module 1105 is specifically used for:

[0231] Quantitative evaluation and analysis of the topological characteristics of magnetic traces are performed, and evaluation indicators characterizing the morphology of magnetic traces are calculated. Among them, the evaluation indicators include fractal dimension, skeleton connectivity coefficient and skeleton curvature.

[0232] The weld inspection results are determined based on the evaluation indicators.

[0233] The weld inspection device provided in this embodiment can perform the method provided in the above method embodiment. Its implementation principle and technical effect are similar, and will not be described in detail here.

[0234] It should be noted that the division of the various modules in the above device is merely a logical functional division. In actual implementation, they can be fully or partially integrated into a single physical entity, or they can be physically separated. Furthermore, these modules can be implemented entirely in software via processing element calls; they can be fully implemented in hardware; or some modules can be implemented by processing element calls to software, while others are implemented in hardware. For example, a processing module can be a separate processing element, or it can be integrated into a chip within the device. Alternatively, it can be stored as program code in the device's memory, and its functions can be called and executed by a processing element. The implementation of other modules is similar. Moreover, these modules can be fully or partially integrated together, or they can be implemented independently. The processing element here can be an integrated circuit with signal processing capabilities. During implementation, each step of the above method or each of the above modules can be completed through integrated logic circuits in the hardware of the processor element or through software instructions.

[0235] For example, these modules can be one or more integrated circuits configured to implement the above methods, such as one or more Application Specific Integrated Circuits (ASICs), one or more Digital Signal Processors (DSPs), or one or more Field Programmable Gate Arrays (FPGAs). As another example, when a module is implemented using processing element scheduler code, the processing element can be a general-purpose processor, such as a Central Processing Unit (CPU) or other processor capable of calling program code. Furthermore, these modules can be integrated together as a System-On-a-Chip (SOC).

[0236] Figure 12 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Figure 12 As shown, the electronic device 1200 provided in this application embodiment may include: a processor 1201, and a memory 1202 communicatively connected to the processor, wherein:

[0237] The memory stores the instructions that the computer executes;

[0238] The processor executes computer execution instructions stored in memory to implement the method described in the foregoing method embodiments.

[0239] It should be understood that processor 1201 can be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), etc. A general-purpose processor can be a microprocessor or any conventional processor. The steps of the method disclosed in the application can be directly manifested as being executed by a hardware processor, or executed by a combination of hardware and software modules within the processor. Memory 1202 may include high-speed random access memory (RAM), and may also include non-volatile memory (NVM), such as at least one disk storage device, or a USB flash drive, external hard drive, read-only memory, disk, or optical disc, etc.

[0240] Optionally, the electronic device 1200 may also include a communication interface 1203. In specific implementations, if the communication interface 1203, memory 1202, and processor 1201 are implemented independently, they can be interconnected via a bus to complete communication. The bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. Buses can be categorized as address buses, data buses, control buses, etc., but this does not imply that there is only one bus or one type of bus.

[0241] Optionally, in a specific implementation, if the communication interface 1203, memory 1202 and processor 1201 are integrated on a single chip, then the communication interface 1203, memory 1202 and processor 1201 can communicate through an internal interface.

[0242] This application also provides a computer-readable storage medium storing computer-executable instructions, which, when executed, are used to implement the methods described in any of the foregoing embodiments.

[0243] It is understood that the computer-readable storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as Static Random Access Memory (SRAM), Electrically Erasable Programmable Read Only Memory (EEPROM), Erasable Programmable Read Only Memory (EPROM), Programmable Read Only Memory (PROM), Read Only Memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk. The readable storage medium can be any available medium accessible to a general-purpose or special-purpose computer.

[0244] An exemplary computer-readable storage medium is coupled to a processor, enabling the processor to read information from and write information to the computer-readable storage medium. Of course, the computer-readable storage medium can also be a component of the processor. The processor and the computer-readable storage medium can reside in an ASIC. Alternatively, the processor and the computer-readable storage medium can exist as discrete components in an electronic device.

[0245] The integrated modules implemented as software functional modules described above can be stored in a computer-readable storage medium. These software functional modules, stored in a computer-readable storage medium, include several instructions to cause an electronic device (which may be a personal computer, server, or network device, etc.) or processor to execute some steps of the methods described in the various embodiments of this application.

[0246] This application also provides a computer program product, including a computer program that, when executed, implements the method described in any of the foregoing embodiments.

[0247] It should be noted that, for the sake of simplicity, the foregoing method embodiments are all described as a series of actions. However, those skilled in the art should understand that this application is not limited to the described order of actions, as some steps may be performed in other orders or simultaneously according to this application. Furthermore, those skilled in the art should also understand that the embodiments described in the specification are all optional embodiments, and the actions and modules involved are not necessarily essential to this application.

[0248] It should be further noted that although the steps in the flowchart are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowchart may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the sub-steps or stages of other steps.

[0249] In the above embodiments, the descriptions of each embodiment have their own emphasis. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions of other embodiments. The technical features of the above embodiments can be combined arbitrarily. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as the combination of these technical features does not contradict each other, it should be considered within the scope of this specification.

[0250] Other embodiments of this application will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of this application that follow the general principles of this application and include common knowledge or customary techniques in the art not disclosed herein. The specification and examples are to be considered exemplary only, and the true scope and spirit of this application are indicated by the following claims.

[0251] It should be understood that this application is not limited to the precise structure described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of this application is limited only by the appended claims.

Claims

1. A weld inspection method, characterized in that, include: Acquire the three-dimensional geometric data of the weld area to be inspected; Based on the three-dimensional geometric data, determine whether there is an assembly gap in the weld area to be inspected; If it is determined that there is no assembly gap, the area of ​​the weld to be inspected is magnetized to obtain target magnetic trace image data; Extract magnetic trace features from the target magnetic trace image data to obtain magnetic trace topological features; The magnetic trace topological features are quantitatively evaluated and analyzed to determine the weld inspection results of the weld area to be inspected.

2. The method according to claim 1, characterized in that, The acquisition of the three-dimensional geometric data of the weld area to be inspected includes: A non-contact three-dimensional measurement method is used to scan the weld area to be inspected to obtain the three-dimensional geometric data. The non-contact three-dimensional measurement method includes at least one of the following: a line structured light-based visual measurement method, a binocular stereo vision measurement method, a phase measurement profilometry method, or a time-of-flight-based three-dimensional measurement method.

3. The method according to claim 1 or 2, characterized in that, The step of determining whether there is an assembly gap in the weld area to be inspected based on the three-dimensional geometric data includes: Extract the continuity features of the cross-sectional profile at the weld root from the three-dimensional geometric data; Analyze the continuity characteristics to determine whether there is a region of height abrupt change in the weld area to be inspected; If the height jump region exists, it is determined that there is an assembly gap in the weld area to be inspected; If the height jump region does not exist, it is determined that there is no assembly gap in the weld area to be inspected.

4. The method according to claim 1 or 2, characterized in that, The step of extracting magnetic trace features from the target magnetic trace image data to obtain magnetic trace topological features includes: The magnetic trace topology feature extraction algorithm is used to extract magnetic trace features from the target magnetic trace image data to obtain magnetic trace topology features. The magnetic trace topology feature extraction algorithm includes one of the following: a local iterative thinning algorithm, a distance transformation-based median extraction algorithm, a mathematical morphology-based extraction algorithm, or a deep learning-based feature extraction algorithm.

5. The method according to claim 4, characterized in that, When the magnetic trace topology feature extraction algorithm is a local iterative thinning algorithm, the step of using the magnetic trace topology feature extraction algorithm to extract magnetic trace features from the target magnetic trace image data to obtain magnetic trace topology features includes: The target magnetic trace image data is subjected to image binarization processing to obtain a binary image, which includes foreground pixels and background pixels; The following sub-steps are iteratively performed on the binary image until the state of all pixels in the binary image remains unchanged: First, a first group of foreground pixels to be deleted is marked based on a first preset rule, wherein the first preset rule includes: the number of connections in the first group of foreground pixels is 1, the number of background pixels in the 8-neighborhood of the first group of foreground pixels is 2 to 6, and the 8-neighborhood of the first group of foreground pixels satisfies a first topological constraint condition, wherein the first topological constraint condition is: there is no pattern satisfying a preset connectivity break within the 8-neighborhood of the first group of foreground pixels; Second, a second group of foreground pixels to be deleted is marked based on a second preset rule, wherein the second preset rule includes: the number of connections in the second group of foreground pixels is 1, the number of background pixels in the 8-neighborhood of the second group of foreground pixels is 2 to 6, and the 8-neighborhood of the second group of foreground pixels satisfies a second topological constraint condition, wherein the second topological constraint condition is: there is no pattern satisfying a preset symmetry violation within the 8-neighborhood of the second group of foreground pixels; The marked first group of foreground pixels and second group of foreground pixels are updated to background pixels; The binary image after the iteration stops is used as skeleton image data, and magnetic trace features are extracted from the skeleton image data to obtain the magnetic trace topological features.

6. The method according to claim 1 or 2, characterized in that, The step of magnetizing the weld area to be inspected to obtain target magnetic trace image data when it is determined that there is no assembly gap includes: If it is determined that there is no assembly gap, magnetic particle testing is used to magnetize the weld area to be inspected and obtain initial magnetic trace image data. The initial magnetic trace image data is preprocessed to obtain preprocessed initial magnetic trace image data; The preprocessed initial magnetic trace image data is enhanced to obtain the target magnetic trace image data. The enhancement process includes any one or more combinations of multi-scale morphological filtering enhancement, contrast stretching, histogram equalization, or frequency domain filtering enhancement.

7. The method according to claim 6, characterized in that, When the enhancement process is a multi-scale morphological filtering enhancement, the enhancement process on the initial magnetic trace image data to obtain the target magnetic trace image data includes: The initial magnetic trace image data is processed using a first morphological operator to generate a first intermediate image; The initial magnetic trace image data is processed using a second morphological operator to obtain a second intermediate image; The first intermediate image and the second intermediate image are weighted and summed to obtain the target magnetic trace image data.

8. The method according to claim 1 or 2, characterized in that, The quantitative evaluation and analysis of the magnetic indentation topological features to determine the weld inspection result of the weld area to be inspected includes: The topological features of the magnetic traces are quantitatively evaluated and analyzed, and evaluation indicators characterizing the morphology of the magnetic traces are calculated. The evaluation indicators include fractal dimension, skeleton connectivity coefficient and skeleton curvature. The weld inspection results are determined based on the evaluation indicators.

9. An electronic device, characterized in that, include: Memory, processor; The memory stores computer-executed instructions; The processor executes computer execution instructions stored in the memory, causing the processor to perform the method as described in any one of claims 1-8.

10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions, which, when executed, are used to implement the method as described in any one of claims 1-8.