A method and apparatus for intelligent detection of weld surface defects

Weld boundaries are determined by bilateral filtering denoising, robust regression fitting, and residual gradient detection. Combined with independent least squares fitting of the left and right base materials and rotational transformation correction, a reference datum height is dynamically constructed, which solves the problem of inaccurate datum plane establishment in the prior art. This enables accurate quantification and identification of weld surface defects, and improves the comprehensiveness and reliability of the detection.

CN121861037BActive Publication Date: 2026-05-19HARBIN INST OF TECH AT WEIHAI
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
HARBIN INST OF TECH AT WEIHAI
Filing Date
2026-03-18
Publication Date
2026-05-19

AI Technical Summary

Technical Problem

Existing weld surface defect detection technologies are inaccurate in establishing reference surfaces under complex working conditions and cannot adapt to the surface condition of the base material and the type of weld, leading to false detections or missed detections. In particular, the detection accuracy and reliability are insufficient when the base material is tilted or uneven.

Method used

Weld boundaries are determined by bilateral filtering for noise reduction, robust regression fitting, and residual gradient detection. A reference height is dynamically constructed by combining independent least squares fitting of the left and right base materials and rotational transformation correction. Defect detection is performed by combining a partitioning strategy.

Benefits of technology

It enables precise quantification and identification of various weld surface defects under complex surface conditions, significantly improving the comprehensiveness and reliability of the inspection. It can accurately detect defects such as surface excess height, incomplete filling, undercut, weld leg size, linear misalignment, porosity and spatter.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121861037B_ABST
    Figure CN121861037B_ABST
Patent Text Reader

Abstract

The application provides a weld surface defect intelligent detection method and device, and belongs to the technical field of image analysis and defect detection. The method comprises the following steps: pre-processing a weld surface height map to obtain denoised height data; determining left and right boundary points and lines of a weld region based on the height data through longitudinal sampling, robust regression fitting and residual gradient detection, and fitting a left reference straight line of a left base material region and a right reference straight line of a right base material region respectively; dynamically constructing a reference datum height for each point in the weld region based on the left reference straight line and the right reference straight line; and detecting defects on the weld surface based on the difference between the height data and the reference datum height, and combining a preset judgment threshold and a region strategy. The application also provides a corresponding device. The application realizes accurate quantification and identification of various weld surface defects such as surface excess height, incomplete filling, surface undercut, weld leg size, linear misalignment, surface porosity and spatter.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of image analysis and defect detection technology, and specifically relates to an intelligent detection method and device for weld surface defects. Background Technology

[0002] Welding is a key process in the manufacture of metal structures, and the surface quality of the weld directly affects the mechanical properties and safety of the structure. Common defects on the weld surface include excess weld height, incomplete filling, undercut, linear misalignment, non-compliant weld dimensions, surface porosity, and spatter. If these defects are not detected in time, they may lead to stress concentration, fatigue cracks, or accelerated corrosion, ultimately causing structural failure.

[0003] Currently, industrial methods for inspecting weld surface quality mainly fall into three categories: traditional manual inspection, non-destructive testing (NDT) techniques, and automated inspection based on machine vision. While traditional manual inspection is simple and intuitive, it suffers from high subjectivity, low efficiency, poor consistency, and high labor intensity, making it particularly difficult to meet the requirements of efficient and reliable quality control, especially in large workpieces or mass production scenarios. NDT techniques, including ultrasonic testing and radiographic testing, can detect internal defects but have low sensitivity to surface contour defects, and are costly and complex to operate. Structured light-based machine vision inspection technology is gradually becoming the mainstream direction for weld surface quality inspection. For example, a line laser scanner is used to acquire a 3D point cloud or height map of the weld surface, and then image processing algorithms are used for defect identification. This type of method has the advantages of being non-contact, efficient, and highly accurate. However, existing line laser height map-based inspection techniques typically use fixed threshold methods, template matching methods, or simple difference methods to identify defects. However, these methods have the following shortcomings: they do not adequately consider the minute disturbances during the operation of the line laser scanner and the tilt or unevenness of the base material surface, leading to inaccurate establishment of the reference plane and a tendency to produce false or missed detections, especially when the base material has machined surface tilt, assembly gaps, or thermal deformation; they lack adaptive threshold adjustment for different weld widths, and fixed thresholds are difficult to adapt to the inspection requirements of both thin and thick plates. The main reason for these shortcomings is that existing technologies lack an independent fitting mechanism for the left and right base materials when establishing a dynamic reference plane, and their adaptive processing capability for weld width and weld type is insufficient, thus limiting their applicability and inspection reliability under complex working conditions.

[0004] Therefore, there is an urgent need for a weld surface defect detection algorithm that can adapt to the surface condition of the base material, adapt to various weld types, and achieve comprehensive detection of multiple defects, so as to improve detection accuracy, reliability and applicability. Summary of the Invention

[0005] To address the aforementioned technical problems, this invention proposes an intelligent detection method and device for weld surface defects. Through data processing procedures and defect quantification algorithms, it achieves automatic, accurate, and reliable detection of various weld surface defects under complex surface conditions.

[0006] To achieve the above objectives, the present invention adopts the following technical solution:

[0007] In a first aspect, the present invention proposes an intelligent detection method for weld surface defects, comprising the following steps:

[0008] The obtained weld surface height map is preprocessed to obtain the noise-reduced height data;

[0009] The left and right boundaries of the weld area are determined based on the height data, and the left reference line of the left base material area and the right reference line of the right base material area are fitted respectively.

[0010] Based on the left and right reference lines, a dynamic reference height is constructed for each point in the weld area;

[0011] Based on the difference between the height data and the reference height, and combined with the preset judgment threshold and area strategy, defects on the weld surface are detected; the defects include: surface excess height, incomplete filling, surface undercut, weld leg size, linear misalignment, surface porosity and spatter.

[0012] Secondly, the present invention also proposes an intelligent detection device for weld surface defects, comprising at least one processor and a memory, wherein the memory stores a computer program, and the computer program, when executed by the at least one processor, implements the aforementioned intelligent detection method for weld surface defects.

[0013] The effects described in the invention are merely those of the embodiments, and not all the effects of the invention. One of the above technical solutions has the following advantages or beneficial effects:

[0014] This invention proposes an intelligent detection method and device for weld surface defects, belonging to the field of image analysis and defect detection technology. The method includes the following steps: preprocessing the acquired weld surface height map to obtain denoised height data; determining the left and right boundaries of the weld region based on the height data, and fitting the left reference line of the left base material region and the right reference line of the right base material region respectively; dynamically constructing a reference height for each point within the weld region based on the left and right reference lines; and detecting weld surface defects based on the difference between the height data and the reference height, combined with a preset judgment threshold and region strategy. The defects include: surface excess height, incomplete filling, surface undercut, weld leg size, linear misalignment, surface porosity, and spatter. Based on this intelligent detection method for weld surface defects, an intelligent detection device for weld surface defects is also proposed. This invention provides strong and accurate data support for subsequent inspection through bilateral filtering for noise reduction, precise extraction of weld boundaries using residual gradients, independent least-squares fitting of left and right base materials combined with rotational transformation correction, and construction of a dynamic linear interpolation reference surface. The targeted inspection method, combined with the dynamic reference surface and partitioning strategy, achieves accurate quantification and identification of various weld surface defects such as surface excess height, incomplete filling, surface undercut, weld leg size, linear misalignment, surface porosity, and spatter, significantly improving the comprehensiveness and reliability of the inspection.

[0015] Based on height data, this invention determines the left and right boundary points and lines of the weld area through longitudinal sampling, robust regression fitting, and residual gradient detection. It also independently performs least squares linear fitting on the left and right base material areas and corrects the tilt of the base material by combining rotation transformation. This effectively overcomes the problems of inaccurate establishment of the reference surface and insufficient correction of the tilt of the base material surface in the prior art, thereby significantly improving the accuracy of the reference surface and providing reliable basic data support for subsequent defect quantification.

[0016] The dynamic linear interpolation method of this invention constructs a reference height within the weld zone based on the left and right reference lines. Combined with a region of interest partitioning strategy, such as excess height detection covering the entire weld zone, incomplete filling detection limiting the central region, undercut detection limiting the transition zone, and spatter limiting the base material zone, it achieves accurate calculation of height deviation within the weld zone. This solves the problem of poor adaptability of existing technologies to different weld widths and types, and can accurately detect and quantify various defects such as surface excess height, incomplete filling, and surface undercut.

[0017] This invention proposes a dedicated measurement algorithm for the weld leg size of fillet welds and a dedicated detection algorithm for the linear misalignment of butt welds. It also employs local minimum search combined with connected component shape analysis to identify surface porosity and local maximum search combined with connected component shape analysis to identify spatter. This enables high-precision identification and quantification of specific defects such as weld leg size, linear misalignment, surface porosity, and spatter. Attached Figure Description

[0018] Figure 1 This is a flowchart illustrating the implementation of an intelligent detection method for weld surface defects proposed in Embodiment 1 of the present invention.

[0019] Figure 2 This is an architecture diagram of the intelligent detection method for weld surface defects proposed in Embodiment 1 of the present invention;

[0020] Figure 3 This is an example diagram of the excessive height defect proposed in Embodiment 1 of the present invention;

[0021] Figure 4 This is an example diagram of an incompletely filled defect as proposed in Embodiment 1 of the present invention;

[0022] Figure 5 This is an example diagram of surface undercut defects proposed in Embodiment 1 of the present invention;

[0023] Figure 6 This is an example diagram of linear misalignment proposed in Embodiment 1 of the present invention;

[0024] Figure 7 This is a schematic diagram of the solder leg dimensions proposed in Embodiment 1 of the present invention;

[0025] Figure 8 This is a schematic diagram of an intelligent detection device for weld surface defects proposed in Embodiment 2 of the present invention. Detailed Implementation

[0026] To clearly illustrate the technical features of this solution, the invention will be described in detail below through specific embodiments and in conjunction with the accompanying drawings. The following disclosure provides many different embodiments or examples for implementing different structures of the invention. To simplify the disclosure of the invention, components and arrangements of specific examples are described below. Furthermore, reference numerals and / or letters may be repeated in different examples. This repetition is for simplification and clarity and does not in itself indicate a relationship between the various embodiments and / or arrangements discussed. It should be noted that the components illustrated in the drawings are not necessarily drawn to scale. Descriptions of well-known components, processing techniques, and processes are omitted in this invention to avoid unnecessarily limiting the invention.

[0027] Example 1

[0028] Embodiment 1 of the present invention proposes an intelligent detection method for weld surface defects, which realizes the detection and quantification of various weld surface defects by extracting the weld surface contour information from the height map.

[0029] This invention addresses the technical problems in the prior art, such as inaccurate establishment of the reference plane, insufficient correction of the base material, and poor adaptability to different weld types and widths, thereby achieving high-precision automatic detection of defects such as weld excess height, incomplete filling, and undercut.

[0030] Figure 1 This is a flowchart illustrating the implementation of an intelligent detection method for weld surface defects proposed in Embodiment 1 of the present invention. Figure 2 This is an architecture diagram of the intelligent detection method for weld surface defects proposed in Embodiment 1 of the present invention; combined with Figure 1 and Figure 2 The detailed process of implementing this invention will be described in detail.

[0031] In step S1, the acquired weld surface height map is preprocessed to obtain denoised height data; the specific process includes:

[0032] The grayscale values ​​of each pixel in the weld surface height map are converted into physical height values ​​according to the pre-calibrated height conversion coefficient to form an initial height matrix;

[0033] The height map generated by scanning is in 16-bit unsigned integer format, where the pixel grayscale value is proportional to the actual surface height. Therefore, a certain height conversion coefficient is needed to convert the pixel grayscale value into a physical height value. The specific formula is as follows:

[0034] ;

[0035] in, This is the initial height matrix; It is a grayscale matrix; This is the high-conversion factor.

[0036] The initial height matrix is ​​denoised using bilateral filtering to obtain denoised height data. The bilateral filtering algorithm removes noise and disturbances that may exist during the scanning process while preserving weld edge features. Specifically, for each pixel in the height map, a weighted average is calculated based on the spatial distance and gray-level similarity of its neighboring pixels. The filtering kernel function combines Gaussian spatial weights and Gaussian gray-level weights to avoid edge blurring. The formula for bilateral filtering is:

[0037] ;

[0038] ;

[0039] in, Represents pixels Height value after bilateral filtering; Represents pixels The original physical height value; Represents the neighborhood window Inner pixel The original physical height value; Represents the Gaussian kernel function in the spatial domain; Indicates the standard deviation of the spatial domain; Indicates the range of the Gaussian kernel function; Indicates the range and standard deviation; This represents the normalization factor.

[0040] In step S2, the left and right boundaries of the weld area are determined based on the height data, and the left reference line of the left base material area and the right reference line of the right base material area are fitted respectively.

[0041] To determine the coordinates of the left and right boundary points of the weld area, the height map is first longitudinally sampled to extract the cross-sectional data point set. For randomly selected sampling points, a robust regression method based on minimizing the Huber loss function is used to perform polynomial fitting on the macroscopic cross-sectional trend of the weld area and the base material on both sides. This robust regression method achieves fitting by optimizing the Huber loss function. When the residual is small, the function uses squared loss to ensure the fitting effect; when the residual is large, it is converted to linear loss to suppress the influence of outliers. Thus, it can still obtain a robust trend estimate in the presence of noise or local irregularities. The fitted polynomial curve is expressed as follows:

[0042] ;

[0043] in, This represents the polynomial curve obtained from the fitting. These are the coefficients of the corresponding polynomial; This indicates the order of the polynomial.

[0044] Then, the height residual after trend stripping is calculated:

[0045] ;

[0046] in, Indicates height residual, height residual This highlights the abrupt change in height of the weld area relative to the fitted base material surface; Indicates the first The actual height value of each data point (from the weld surface height map).

[0047] After smoothing the residual sequence using the sliding window averaging method, the normalized gradient is calculated using the two-point difference method:

[0048] ;

[0049] in, Indicates the first The residuals after smoothing each data point This represents the normalized gradient value of the k-th data point; Indicates the first The residuals after smoothing each data point; Indicates the first The residuals after smoothing each data point;

[0050] When the absolute value of the normalized gradient is greater than a certain threshold and the absolute value of the residual is greater than a certain proportion of the maximum residual of the cross section, the data point is determined as a candidate boundary point, and the left and right boundary points are initially determined by combining the gradient direction and weld width constraints.

[0051] Subsequently, the Median Absolute Deviation (MAD) method was used to filter out outlier boundary points. This was achieved by calculating the deviation of each boundary point from the local median. The dispersion is calculated, and an anomaly threshold is set accordingly. The formula for calculating the dispersion is:

[0052] ;

[0053] The MAD indicator is not sensitive to outliers and can effectively identify and remove boundary points that deviate significantly from the main distribution, ensuring the robustness of subsequent fitting.

[0054] Finally, adaptive boundary fitting is performed based on the weld morphology. If the weld is straight, global least-squares straight-line fitting is directly performed on the effective boundary points to obtain the left and right boundary lines of the weld region; if the weld is curved, boundary segmentation is first performed based on curvature detection. The curvature is approximately calculated using the five-point center difference formula:

[0055] ;

[0056] in, Indicates the first The approximate curvature values ​​at each boundary point are used to characterize the degree of bending of the weld boundary; Indicates the first The x-coordinates of the boundary points.

[0057] Using the point of curvature change as the basis for segmentation, piecewise least squares linear fitting is performed on each independent segment to obtain the left and right boundary lines of each weld area segment.

[0058] Next, height point sets are extracted row by row in the base material region on the left and right sides of the weld, and the left and right reference lines of each row in the height map are obtained by independent fitting using the least squares method.

[0059] Specifically: For each row, the coordinates of the left boundary of the weld... Extract the height point set within the defined left-side parent material region The slope of the left baseline line of this row is obtained by fitting using the least squares method. and intercept ;

[0060] ;

[0061] ;

[0062] in, Indicates the first The x-coordinates of the data points on the left; Indicates the first The height value of each data point on the left; This represents the average x-coordinate of the data points on the left. This represents the average height value of the data points on the left. This represents the total number of data points in the left-hand point set; This represents the deviation of the left horizontal axis; This indicates the deviation of the height value on the left side;

[0063] For each row, the coordinates of the right boundary of the weld are... Extract the height point set within the determined right-side parent material region The slope of the reference line to the right of this row is obtained by fitting using the least squares method. and intercept ;

[0064] ;

[0065] ;

[0066] in, Indicates the first The x-coordinates of the data points on the right; Indicates the first The height value of each data point on the right; This represents the average of the x-coordinates of the data points on the right. This represents the average height value of the data points on the right. This represents the total number of data points in the right-hand point set; This represents the deviation of the right-hand x-axis; This indicates the deviation of the height value on the right side.

[0067] When the weld type is a fillet weld or the base metal has a significant horizontal inclination, the height data on the corresponding side needs to be rotated and corrected to make the reference line more horizontal. (Correction of inclination angle) The correction formula is as follows:

[0068] ;

[0069] In this formula, This indicates the height value of the data point on the left or the height value of the data point on the right. This indicates the x-coordinate of the data point on the left or right. The sign is determined by whether it is on the left or right side; a positive sign is used when correcting the left parent material, and a negative sign is used when correcting the right parent material. After correction, the reference height is taken as the average value of the parent material area.

[0070] In step S3, a reference reference height is dynamically constructed for each point in the weld area based on the left reference line and the right reference line;

[0071] For the horizontal coordinate of the weld area The height is The reference height for the point is:

[0072] ;

[0073] ;

[0074] in, The height of the left reference line at the weld boundary; The height of the right reference line at the weld boundary; This is the lateral normalized position parameter of the current point relative to the left and right boundaries of the weld.

[0075] In step S4, based on the difference between the height data and the reference height, and in combination with the preset judgment threshold and area strategy, defects on the weld surface are detected; the defects include: surface excess height, incomplete filling, surface undercut, weld leg size, linear misalignment, surface porosity and spatter.

[0076] Defect detection is based on the previously extracted surface contour information and reference information. In the corresponding area of ​​the workpiece, defects such as surface excess height, incomplete filling, surface undercut, weld leg size, linear misalignment, surface porosity, and spatter are detected.

[0077] For different types of defects, the difference calculation and threshold determination are performed in different sub-regions on the weld surface.

[0078] Figure 3This is an example diagram of the excessive weld reinforcement defect proposed in Embodiment 1 of the present invention; the surface reinforcement refers to the height of the weld metal protruding from the surface of the base material. Excessive reinforcement can lead to stress concentration and affect the appearance quality. The region of interest for reinforcement detection is the entire weld area, and the reinforcement is calculated for each point in the weld area:

[0079] ;

[0080] If a certain point If the value is greater than the preset first threshold, then the point is determined to be a defective point in the excess height.

[0081] Figure 4 This is an example diagram of an incomplete weld defect proposed in Embodiment 1 of the present invention. Incomplete weld refers to the portion of the weld metal that is lower than the base metal surface reference, often appearing in the central area of ​​the weld, resulting in a reduction in the effective cross-sectional area of ​​the weld and decreased load-bearing capacity. Therefore, to avoid the influence of the transition area between the weld and the base metal, the region of interest for incomplete weld detection is limited to a certain area on both sides of the weld centerline. The incomplete weld depth is calculated for each point within this region.

[0082] ;

[0083] If the depth of a certain point is not fully filled If the value is greater than the preset second threshold, the point is determined to be an unfilled defect point.

[0084] Figure 5 This is an example diagram of surface undercut defects proposed in Embodiment 1 of the present invention. Surface undercut refers to continuous or intermittent grooves appearing in the transition zone between the weld and the base material, causing local wall thinning in the transition zone, which easily leads to stress concentration and fatigue cracks. The region of interest for surface undercut detection is in the transition zone on both sides of the weld edge. For butt welds, the reference height obtained from the reference information extraction module is used for calculation. For fillet welds, the undercut depth needs to be calculated after the aforementioned horizontal correction.

[0085] ;

[0086] If the bite depth If the value is greater than the third threshold, it is determined to be a surface edge defect.

[0087] The weld leg length refers to the length of the right angle formed by the weld metal and the base metal surface in a fillet weld. Insufficient or excessive length will affect weld strength. For fillet welds, the weld leg length is calculated by locating the intersection of the weld metal and the base metal along the direction of the base metal surface on both sides of the weld edge, and then calculating the vertical distance from the weld root to the weld metal surface. Figure 7 This is a schematic diagram of the solder leg dimensions proposed in Embodiment 1 of the present invention; It represents the straight-line distance from the lowest point of the weld root along the direction of the right base metal reference plane to the intersection of the weld profile and the right base metal reference plane, i.e., the length of the right weld leg; It represents the straight-line distance from the lowest point of the weld root along the left base metal reference plane to the intersection of the weld profile and the left base metal reference plane, i.e., the length of the left weld leg; This indicates the thickness of the weld throat.

[0088] The weld leg size inspection specifically includes: based on the corrected horizontal reference, finding the point of maximum curvature or the point of abrupt change in height gradient in the contour data on both sides of the weld edge as suspected weld toe points; starting from these points, searching inward along the normal of the reference plane to find the local lowest point where the height change tends to be gradual, and determining it as the weld root point; finally, calculating the Euclidean distance from the weld root point to the left and right weld toe points along the reference plane of their respective base materials to obtain the length of the right weld leg and the length of the left weld leg, respectively.

[0089] In actual calculations, the corrected horizontal datum is used as the reference for the base metal surface, and the weld metal extension length is measured in a direction perpendicular to the base metal. If the weld leg size exceeds the standard specification range, it is determined to be either too large or too small based on the actual situation.

[0090] Figure 6 This is an example diagram of linear misalignment proposed in Embodiment 1 of the present invention; linear misalignment refers to the misalignment of the base material surfaces on both sides in the thickness direction in a butt weld, resulting in asymmetrical stress on the weld and generating additional bending stress; for butt welds, linear misalignment detection compares the fitted reference straight line of the left base material. Intercept of the reference line on the right The difference avoids overall tilt interference:

[0091] ;

[0092] like If the value is greater than the preset fourth threshold, then a linear misalignment is determined to exist.

[0093] Surface porosity refers to spherical or columnar voids on the surface of weld metal, formed by the failure of gas to escape from the molten pool, thus weakening the weld's density. Surface porosity detection is based on the imaging feature of porosity as localized depressions in the height map. The region of interest is the entire weld area, and a local minimum search is performed on the height map. The difference between the height of each pixel and the average height of its neighborhood is calculated. If the depth of a local depression at a certain point If the area of ​​the connected region where the point is located exceeds the preset fifth threshold and the area is close to the preset area threshold and the shape is nearly circular, then the connected region is determined to be a surface pore.

[0094] Spatter refers to the granular protrusions formed when molten metal droplets ejected from the weld pool or arc during welding cool and adhere to the weld surface or base metal. Spatter detection is based on the imaging characteristics of spatter as localized or clustered protrusions in the height map. The region of interest is the left and right base metal regions, and local maxima are searched on the height map.

[0095] Calculate the difference between the height of each pixel and the average height of its neighborhood. If the height of a local bulge at a certain point If the area of ​​the connected region containing the point exceeds the preset sixth threshold and the area is close to the preset area threshold and the shape is nearly circular, then the connected region is determined to be a splash.

[0096] The invention proposed in Embodiment 1 uses bilateral filtering for noise reduction, robust regression fitting and residual gradient detection to accurately extract weld boundaries, independent least squares fitting of left and right base materials combined with rotational transformation correction, and dynamic linear interpolation reference surface construction to provide strong and accurate data support for subsequent inspection. The targeted inspection method, combined with dynamic reference surface and partitioning strategy, achieves accurate quantification and identification of various weld surface defects such as surface excess height, incomplete filling, surface undercut, weld leg size, linear misalignment, surface porosity and spatter, significantly improving the comprehensiveness and reliability of inspection.

[0097] Example 2

[0098] The present invention also proposes a device, Figure 8 This is a schematic diagram of an intelligent detection device for weld surface defects proposed in Embodiment 2 of the present invention.

[0099] At the hardware level, the electronic device 800 includes a processor 810, and optionally, an internal bus 820, a network interface 830, and memory. The memory may include main memory, such as high-speed random-access memory (RAM), or it may also include non-volatile memory, such as at least one disk storage device. Of course, the electronic device may also include other hardware required for other business operations.

[0100] The processor 810, network interface 830, and memory can be interconnected via an internal bus 820. This internal bus 820 can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. The bus can be categorized as an address bus, data bus, control bus, etc. For ease of illustration, only a single bidirectional arrow is used in this diagram, but this does not imply that there is only one bus or one type of bus. The memory is used to store programs. Specifically, the program can include program code, which includes computer operation instructions. The memory can include main memory 840 and non-volatile memory 850, and provides instructions and data to the processor 810.

[0101] The processor 810 reads the corresponding computer program from the non-volatile memory 850 into the main memory 840 and then runs it, forming a device for locating the target user at the logical level. The processor 810 executes the program stored in the memory and specifically performs the following:

[0102] In step S1, the obtained weld surface height map is preprocessed to obtain the noise-reduced height data;

[0103] In step S2, the left and right boundaries of the weld area are determined based on the height data, and the left reference line of the left base material area and the right reference line of the right base material area are fitted respectively.

[0104] In step S3, a reference reference height is dynamically constructed for each point in the weld area based on the left reference line and the right reference line;

[0105] In step S4, based on the difference between the height data and the reference height, and in combination with the preset judgment threshold and area strategy, defects on the weld surface are detected; the defects include: surface excess height, incomplete filling, surface undercut, weld leg size, linear misalignment, surface porosity and spatter.

[0106] Figure 1It can be applied to processor 810, or implemented by processor 810. The processor may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by the integrated logic circuit in the processor or by instructions in the form of software. The processor mentioned above can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. It can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this application. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the method disclosed in the embodiments of this application can be directly embodied in the execution of the hardware decoding processor, or executed by a combination of hardware and software modules in the decoding processor. The software module can reside in a mature storage medium in the field, such as random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, or registers. This storage medium is located in memory, and the processor reads information from the memory and, in conjunction with its hardware, completes the steps of the above method.

[0107] Of course, in addition to software implementation, the electronic device of this application does not exclude other implementation methods, such as logic devices or a combination of hardware and software, etc. In other words, the execution subject of the following processing flow is not limited to each logic unit, but can also be hardware or logic devices.

[0108] Example 3

[0109] The present invention also proposes a readable storage medium on which a computer program is stored, wherein the computer program, when executed by a processor, implements the following method steps:

[0110] In step S1, the obtained weld surface height map is preprocessed to obtain the noise-reduced height data;

[0111] In step S2, the left and right boundaries of the weld area are determined based on the height data, and the left reference line of the left base material area and the right reference line of the right base material area are fitted respectively.

[0112] In step S3, a reference reference height is dynamically constructed for each point in the weld area based on the left reference line and the right reference line;

[0113] In step S4, based on the difference between the height data and the reference height, and in combination with the preset judgment threshold and area strategy, defects on the weld surface are detected; the defects include: surface excess height, incomplete filling, surface undercut, weld leg size, linear misalignment, surface porosity and spatter.

[0114] This application also provides a storage medium, namely a computer storage medium, specifically a computer-readable storage medium, such as a memory that stores a computer program, which can be executed by a processor to complete the steps described in the aforementioned method. The computer-readable storage medium may be a memory such as FRAM, ROM, PROM, EPROM, EEPROM, Flash Memory, magnetic surface memory, optical disc, or CD-ROM.

[0115] Those skilled in the art will understand that all or part of the steps of the above method embodiments can be implemented by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When the program is executed, it performs the steps of the above method embodiments. The aforementioned storage medium includes various media capable of storing program code, such as mobile storage devices, ROM, RAM, magnetic disks, or optical disks. Alternatively, if the integrated units of this application are implemented as software functional modules and sold or used as independent products, they can also be stored in a computer-readable storage medium. Based on this understanding, the technical solutions of the embodiments of this application, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause an electronic device (which may be a personal computer, server, or network device, etc.) to execute all or part of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as mobile storage devices, ROM, RAM, magnetic disks, or optical disks.

[0116] The description of the relevant parts of the intelligent detection device for weld surface defects provided in Embodiment 2 of this application and the intelligent detection storage medium for weld surface defects provided in Embodiment 3 of this application can be found in the detailed description of the corresponding parts of the intelligent detection method for weld surface defects provided in Embodiment 1 of this application, and will not be repeated here.

[0117] It should be noted that, in this document, relational terms such as "first" and "second" are used merely to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that the elements inherent in a process, method, article, or apparatus that includes a list of elements are included. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element. Additionally, portions of the technical solutions provided in the embodiments of this application that are consistent with the implementation principles of corresponding technical solutions in the prior art have not been described in detail to avoid excessive elaboration.

[0118] While specific embodiments of the present invention have been described above in conjunction with the accompanying drawings, this is not intended to limit the scope of protection of the present invention. Those skilled in the art can make other modifications or variations based on the above description. It is neither necessary nor possible to exhaustively describe all embodiments here. Various modifications or variations that can be made by those skilled in the art without creative effort based on the technical solutions of the present invention are still within the scope of protection of the present invention.

Claims

1. A method for intelligent detection of surface defects in welds, characterized in that, Includes the following steps: The obtained weld surface height map is preprocessed to obtain the noise-reduced height data; The left and right boundaries of the weld area are determined based on the height data, and the left reference line of the left base material area and the right reference line of the right base material area are fitted respectively. Fit the left reference line of the left parent material region and the right reference line of the right parent material region respectively, as follows: For each row, the coordinates of the left boundary of the weld are... Extract the height point set within the defined left-side parent material region The slope of the left baseline line of this row is obtained by fitting using the least squares method. and intercept ; ; ; in, Indicates the first The x-coordinates of the data points on the left; Indicates the first The height value of each data point on the left; This represents the average x-coordinate of the data points on the left. This represents the average height value of the data points on the left. This represents the total number of data points in the left-hand point set; This represents the deviation of the left horizontal axis; This indicates the deviation of the height value on the left side; For each row, the coordinates of the right boundary of the weld are... Extract the height point set within the determined right-side parent material region The slope of the reference line to the right of this row is obtained by fitting using the least squares method. and intercept ; ; ; in, Indicates the first The x-coordinates of the data points on the right; Indicates the first The height value of each data point on the right; This represents the average of the x-coordinates of the data points on the right. This represents the average height value of the data points on the right. This represents the total number of data points in the right-hand point set; This represents the deviation of the right-hand x-axis; This indicates the deviation of the height value on the right side; Based on the left and right reference lines, a dynamic reference height is constructed for each point within the weld area; specifically, for each point within the weld area with an abscissa of... The height is The reference height for the point is: ; in, The height of the left reference line at the weld boundary; The height of the right reference line at the weld boundary; The normalized lateral position parameters of the current point relative to the left and right boundaries of the weld. Based on the difference between the height data and the reference height, and combined with the preset judgment threshold and area strategy, defects on the weld surface are detected; the defects include: surface excess height, incomplete filling, surface undercut, weld leg size, linear misalignment, surface porosity and spatter.

2. The intelligent detection method for weld surface defects according to claim 1, characterized in that, The obtained weld surface height map is preprocessed as follows: The grayscale values ​​of each pixel in the weld surface height map are converted into physical height values ​​according to the pre-calibrated height conversion coefficient to form an initial height matrix; The initial height matrix is ​​subjected to bilateral filtering for denoising to obtain the denoised height data; the formula for bilateral filtering is: ; ; in, Represents pixels Height value after bilateral filtering; Represents pixels The original physical height value; Represents the neighborhood window Inner pixel The original physical height value; Represents the Gaussian kernel function in the spatial domain; Indicates the standard deviation of the spatial domain; Indicates the range of the Gaussian kernel function; Indicates the range and standard deviation; This represents the normalization factor.

3. The intelligent detection method for weld surface defects according to claim 1, characterized in that, The left and right boundaries of the weld area are determined based on the height data, specifically: The height data is sampled longitudinally along the weld length to extract several sets of transverse cross-sectional data points; Calculate the height residual for each data point, smooth the residual sequence, and calculate the normalized gradient; the height residual is the difference between the actual height value and the fitted value of the trend curve. If the joint conditions are met simultaneously, the point is determined to be a candidate point for the left and right boundaries of the horizontal interface. The joint conditions include: the absolute value of the normalized gradient exceeds the first threshold, the absolute value of the height residual exceeds the second threshold, the gradient direction is consistent with the characteristic of the base material pointing to the weld, and the preset weld width constraint is met. The median absolute deviation method was used to remove outliers from the left and right boundary candidate point sets of all cross sections to obtain the effective boundary points; Based on the weld morphology, the effective boundary points are adaptively fitted, and the coordinates of the intersection of the fitted left and right boundary lines on each row cross section are determined as the final left and right boundary coordinates of the weld for that row.

4. The method according to claim 3, characterized in that, The effective boundary points are adaptively fitted based on the weld morphology, specifically as follows: If the weld is a straight line, perform global least squares line fitting on all valid left and right boundary points respectively; If the weld is curved, it is segmented by detecting the curvature abrupt change points, and the effective boundary points of each segment are fitted with least-squares straight lines.

5. The intelligent detection method for weld surface defects according to claim 1, characterized in that, The method for detecting surface defects in welds as excess weld height is as follows: Calculate the excess height at each point within the entire weld area: ; If a certain point If the value is greater than the preset first threshold, then the point is determined to be a defective point in the excess height.

6. The intelligent detection method for weld surface defects according to claim 1, characterized in that, The method for detecting incomplete filling of defects on the weld surface is as follows: Within the defined area on both sides of the weld centerline, calculate the unfilled depth at each point: ; If the depth of a certain point is not fully filled If the value is greater than the preset second threshold, the point is determined to be an unfilled defect point.

7. The intelligent detection method for weld surface defects according to claim 1, characterized in that, The method for detecting surface undercut defects on the weld surface is as follows: The transition area of ​​the weld base material is identified as the region of interest for undercut detection; For butt welds, the height difference between points within the region of interest is calculated based on a reference datum height: ; in, Indicates the reference height; Indicates the depth of the bite edge; For fillet welds, the height data of the base metal region is first rotated and corrected to make the base metal reference line approach horizontal. Then, using the corrected horizontal reference, the undercut depth at each point in the region of interest is calculated. If the bite depth If the value is greater than the third threshold, it is determined to be a surface edge defect.

8. The intelligent detection method for weld surface defects according to claim 1, characterized in that, The method for detecting weld surface defects as weld leg size is as follows: The height data of the left and right parent material areas are rotated and corrected to make the parent material reference line tend to be horizontal, thus obtaining the corrected horizontal reference plane. Within the base metal transition area on both sides of the weld edge, the intersection of the weld metal surface profile and the base metal reference plane is searched along the corrected horizontal reference plane direction and identified as the left weld toe point and the right weld toe point, respectively; the lowest point of the weld profile is searched downward along the direction perpendicular to the base metal reference plane and identified as the weld root point.

9. The intelligent detection method for weld surface defects according to claim 1, characterized in that, The method for detecting linear misalignment as a defect on the weld surface is as follows: Calculate the intercept of the left reference line Intercept of the reference line on the right The absolute difference; ; like If the value is greater than the preset fourth threshold, then a linear misalignment is determined to exist.

10. The intelligent detection method for weld surface defects according to claim 1, characterized in that, The method for detecting surface porosity as a defect on the weld surface is as follows: Within the weld area, search for local minima of the height data and calculate the height value for each pixel. Its neighborhood average height value The difference: ; If a certain point If the area of ​​the connected region where the point is located exceeds the preset fifth threshold and the area is circular, then the connected region is determined to be a surface pore.

11. The intelligent detection method for weld surface defects according to claim 1, characterized in that, The method for detecting spatter as a defect on the weld surface is as follows: Within the left and right parent material regions, search for local maxima of height data and calculate the height value of each pixel. Its neighborhood average height value The difference: ; If a certain point If the area of ​​the connected region containing the point exceeds the preset sixth threshold and the area is circular, then the connected region is determined to be a splash.

12. An intelligent detection device for weld surface defects, comprising at least one processor and a memory, wherein the memory stores a computer program, characterized in that, When the computer program is executed by the at least one processor, it implements a method for intelligent detection of weld surface defects as described in any one of claims 1 to 11.