Welding detection method, device, equipment, storage medium and product

By employing a two-stage semantic segmentation method, welding and metallographic regions are located and weld feature points are extracted, solving the problem of low accuracy in the measurement of metallographic geometric parameters in existing technologies and achieving high-precision welding inspection.

CN122434940APending Publication Date: 2026-07-21CONTEMPORARY AMPEREX TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
CONTEMPORARY AMPEREX TECHNOLOGY CO LTD
Filing Date
2026-06-22
Publication Date
2026-07-21

AI Technical Summary

Technical Problem

Existing metallographic geometric parameter measurements have low accuracy, resulting in low reliability of welding inspection, especially in high-precision measurements of micro welds where it is difficult to accurately distinguish welding quality.

Method used

A two-stage semantic segmentation method is adopted. First, the welding area and metallographic area are located through the first semantic segmentation process. Then, the weld image is subjected to the second semantic segmentation to extract the weld feature points. Combined with the boundary of the welding area, the metallographic geometric parameters, such as effective penetration depth and effective penetration width, are calculated.

Benefits of technology

It improves the accuracy of weld zone extraction and the high-precision measurement of metallographic geometric parameters, thereby enhancing the reliability of welding inspection and the safety and stability of measurement results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122434940A_ABST
    Figure CN122434940A_ABST
Patent Text Reader

Abstract

The application discloses a welding detection method, device, equipment, storage medium and product. The method comprises the following steps: performing first semantic segmentation processing on a metallographic image of a welding object to obtain a welding area and a metallographic area in the metallographic image; based on the position of the welding area in the metallographic image, a weld image is intercepted from the metallographic image, wherein the weld image comprises at least part of the welding area; performing second semantic segmentation processing on the weld image to obtain a weld area; based on the weld area, a weld feature point is extracted; according to the weld feature point and the boundary of the welding area, a metallographic geometric parameter of the welding object is determined; the metallographic geometric parameter comprises at least one of an effective penetration and an effective width. In this way, the accuracy of the extraction of the weld area is improved, high-precision measurement of the metallographic geometric parameter is realized, and the reliability of the welding detection is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of welding technology, and in particular to a welding inspection method, apparatus, equipment, storage medium, and product. Background Technology

[0002] In precision industrial fields such as battery manufacturing, the welding quality of product components such as sealing nails and top covers directly affects the product's sealing performance, pressure resistance, and long-term operational safety. Metallographic geometric parameters such as the weld cross-section's protrusion height, penetration depth, effective penetration depth, and effective weld width are key indicators of weld quality. However, existing methods for measuring these metallographic geometric parameters suffer from low precision, leading to low reliability in weld inspection. Summary of the Invention

[0003] This application provides a welding inspection method, apparatus, equipment, storage medium, and product, which can improve the accuracy of weld area extraction, achieve high-precision measurement of metallographic geometric parameters, and thus improve the reliability of welding inspection.

[0004] In a first aspect, embodiments of this application provide a welding inspection method, which may include: The metallographic image of the welded object is subjected to first semantic segmentation processing to obtain the welded area and metallographic area in the metallographic image; Based on the location of the welded area in the metallographic image, a weld image is extracted from the metallographic image; the weld image includes at least a portion of the welded area. The weld seam image is subjected to second semantic segmentation to obtain the weld seam region; Based on the weld area, weld feature points are extracted; wherein, the weld feature points include at least one of a first feature point and a second feature point, the first feature point is the feature point in the point set corresponding to the weld area that is closest to the first direction, the first direction is the extension direction of the weld near the end of the weld area; the second feature point is the feature point in the point set corresponding to the weld area that is closest to the second direction and whose distance from the first feature point is less than or equal to a distance threshold, the second direction is the extension direction perpendicular to the first direction and away from the metallographic area. Based on the weld feature points and the boundary of the welding area, determine the metallographic geometric parameters of the welded object; the metallographic geometric parameters include at least one of the effective penetration depth and effective weld width.

[0005] This application embodiment uses a first semantic segmentation to coarsely locate the weld and metallographic regions, and then performs a second semantic segmentation on the weld image cropped from the original image to finely extract the weld region. This improves the accuracy reduction problem caused by information loss when segmenting small and complex weld structures in a single-stage model, enhances the accuracy of weld region extraction, and achieves high-precision measurement of metallographic geometric parameters, thereby improving the reliability of welding inspection. Furthermore, by defining and extracting weld feature points within the weld region and combining these feature points with the boundary of the weld region to calculate the effective penetration depth and effective weld width, the abstract region is transformed into a quantifiable geometric relationship between points and lines. This provides a clear mathematical and geometric basis for the calculation of effective penetration depth and effective weld width, improving the interpretability of the algorithm and the accuracy of the measurement results.

[0006] In some optional embodiments, the metallographic geometry parameters include the effective penetration depth, and the weld feature points include second feature points; Determining the metallographic geometric parameters of the welded object based on weld feature points and the boundary of the welded area can include: Extract the first set of points corresponding to the boundary line of the welded area that deviates from the metallographic area; The effective melting depth is determined based on the Euclidean distance between each feature point in the first feature set and the second feature point.

[0007] In this way, by calculating the Euclidean distance from the lower boundary of the welding area to the second feature point, the physical meaning of the effective penetration depth, i.e., the vertical distance from the bottom of the weld to the weld line, is directly and efficiently defined. The calculation method is intuitive and easy to implement.

[0008] In some optional embodiments, determining the effective penetration depth based on the Euclidean distance between each feature point in the first point set and the second feature point may include: The minimum value of the Euclidean distance between each feature point in the first point set and the second feature point is determined as the effective melting depth.

[0009] In this way, the minimum Euclidean distance is defined as the effective penetration depth, so that the measured effective penetration depth is the most conservative value corresponding to the weakest point. This reduces the risk of overestimating welding quality due to taking average values ​​or other statistical values, and improves the safety and reliability of welding inspection results.

[0010] In some optional embodiments, determining the effective penetration depth based on the Euclidean distance between each feature point in the first point set and the second feature point may include: The minimum value of the Euclidean distance between each feature point in the first point set and the second feature point is determined as the candidate effective melting depth; Determine the shortest distance between the third feature point and the first point set; wherein, the third feature point is the feature point in the second point set that is closest to the third direction, which is parallel to the first direction and opposite to the direction of the first direction; The smaller value between the candidate effective penetration depth and the shortest distance is determined as the effective penetration depth.

[0011] In this way, by introducing the thickness of the welding area itself, that is, comparing and verifying the shortest distance between the third feature point of the lower boundary and the upper boundary, the smaller value is taken as the effective penetration depth. This improves the problem of unreasonable weld width measurement when the weld root is not completely penetrated or the image recognition is abnormal, and enhances the robustness of the algorithm and the rationality of the measurement results.

[0012] In some optional embodiments, the metallographic geometry parameters include the effective weld width, and the weld feature points include the first feature point; Determining the metallographic geometric parameters of the welded object based on weld feature points and the boundary of the welded area can include: Input the set of third points corresponding to the boundary line between the metallographic region and the welding region into the preset straight line equation, and solve the equation parameters of the preset straight line equation by the least squares method to obtain the reference straight line. Determine the target vertical line corresponding to the reference line; wherein, the target vertical line passes through the fourth feature point, which is the first point set corresponding to the boundary line of the welding area away from the metallographic area, and the feature point closest to the first direction. The effective weld width is determined based on the first feature point and the target vertical line.

[0013] In this way, by fitting the boundary line between the metallographic and welded areas as a reference, constructing a perpendicular line through the fourth specific point, and finally combining the first feature point to determine the effective weld width, a measurement coordinate system related to the metallographic structure is established. This makes the measurement of the effective weld width independent of the overall direction or position of the weld image, thus improving the stability and accuracy of the measurement results.

[0014] In some optional embodiments, the metallographic geometry parameters include at least one of the protrusion height and penetration depth; Determining the metallographic geometric parameters of the welded object based on the welding area, metallographic area, and weld seam area can include: Input the set of third points corresponding to the boundary line between the metallographic region and the welding region into the preset straight line equation, and solve the equation parameters of the preset straight line equation by the least squares method to obtain the reference straight line. Based on the welding area, welding feature points are extracted; wherein, the welding feature points include at least one of the fifth feature point and the sixth feature point. The fifth feature point is the feature point farthest from the reference line in the first point set corresponding to the boundary line of the welding area away from the metallographic area; the sixth feature point is the feature point farthest from the reference line in the fourth point set corresponding to the side of the welding area close to the metallographic area on the reference line. Based on the reference straight line and welding feature points, determine the metallographic geometric parameters of the welding object.

[0015] In this way, by using a reference straight line and extracting extreme points from the boundary of the welding area, namely the fifth and sixth feature points, the measurement of protrusion height and penetration depth can be achieved, which can enrich the evaluation dimensions of welding quality and improve the overall detection efficiency without the need for additional image processing.

[0016] In some optional embodiments, the metallographic geometry parameters include the protrusion height, and the weld feature point includes a fifth feature point; Determining the metallographic geometric parameters of the welded object based on the reference line and welding feature points can include: The vertical distance between the fifth feature point and the reference line is determined as the protrusion height.

[0017] In this way, the bulge height can be calculated by the vertical distance from the tangent point on the welding area to the baseline. The definition is clear and the calculation is simple. It can effectively quantify the excess height on the weld surface and provide key data for evaluating the weld appearance and stress concentration.

[0018] In some optional embodiments, the metallographic geometry parameters include penetration depth, and the weld feature point includes a sixth feature point; Determining the metallographic geometric parameters of the welded object based on the reference line and welding feature points can include: The vertical distance between the sixth feature point and the reference line is determined as the penetration depth.

[0019] In this way, the penetration depth can be calculated by the vertical distance from the lower tangent point of the welding area to the baseline, which can directly reflect the fusion range of the weld in the thickness direction. It is clearly defined, simple to calculate, and provides key data for evaluating welding heat input and penetration.

[0020] In some optional embodiments, after performing a first semantic segmentation process on the metallographic image of the welded object to obtain the welded area and the metallographic area in the metallographic image, the method may further include: Obtain the first coordinate of the first endpoint and the second coordinate of the second endpoint of the welding area; the first endpoint and the second endpoint are the endpoints located at both ends of the weld extension direction; The orientation of the weld area in the metallographic image is determined based on the first and second coordinates; When the orientation is not preset, the metallographic image is mirrored and flipped along the weld extension direction.

[0021] In this way, by identifying the weld direction and performing necessary mirror flipping, the subsequent image segmentation and feature extraction algorithms can work in a consistent coordinate system regardless of the placement orientation of the original metallographic sample. This reduces the standardization requirements for sample preparation and photography, and improves the convenience and fault tolerance of the welding inspection method in practical applications.

[0022] In some optional embodiments, after determining the metallographic geometry parameters of the welded object based on the weld area, metallographic area, and weld seam area, the method may further include: Based on the metallographic geometric parameters and the mapping relationship between unit pixels and physical dimensions, the actual physical dimensions corresponding to the metallographic geometric parameters are determined. Annotation information is generated in the metallographic image. The annotation information includes the position information indicated by the metallographic geometric parameters and the actual physical dimensions corresponding to the metallographic geometric parameters.

[0023] In this way, by mapping pixels to physical dimensions, metallographic geometric parameters are transformed into actual physical dimensions and marked at the corresponding positions in the metallographic image, realizing the transformation from pixel space to real physical space and the visualization of the results.

[0024] In some optional embodiments, before performing a first semantic segmentation process on the metallographic image of the welded object to obtain the welded area and the metallographic area in the metallographic image, the method may further include: Obtain the initial metallographic image of the object to be welded; The initial metallographic image is preprocessed to obtain the metallographic image of the welded object; wherein the preprocessing includes at least one of image size transformation, vector transformation and normalization.

[0025] In this way, by performing operations such as resizing, format unification, and normalization on the original images, the inconsistency in image quality caused by differences in shooting equipment, lighting conditions, and sample size can be eliminated. This standardizes the input data and creates conditions for the stable and high-performance operation of the subsequent semantic segmentation network, thereby improving the accuracy and reliability of the entire system.

[0026] Secondly, embodiments of this application provide a welding inspection device, which may include: The first semantic segmentation processing module is used to perform first semantic segmentation processing on the metallographic image of the welded object to obtain the welded area and the metallographic area in the metallographic image. The image cropping module is used to crop a weld image from a metallographic image based on the position of the weld area in the metallographic image; the weld image includes at least a portion of the weld area; The second semantic segmentation processing module is used to perform second semantic segmentation processing on the weld image to obtain the weld region; The determination module is used for: Based on the weld area, weld feature points are extracted; wherein, the weld feature points include at least one of a first feature point and a second feature point, the first feature point is the feature point in the point set corresponding to the weld area that is closest to the first direction, the first direction is the extension direction of the weld near the end of the weld area; the second feature point is the feature point in the point set corresponding to the weld area that is closest to the second direction and whose distance from the first feature point is less than or equal to a distance threshold, the second direction is the extension direction perpendicular to the first direction and away from the metallographic area. Based on the weld feature points and the boundary of the welding area, determine the metallographic geometric parameters of the welded object; the metallographic geometric parameters include at least one of the effective penetration depth and effective weld width.

[0027] Thirdly, embodiments of this application provide an electronic device, the device including: a processor and a memory storing program instructions; the processor executes the program instructions to implement the method of the first aspect.

[0028] Fourthly, embodiments of this application provide a machine-readable storage medium storing program instructions, which, when executed by a processor, implement the method of the first aspect.

[0029] Fifthly, embodiments of this application provide a computer program product in which instructions, when executed by a processor of an electronic device, cause the electronic device to perform the method of the first aspect.

[0030] The above description is only an overview of the technical solution of this application. In order to better understand the technical means of this application and to implement it in accordance with the contents of the specification, and to make the above and other objects, features and advantages of this application more obvious and understandable, the following are specific embodiments of this application. Attached Figure Description

[0031] The features, advantages, and technical effects of exemplary embodiments of this application will now be described with reference to the accompanying drawings.

[0032] Figure 1 This is one of the flowcharts illustrating the welding inspection method provided in the embodiments of this application; Figure 2 A schematic diagram of a metallographic image in the welding inspection method provided in the embodiments of this application; Figure 3 A schematic diagram of the first semantic segmentation result in the welding inspection method provided in the embodiments of this application; Figure 4 This is a schematic diagram of a weld image in the welding inspection method provided in the embodiments of this application; Figure 5 A schematic diagram of the second semantic segmentation result of the welding inspection method provided in the embodiments of this application; Figure 6 A second schematic flowchart of the welding inspection method provided in the embodiments of this application; Figure 7 The third schematic flowchart of the welding inspection method provided in the embodiments of this application; Figure 8 The fourth schematic flowchart of the welding inspection method provided in the embodiments of this application; Figure 9 Fifth schematic flowchart of the welding inspection method provided in the embodiments of this application; Figure 10 Sixth schematic flowchart of the welding inspection method provided in the embodiments of this application; Figure 11 The seventh schematic flowchart of the welding inspection method provided in the embodiments of this application; Figure 12 Eighth schematic flowchart of the welding inspection method provided in the embodiments of this application; Figure 13 This is a visualization of metallographic geometric parameters in the welding inspection method provided in the embodiments of this application; Figure 14 A schematic flowchart of the welding inspection method provided in the embodiments of this application is shown in Figure 9. Figure 15 A flowchart illustrating a specific scenario embodiment of the welding inspection method provided in this application; Figure 16 A schematic diagram of the welding inspection device provided in the embodiments of this application; Figure 17 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application.

[0033] The accompanying drawings are not necessarily drawn to scale. Detailed Implementation

[0034] The embodiments of this application will be described in further detail below with reference to the accompanying drawings and examples. The detailed description of the following embodiments and the accompanying drawings are used to illustrate the principles of this application by way of example, but should not be used to limit the scope of this application, that is, this application is not limited to the described embodiments.

[0035] In the description of this application, it should be noted that, unless otherwise stated, "a plurality of" means two or more; the terms "upper," "lower," "left," "right," "inner," and "outer," etc., indicating orientation or positional relationships, are only for the convenience of describing this application and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation, and therefore should not be construed as a limitation on this application. Furthermore, the terms "first," "second," and "third," etc., are used for descriptive purposes only and should not be construed as indicating or implying relative importance. "Vertical" is not vertical in the strict sense, but within the allowable tolerance range. "Parallel" is not parallel in the strict sense, but within the allowable tolerance range.

[0036] In this application, the reference to "embodiment" means that a specific feature, structure, or characteristic described in connection with an embodiment may be included in at least one embodiment of this application. The appearance of this phrase in various places throughout the specification does not necessarily refer to the same embodiment, nor is it a mutually exclusive, independent, or alternative embodiment. It will be explicitly and implicitly understood by those skilled in the art that the embodiments described in this application can be combined with other embodiments.

[0037] In precision industrial fields such as battery manufacturing, the welding quality of product components such as sealing nails and top covers directly affects the product's sealing performance, pressure resistance, and long-term operational safety. Metallographic geometric parameters such as the weld protrusion height, penetration depth, effective weld penetration, and effective weld width are crucial for measuring weld quality. These metallographic geometric parameters are often measured based on post-weld metallographic images; however, metallographic images typically suffer from imaging challenges such as metallic reflection, blurred fusion lines, and complex textures. This presents a severe challenge to the automated and high-precision measurement of metallographic geometric parameters.

[0038] Currently, the following three types of technical methods are mainly used in industrial testing and academic research to obtain the metallographic geometric parameters of the welded area: The first method is manual visual microscopic measurement: Inspectors observe the cross-sectional image of the weld after cutting, mounting, grinding, and etching using a metallographic microscope. During operation, personnel need to manually adjust the microscope stage, rely on the scale lines inside the eyepiece or manually draw points and lines on the digital image using software, and judge the fusion line boundary based on experience to read the values ​​of weld depth and weld width.

[0039] Second, traditional digital image processing algorithms utilize low-level computer vision features for semi-automatic extraction. The specific process is as follows: First, the image is converted to grayscale and denoised using Gaussian filtering. Then, the Canny Edge Detector (Canny) or Sobel Operator (Sobel) operator is applied for edge detection, combined with Otsu's Method (Otsu) adaptive thresholding to generate a binary image. For broken edges, morphological closing operations or Hough linear transform are used to fit and form a closed contour. Finally, the bounding rectangle or minimum distance of the contour is calculated to obtain the geometric dimensions.

[0040] Thirdly, single-stage deep learning semantic segmentation: constructing an end-to-end model based on convolutional neural networks (such as U-Net or DeepLabV3+ networks). This approach inputs the labeled welding area image into an encoder-decoder network, directly generating a mask through pixel-level classification prediction. Subsequently, the mask region undergoes post-processing skeleton extraction and distance transformation to convert it into physical geometric dimensions.

[0041] However, the inventors discovered that when the above method is applied to high-precision measurement of micro welds, the following significant technical bottlenecks still exist: Manual measurement and judgment of fusion line boundaries rely on the human eye's sensitivity to gradual changes in grayscale. Different people may have different judgments of the same ambiguous boundary, which can vary by tens of micrometers, resulting in poor measurement consistency. Especially for welds with widths of only a few micrometers to tens of micrometers, the human eye can hardly accurately distinguish whether there are unfused defects at the boundary under the extreme resolution of an optical microscope, which can easily lead to missed or incorrect judgments.

[0042] Traditional edge detection operators are based on gradient changes, but metallographic images after welding often exhibit extremely low contrast or strong texture noise due to varying degrees of corrosion and differences in metal crystal phases. When the gradient intensity at the fusion line edge is lower than the threshold set by the algorithm, it will cause edge breakage; and when the needle-like grain texture inside the weld layer generates a high gradient response, the algorithm will extract false edges, causing the measured contour to deviate significantly from the actual physical boundary.

[0043] Single-stage segmentation networks suffer from a fundamental flaw: they degrade the segmentation of fine structures. During continuous downsampling, the spatial details of a single-stage encoder-decoder semantic segmentation network are highly compressed. Welds in images often appear as extremely thin, elongated gaps only 1-3 pixels wide. In deep feature maps, the spatial location information of these tiny structures is severely lost or even completely smoothed out. Even using skip connections to restore resolution, it is difficult to reconstruct the sub-pixel-level gap boundaries submerged by deep semantic information. This causes the model's predicted mask to incorrectly bond the metal on both sides together, resulting in a fundamental systematic error of hundreds of micrometers in subsequent calculations of weld depth and gap.

[0044] In summary, existing methods for measuring metallographic geometric parameters suffer from low accuracy, resulting in low reliability of welding inspection.

[0045] Based on this, embodiments of this application provide a welding inspection method, apparatus, equipment, storage medium, and product, which can improve the accuracy of weld area extraction, achieve high-precision measurement of metallographic geometric parameters, and thus improve the reliability of welding inspection.

[0046] The welding inspection method provided in the embodiments of this application will be introduced first below.

[0047] like Figure 1 As shown, the welding inspection method provided in this application embodiment may include steps 101-104: Step 101: Perform first semantic segmentation processing on the metallographic image of the welded object to obtain the welded area and metallographic area in the metallographic image.

[0048] In step 101, the welding object can be any product component that is welded in the precision industrial field. To facilitate understanding of the technical solution provided by the embodiments of this application, the following description will take the sealing nail welded in the last process of cell assembly in the battery manufacturing field as an example. It is understood that sealing nail welding, also known as electrolyte injection port welding, is a process in which the electrolyte is injected into the battery and then sealed with glue nails, followed by laser welding to achieve a seal, thus isolating the battery cell from the external environment and forming a sealed electrochemical system. Sealing nail welding inspection is a core process to ensure battery sealing performance. It mainly analyzes the weld penetration, weld width, microstructure, and defects after laser welding. By observing the weld cross-section under a microscope, the crack depth can be effectively assessed and insulation performance can be ensured.

[0049] like Figure 2 As shown, a metallographic image 200 of the welded object can be acquired first using a microscope and an imager. In some examples, after acquiring the metallographic image, the physical dimension represented by each pixel in the image can be calculated simultaneously, thus obtaining the mapping relationship between unit pixels and physical dimensions.

[0050] The metallographic image of the welded object can be processed using semantic segmentation to obtain the welded area and the metallographic region within the image. Semantic segmentation is one of the core tasks of computer vision, aiming to classify images at the pixel level, assigning predefined category labels to each pixel, and achieving a fine understanding of the image content—not only classifying but also locating it. This technology is widely used in autonomous driving, medical image analysis, drone scene understanding, and industrial inspection.

[0051] In the embodiments of this application, such as Figure 3As shown, the first semantic segmentation process can be to input the metallographic image 200 into the first semantic segmentation model, and output the welding area 301, metallographic area 302, first background area 303 and initial weld area 304 in the metallographic image 200 through the first semantic segmentation model.

[0052] The first semantic segmentation model employs a Cascaded Graph-based Spatial-Decoder Network (CGSDNet) architecture. The backbone network uses a next-generation convolutional network (ConvNext). The input image size is 1024*1024, and the output features are 4*1024*1024, namely the feature images of the weld area, the metallographic area, the first background area, and the initial weld area. Because spatial detail information is highly compressed during continuous downsampling, the segmentation effect of the initial weld area is poor. Therefore, the purpose of the first semantic segmentation process is to separate the weld area 301 and the metallographic area 302, facilitating the subsequent identification of key feature points required for weld detection.

[0053] Step 102: Based on the position of the welded area in the metallographic image, extract the weld image from the metallographic image; the weld image includes at least a portion of the welded area.

[0054] In step 102, since the first semantic segmentation process downsamples the metallographic image, the weld seam, which was originally only 4-10 pixels wide, almost disappears, making it difficult to segment the weld seam area accurately. Therefore, by cropping out the part of the image that includes the weld seam based on the first semantic segmentation process and performing further segmentation, the impact of downsampling can be effectively reduced.

[0055] For example, such as Figure 4 As shown, the weld seam can be located by first using the segmented welding area of ​​the first semantic segmentation process, and then the weld seam image of 640*640 around the weld seam can be cropped out.

[0056] Step 103: Perform second semantic segmentation on the weld image to obtain the weld region.

[0057] In step 103, as Figure 5 As shown, the second semantic segmentation process can be to input the weld image 400 into the second semantic segmentation model, and output the weld region 501 and the second background region 502 in the weld image 400 through the second semantic segmentation model.

[0058] The second semantic segmentation model can use the binary classification CGSDNet, with input and output of the original image size. The output has 2 channels, namely the feature map of the weld area and the feature map of the second background area, which are used to distinguish the weld area from the background.

[0059] Step 104: Determine the metallographic geometric parameters of the welded object based on the welding area, metallographic area, and weld seam area.

[0060] In step 104, after extracting the precise welding area, metallographic area, and weld seam area, key feature points can be further extracted based on the welding area, metallographic area, and weld seam area to calculate the metallographic geometric parameters of the welded object.

[0061] The metallographic geometric parameters may include at least one of the following: effective penetration depth, effective penetration width, protrusion height, and penetration depth.

[0062] This application embodiment uses a first semantic segmentation to coarsely locate the welding and metallographic regions, and then performs a second semantic segmentation on the weld image cropped from the original image to finely extract the weld region. This improves the accuracy reduction problem caused by information loss when segmenting small and complex weld structures in a single-stage model, enhances the accuracy of weld region extraction, and achieves high-precision measurement of metallographic geometric parameters, thereby improving the reliability of welding inspection.

[0063] In some optional embodiments, the metallographic geometry parameters include at least one of effective penetration depth and effective penetration width; like Figure 6 As shown, step 104 above may include steps 601-602: Step 601: Extract weld feature points based on the weld area; wherein, the weld feature points include at least one of a first feature point and a second feature point, the first feature point being the feature point in the point set corresponding to the weld area that is closest to the first direction, the first direction being the extension direction of the weld near the end of the weld area; the second feature point being the feature point in the point set corresponding to the weld area that is closest to the second direction and whose distance from the first feature point is less than or equal to a distance threshold, the second direction being the extension direction perpendicular to the first direction and away from the metallographic area; Step 602: Determine the metallographic geometric parameters of the welded object based on the weld feature points and the boundary of the welded area.

[0064] In this embodiment, the first direction can be the extension direction of the weld near the welding area, and the second direction is the extension direction perpendicular to the first direction and away from the metallographic region. For example... Figure 3 As shown, taking the example where the weld is located on the left side of the metallographic image, the welding area is located on the right side of the weld, and the metallographic region is located on the bottom side of the metallographic image, the first direction can be the rightward direction, and the second direction can be the upward direction.

[0065] Weld feature points can be extracted based on the weld area, namely at least one of the first feature point and the second feature point.

[0066] The first feature point can be the feature point closest to the first direction in the point set corresponding to the weld area. In other words, the first feature point can be the rightmost point of the weld.

[0067] The second feature point is the feature point in the point set corresponding to the weld area that is closest to the second direction and whose distance from the first feature point is less than or equal to a distance threshold. The distance threshold can be set according to actual needs and is not specifically limited here. In other words, the second feature point can be the uppermost point near the rightmost point of the weld.

[0068] Based on the weld feature points and the boundary of the welding area, at least one of the effective penetration depth and effective weld width of the welded object can be calculated.

[0069] The effective penetration depth refers to the maximum vertical distance from the weld surface to the fusion line, and this depth must ensure complete penetration of the weld root to form a continuous, defect-free fusion. Therefore, the effective penetration depth of the weld can be calculated based on the second feature point and the upper edge of the boundary of the welding area.

[0070] Effective weld width refers to the distance between the fusion lines on both sides of a single weld pass across its cross-section; it measures the width of the base metal melted and bonded to the weld metal. Therefore, the effective weld width can be calculated based on the first characteristic point and the rightmost point on the boundary of the welded area.

[0071] In this way, by defining and extracting weld feature points within the weld area, and combining these feature points with the boundary of the weld area to calculate the effective penetration depth and effective weld width, the abstract region is transformed into a quantifiable geometric relationship between points and lines. This gives the calculation of effective penetration depth and effective weld width a clear mathematical and geometric basis, improving the interpretability of the algorithm and the accuracy of the measurement results.

[0072] In some optional embodiments, the metallographic geometry parameters include the effective penetration depth, and the weld feature points include second feature points; like Figure 7 As shown, step 602 above may include steps 701-702: Step 701: Extract the first set of points corresponding to the boundary line of the welding area away from the metallographic area; Step 702: Determine the effective melting depth based on the Euclidean distance between each feature point in the first point set and the second feature point.

[0073] In this embodiment, a first set of points corresponding to the boundary line of the welded area away from the metallographic area can be extracted, that is, the set of points corresponding to the upper edge line of the welded area. The first set of points is traversed, and the Euclidean distance between each feature point and the second feature point, that is, the uppermost point near the rightmost point of the weld area, is calculated.

[0074] The effective penetration depth can be determined based on the Euclidean distance between each feature point in the first feature set and the second feature point. For example, the average value of the Euclidean distance can be calculated as the effective penetration depth, or the minimum value of the Euclidean distance can be taken as the effective penetration depth.

[0075] In this way, by calculating the Euclidean distance from the lower boundary of the welding area to the second feature point, the physical meaning of the effective penetration depth, i.e., the vertical distance from the bottom of the weld to the weld line, is directly and efficiently defined. The calculation method is intuitive and easy to implement.

[0076] In some alternative embodiments, step 702 above may include: The minimum value of the Euclidean distance between each feature point in the first point set and the second feature point is determined as the effective melting depth.

[0077] In this embodiment, after calculating the Euclidean distance between each feature point in the first point set and the second feature point, the minimum value can be taken as the effective melting depth.

[0078] In this way, the minimum Euclidean distance is defined as the effective penetration depth, so that the measured effective penetration depth is the most conservative value corresponding to the weakest point. This reduces the risk of overestimating welding quality due to taking average values ​​or other statistical values, and improves the safety and reliability of welding inspection results.

[0079] In some alternative embodiments, such as Figure 8 As shown, step 702 above may include steps 801-803: Step 801: Determine the minimum value of the Euclidean distance between each feature point in the first point set and the second feature point as the candidate effective melting depth; Step 802: Determine the shortest distance between the third feature point and the first point set; wherein, the third feature point is the feature point closest to the third direction in the second point set corresponding to the boundary line of the welding area near the metallographic area, the third direction is parallel to the first direction, and the direction of the third direction is opposite to the direction of the first direction; Step 803: The smaller value between the candidate effective penetration depth and the shortest distance is determined as the effective penetration depth.

[0080] In this embodiment, after calculating the Euclidean distance between each feature point in the first point set and the second feature point, the minimum value can be taken as the candidate effective melting depth.

[0081] The feature point closest to the third direction can be extracted from the second point set corresponding to the boundary line of the weld area near the metallographic area. Since the third direction is opposite to the first direction, the third feature point can be the lower left point of the weld area.

[0082] The shortest distance between the third feature point and the first point set can be calculated, that is, the shortest distance between the lower left point of the welding area and its upper edge. The smaller value between the candidate effective penetration depth and the shortest distance is selected as the final effective penetration depth.

[0083] In this way, by introducing the thickness of the welding area itself, that is, comparing and verifying the shortest distance between the third feature point of the lower boundary and the upper boundary, the smaller value is taken as the effective penetration depth. This improves the problem of unreasonable weld width measurement when the weld root is not completely penetrated or the image recognition is abnormal, and enhances the robustness of the algorithm and the rationality of the measurement results.

[0084] In some optional embodiments, the metallographic geometry parameters include the effective weld width, and the weld feature points include the first feature point; like Figure 9 As shown, step 602 above may include steps 901-903: Step 901: Input the third point set corresponding to the boundary line between the metallographic region and the welding region into the preset straight line equation, and solve the equation parameters of the preset straight line equation by the least squares method to obtain the reference straight line. Step 902: Determine the target vertical line corresponding to the reference line; wherein, the target vertical line passes through the fourth feature point, which is the first point set corresponding to the boundary line of the welding area away from the metallographic area, and the feature point closest to the first direction. Step 903: Determine the effective weld width based on the first feature point and the target vertical line.

[0085] In this embodiment, the third point set corresponding to the boundary line between the metallographic region and the welding region can be extracted, and the reference straight line can be obtained by fitting the third point set using the least squares method.

[0086] For example, suppose the preset line equation is: Ax + By + C = 0. We can substitute each feature point in the third point set into the preset line equation and solve for the specific values ​​of A, B and C by the least squares method to obtain the baseline line.

[0087] The fourth feature point closest to the first direction, i.e., the rightmost point of the welded area, can be extracted from the first point set corresponding to the boundary line of the welded area away from the metallographic area.

[0088] Based on the slope of the reference line, the target perpendicular line of the reference line can be drawn through the fourth feature point, and the distance from the first feature point, i.e. the rightmost point of the weld, to the target perpendicular line can be calculated. This distance is the effective weld width.

[0089] In this way, by fitting the boundary line between the metallographic and welded areas as a reference, constructing a perpendicular line through the fourth specific point, and finally combining the first feature point to determine the effective weld width, a measurement coordinate system related to the metallographic structure is established. This makes the measurement of the effective weld width independent of the overall direction or position of the weld image, thus improving the stability and accuracy of the measurement results.

[0090] In some optional embodiments, the metallographic geometry parameters include at least one of the protrusion height and penetration depth; like Figure 10 As shown, step 104 above may include steps 1001-1003: Step 1001: Input the third point set corresponding to the boundary line between the metallographic region and the welding region into the preset straight line equation, and solve the equation parameters of the preset straight line equation by the least squares method to obtain the reference straight line. Step 1002: Based on the welding area, extract welding feature points; wherein, the welding feature points include at least one of the fifth feature point and the sixth feature point, the fifth feature point is the feature point farthest from the reference line in the first point set corresponding to the boundary line of the welding area away from the metallographic area; the sixth feature point is the feature point farthest from the reference line in the fourth point set corresponding to the side of the welding area on the reference line closer to the metallographic area. Step 1003: Determine the metallographic geometric parameters of the welding object based on the reference straight line and welding feature points.

[0091] In this embodiment, as mentioned above, the third point set corresponding to the boundary line between the metallographic region and the welding region can be extracted, and the reference straight line can be obtained by fitting the third point set using the least squares method.

[0092] Welding feature points can be extracted based on the welding area, namely at least one of the fifth and sixth feature points.

[0093] The fifth feature point can be the feature point farthest from the reference line in the first point set corresponding to the boundary line of the welded area away from the metallographic area. In other words, find the point farthest from the reference line in the upper edge point set of the welded area, i.e., the upper tangent point.

[0094] The sixth feature point can be the feature point in the fourth point set corresponding to the side of the welded area closer to the metallographic region on the reference line that is farthest from the reference line. In other words, find the point in the point set of the welded area below the reference line that is farthest from the reference line, i.e., the inverted point.

[0095] At least one of the protrusion height and penetration depth of the welded object can be calculated based on a reference line and weld feature points. For example, the distance between the weld feature points and the reference line can be calculated, and then the protrusion height and penetration depth can be calculated.

[0096] Among them, point The distance to the reference line can be: .

[0097] In this way, by using a reference straight line and extracting extreme points from the boundary of the welding area, namely the fifth and sixth feature points, the measurement of protrusion height and penetration depth can be achieved, which can enrich the evaluation dimensions of welding quality and improve the overall detection efficiency without the need for additional image processing.

[0098] In some optional embodiments, the metallographic geometry parameters include the protrusion height, and the weld feature point includes a fifth feature point; step 1003 above may include: The vertical distance between the fifth feature point and the reference line is determined as the protrusion height.

[0099] In this embodiment, the vertical distance between the fifth feature point, i.e., the upper tangent point and the reference line, can be calculated as the protrusion height.

[0100] In this way, the bulge height can be calculated by the vertical distance from the tangent point on the welding area to the baseline. The definition is clear and the calculation is simple. It can effectively quantify the excess height on the weld surface and provide key data for evaluating the weld appearance and stress concentration.

[0101] In some optional embodiments, the metallographic geometry parameters include penetration depth, and the weld feature point includes a sixth feature point; step 1003 above may include: The vertical distance between the sixth feature point and the reference line is determined as the penetration depth.

[0102] In this embodiment, the vertical distance between the sixth feature point, i.e., the lower tangent point and the reference line, can be calculated as the penetration depth.

[0103] In this way, the penetration depth can be calculated by the vertical distance from the lower tangent point of the welding area to the baseline, which can directly reflect the fusion range of the weld in the thickness direction. It is clearly defined, simple to calculate, and provides key data for evaluating welding heat input and penetration.

[0104] In some alternative embodiments, such as Figure 11 As shown, after performing the first semantic segmentation process on the metallographic image of the welded object to obtain the welded area and the metallographic area in the metallographic image, the method may further include steps 1101-1103: Step 1101: Obtain the first coordinate of the first endpoint and the second coordinate of the second endpoint of the welding area; the first endpoint and the second endpoint are endpoints located at both ends of the weld extension direction; Step 1102: Determine the orientation of the weld area in the metallographic image based on the first and second coordinates; Step 1103: When the orientation is not a preset orientation, the metallographic image is mirrored and flipped along the weld extension direction.

[0105] In this embodiment, since the placement orientation of the metallographic sample may be inconsistent, the obtained metallographic image will have two orientations: one with the weld on the left and the other with the weld on the right. In order to ensure the consistency of subsequent processing logic, the metallographic images with different orientations need to be flipped to a unified orientation.

[0106] In this embodiment, the preset direction is the direction in which the weld is located. It can be set to the left or the right. The following description will take the preset direction as the left and the non-preset direction as the right as an example.

[0107] First, the metallographic orientation needs to be determined. Since the shape of the welded area is relatively fixed, the orientation can be determined through the welded area. For example, after performing the first semantic segmentation process on the metallographic image of the welded object to obtain the welded area and the metallographic region in the metallographic image, the set of vertices of the boundary polygon of the region can be extracted through the mask of the welded area, and the first coordinate of the first endpoint and the second coordinate of the second endpoint of the welded area can be calculated.

[0108] The first and second endpoints are the endpoints located at both ends of the weld extension direction, i.e., the left and right endpoints of the welding area.

[0109] The orientation of the weld area in the metallographic image can be determined based on the first and second coordinates. Taking an image coordinate system with the origin at the top left corner of the image as an example, the longitudinal positional relationship between the two endpoints can be compared based on the first and second coordinates. If the longitudinal coordinate of the left endpoint is greater than that of the right endpoint, the weld is determined to be located on the right side of the metallographic image. In this case, the metallographic image can be mirrored along the weld extension direction, that is, the metallographic image and the mask of all areas are mirrored to make the weld uniformly located on the left side of the metallographic image.

[0110] In this way, by identifying the weld direction and performing necessary mirror flipping, the subsequent image segmentation and feature extraction algorithms can work in a consistent coordinate system regardless of the placement orientation of the original metallographic sample. This reduces the standardization requirements for sample preparation and photography, and improves the convenience and fault tolerance of the welding inspection method in practical applications.

[0111] In some alternative embodiments, such as Figure 12 As shown, after determining the metallographic geometric parameters of the welded object based on the welding area, metallographic area, and weld seam area, the method may further include steps 1201-1202: Step 1201: Determine the actual physical size corresponding to the metallographic geometric parameters based on the metallographic geometric parameters and the mapping relationship between unit pixels and physical size; Step 1202: Generate annotation information in the metallographic image. The annotation information includes the position information indicated by the metallographic geometric parameters and the actual physical dimensions corresponding to the metallographic geometric parameters.

[0112] In this embodiment, after calculating the metallographic geometric parameters, the measurement results need to be visualized to facilitate inspection by testing personnel. The metallographic geometric parameters reflecting pixel distance can be converted based on the mapping relationship between unit pixels and physical dimensions to obtain the actual physical dimensions corresponding to the metallographic geometric parameters, which are then visually annotated on the metallographic image.

[0113] like Figure 13 As shown, in the metallographic image 200, a reference line 1301, a tangent line 1302, a perpendicular line 1303 to the reference line passing through the first feature point, and a perpendicular line 1304 to the reference line passing through the fourth feature point can be drawn. Bidirectional line segments with arrows are used to label each distance parameter, and the label text includes the parameter type and the actual physical dimension value, i.e., the labeling information. It can be understood that bidirectional line segments with arrows can be used to reflect the positional information indicated by the metallographic geometric parameters.

[0114] In some examples, if the metallographic image is mirrored in a previous step, the coordinates of each annotation are mirrored to ensure that the annotations are aligned with the original metallographic image.

[0115] Finally, it can output structured data and visualizations containing the measurement results.

[0116] In this way, by mapping pixels to physical dimensions, metallographic geometric parameters are transformed into actual physical dimensions and marked at the corresponding positions in the metallographic image, realizing the transformation from pixel space to real physical space and the visualization of the results.

[0117] In some alternative embodiments, such as Figure 14 As shown, before performing the first semantic segmentation process on the metallographic image of the welded object to obtain the welded area and the metallographic area in the metallographic image, the method may further include steps 1401-1402: Step 1401: Obtain the initial metallographic image of the object to be welded; Step 1402: Preprocess the initial metallographic image to obtain a metallographic image of the welded object; wherein, the preprocessing includes at least one of image size transformation, vector transformation and normalization processing.

[0118] In this embodiment, after obtaining the initial metallographic image of the sealing nail using a microscope and an imager, it can be preprocessed before being input into the first semantic segmentation model. The preprocessing includes at least one of image size transformation, vector transformation and normalization, thereby obtaining the final metallographic image input into the first semantic segmentation model.

[0119] For example, information such as the standard image size and format required by the first semantic segmentation model can be obtained. If the initial metallographic image does not conform to this standardized information, it can be preprocessed by transforming its image size, converting it into a sensor tensor vector, and normalizing it.

[0120] In this way, by performing operations such as resizing, format unification, and normalization on the original images, the inconsistency in image quality caused by differences in shooting equipment, lighting conditions, and sample size can be eliminated. This standardizes the input data and creates conditions for the stable and high-performance operation of the subsequent semantic segmentation network, thereby improving the accuracy and reliability of the entire system.

[0121] Based on the above welding inspection method, this application also provides specific scenario embodiments of the welding inspection method. For example... Figure 15 As shown, this scenario embodiment may include the following steps: Step 1501: Obtain the initial metallographic image of the object to be welded; Step 1502: Preprocess the initial metallographic image; Step 1503: Perform first semantic segmentation processing on the preprocessed metallographic image; Step 1504, adaptive determination of metallographic orientation; Step 1505: Fit the baseline line; Step 1506: Calculate the protrusion height and penetration depth; Step 1507: Based on the first semantic segmentation result, extract the weld image from the metallographic image and perform second semantic segmentation on the weld image; Step 1508: Calculate the effective melt depth and effective melt width; Step 1509: Visualize the measurement results of protrusion height, penetration depth, effective melt depth, and effective melt width.

[0122] like Figure 16 As shown in the figure, this application embodiment also provides a welding inspection device 1600, which may include: The first semantic segmentation processing module 1601 is used to perform first semantic segmentation processing on the metallographic image of the welded object to obtain the welded area and the metallographic area in the metallographic image. The image cropping module 1602 is used to crop a weld image from a metallographic image based on the position of the weld area in the metallographic image; the weld image includes at least a portion of the weld area; The second semantic segmentation processing module 1603 is used to perform second semantic segmentation processing on the weld image to obtain the weld region. The determination module 1604 is used to determine the metallographic geometric parameters of the welded object based on the welding area, metallographic area and weld seam area.

[0123] In this way, the welding and metallographic regions are coarsely located through the first semantic segmentation, and then the welding region is finely extracted by performing the second semantic segmentation on the weld image cropped from the original image. This improves the accuracy of the single-stage model when segmenting small and complex weld structures due to information loss, improves the accuracy of weld region extraction, and realizes high-precision measurement of metallographic geometric parameters, thereby improving the reliability of welding inspection.

[0124] Figure 17 A schematic diagram of the hardware structure of the electronic device provided in an embodiment of this application is shown.

[0125] Electronic device 1700 may include processor 1701 and memory 1702 storing programs or instructions. When processor 1701 executes a program, it implements the steps in any of the above method embodiments.

[0126] For example, the program can be divided into one or more modules / units, one or more of which are stored in memory 1702 and executed by processor 1701 to complete this application. The one or more modules / units can be a series of program instruction segments capable of performing a specific function, which describe the execution process of the program in the device.

[0127] Specifically, the processor 1701 may include a central processing unit (CPU), an application-specific integrated circuit (ASIC), or one or more integrated circuits that can be configured to implement the embodiments of this application.

[0128] Memory 1702 may include mass storage for data or instructions. For example, and not limitingly, memory 1702 may include a hard disk drive (HDD), floppy disk drive, flash memory, optical disk, magneto-optical disk, magnetic tape, or Universal Serial Bus (USB) drive, or a combination of two or more of these. Where appropriate, memory 1702 may include removable or non-removable (or fixed) media. Where appropriate, memory 1702 may be internal or external to the integrated gateway disaster recovery device. In a particular embodiment, memory 1702 is non-volatile solid-state memory.

[0129] Memory may include read-only memory (ROM), random access memory (RAM), disk storage media devices, optical storage media devices, flash memory devices, and electrical, optical, or other physical / tangible memory storage devices. Therefore, typically, memory includes one or more tangible (non-transitory) readable storage media (e.g., memory devices) encoded with software including computer-executable instructions, and when the software is executed (e.g., by one or more processors), it is operable to perform the operations described with reference to the method according to one aspect of this disclosure.

[0130] The processor 1701 implements any of the methods described above by reading and executing programs or instructions stored in the memory 1702.

[0131] In one example, the electronic device may also include a communication interface 1703 and a bus 1704. The processor 1701, memory 1702, and communication interface 1703 are connected via the bus 1704 and communicate with each other.

[0132] The communication interface 1703 is mainly used to realize communication between various modules, devices, units and / or equipment in the embodiments of this application.

[0133] Bus 1704 includes hardware, software, or both, that couples components of an online data traffic metering device together. For example, and not limitingly, the bus may include an Accelerated Graphics Port (AGP) or other graphics bus, an Enhanced Industry Standard Architecture (EISA) bus, a Front Side Bus (FSB), HyperTransport (HT) interconnect, an Industry Standard Architecture (ISA) bus, an Infinite Bandwidth Interconnect, a Low Pin Count (LPC) bus, a memory bus, a Microchannel Architecture (MCA) bus, a Peripheral Component Interconnect (PCI) bus, a PCI-Express (PCI-X) bus, a Serial Advanced Technology Attachment (SATA) bus, a Video Electronics Standards Association Local (VLB) bus, or other suitable buses, or combinations of two or more of these. Where appropriate, bus 1704 may include one or more buses. Although specific buses are described and illustrated in embodiments of this application, any suitable bus or interconnect is contemplated herein.

[0134] Furthermore, in conjunction with the methods in the above embodiments, this application embodiment can provide a machine-readable storage medium for implementation. This machine-readable storage medium stores a program or instructions; when executed by a processor, the program or instructions implement any of the methods in the above embodiments. This machine-readable storage medium can be read by a machine such as a computer.

[0135] This application embodiment also provides a chip, which includes a processor and a communication interface. The communication interface is coupled to the processor. The processor is used to run programs or instructions to implement the various processes of the above method embodiments and achieve the same technical effect. To avoid repetition, it will not be described again here.

[0136] It should be understood that the chip mentioned in the embodiments of this application may also be referred to as a system-on-a-chip, system chip, chip system, or system-on-a-chip, etc.

[0137] This application provides a computer program product stored in a machine-readable storage medium. The program product is executed by at least one processor to implement the various processes of the above method embodiments and achieve the same technical effects. To avoid repetition, it will not be described again here.

[0138] It should be clarified that this application is not limited to the specific configurations and processes described above and shown in the figures. For the sake of brevity, detailed descriptions of known methods are omitted here. In the above embodiments, several specific steps are described and shown as examples. However, the method process of this application is not limited to the specific steps described and shown. Those skilled in the art can make various changes, modifications, and additions, or change the order of steps, after understanding the spirit of this application.

[0139] The functional modules shown in the above-described block diagram can be implemented as hardware, software, firmware, or a combination thereof. When implemented in hardware, they can be, for example, electronic circuits, application-specific integrated circuits (ASICs), appropriate firmware, plug-ins, function cards, etc. When implemented in software, the elements of this application are programs or code segments used to perform the required tasks. Programs or code segments can be stored on a machine-readable medium or transmitted over a transmission medium or communication link via data signals carried on a carrier wave. "Machine-readable medium" can include any medium capable of storing or transmitting information. Examples of machine-readable media include electronic circuits, semiconductor memory devices, ROM, flash memory, erasable ROM (EROM), floppy disks, CD-ROMs, optical disks, hard disks, fiber optic media, radio frequency (RF) links, etc. Code segments can be downloaded via computer grids such as the Internet, intranets, etc.

[0140] It should also be noted that the exemplary embodiments mentioned in this application describe methods or systems based on a series of steps or apparatus. However, this application is not limited to the order of the above steps; that is, the steps can be performed in the order mentioned in the embodiments, or in a different order, or several steps can be performed simultaneously.

[0141] The aspects of this disclosure have been described above with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and program products according to embodiments of this disclosure. It should be understood that each block in the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by a computer program or instructions. These programs or instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing apparatus to produce a machine such that these instructions, executable via the processor of the computer or other programmable data processing apparatus, enable the implementation of the functions / actions specified in one or more blocks of the flowchart illustrations and / or block diagrams. Such a processor can be, but is not limited to, a general-purpose processor, a special-purpose processor, a special application processor, or a field-programmable logic circuit. It is also understood that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can also be implemented by special-purpose hardware performing the specified functions or actions, or can be implemented by a combination of special-purpose hardware and computer instructions.

[0142] Although this application has been described with reference to preferred embodiments, various modifications can be made thereto and components can be replaced with equivalents without departing from the scope of this application. In particular, the technical features mentioned in the various embodiments can be combined in any manner, provided there is no structural conflict. This application is not limited to the specific embodiments disclosed herein, but includes all technical solutions falling within the scope of the claims.

Claims

1. A welding inspection method, characterized in that, The method includes: A first semantic segmentation process is performed on the metallographic image of the welded object to obtain the welded area and the metallographic area in the metallographic image; Based on the location of the welded area in the metallographic image, a weld image is extracted from the metallographic image; the weld image includes at least a portion of the welded area. The weld image is subjected to a second semantic segmentation process to obtain the weld region; Based on the weld area, weld feature points are extracted; wherein, the weld feature points include at least one of a first feature point and a second feature point, the first feature point being the feature point in the point set corresponding to the weld area that is closest to a first direction, the first direction being the extension direction of the weld near one end of the weld area; the second feature point being the feature point in the point set corresponding to the weld area that is closest to a second direction and whose distance from the first feature point is less than or equal to a distance threshold, the second direction being the extension direction perpendicular to the first direction and away from the metallographic area. Based on the weld feature points and the boundary of the welding area, the metallographic geometric parameters of the welded object are determined; the metallographic geometric parameters include at least one of effective penetration depth and effective weld width.

2. The method according to claim 1, characterized in that, The metallographic geometric parameters include the effective penetration depth, and the weld feature points include the second feature points; The step of determining the metallographic geometric parameters of the welded object based on the weld feature points and the boundary of the welded area includes: Extract the first set of points corresponding to the boundary line of the welding area away from the metallographic area; The effective melting depth is determined based on the Euclidean distance between each feature point in the first point set and the second feature point.

3. The method according to claim 2, characterized in that, The step of determining the effective penetration depth based on the Euclidean distance between each feature point in the first point set and the second feature point includes: The minimum value of the Euclidean distance between each feature point in the first point set and the second feature point is determined as the effective melting depth.

4. The method according to claim 2, characterized in that, The step of determining the effective penetration depth based on the Euclidean distance between each feature point in the first point set and the second feature point includes: The minimum value of the Euclidean distance between each feature point in the first point set and the second feature point is determined as the candidate effective melting depth; Determine the shortest distance between the third feature point and the first set of points; wherein, the third feature point is the feature point closest to the third direction in the second set of points corresponding to the boundary line of the welding area near the metallographic area, the third direction is parallel to the first direction, and the direction of the third direction is opposite to the direction of the first direction; The smaller value between the candidate effective penetration depth and the shortest distance is determined as the effective penetration depth.

5. The method according to any one of claims 1 to 4, characterized in that, The metallographic geometric parameters include the effective weld width, and the weld feature points include the first feature point; The step of determining the metallographic geometric parameters of the welded object based on the weld feature points and the boundary of the welded area includes: Input the third point set corresponding to the boundary line between the metallographic region and the welding region into the preset straight line equation, and solve the equation parameters of the preset straight line equation by the least squares method to obtain the reference straight line; Determine the target perpendicular line corresponding to the reference straight line; wherein, the target perpendicular line passes through the fourth feature point, the fourth feature point is the feature point closest to the first direction in the first point set corresponding to the boundary line of the welding area away from the metallographic area; The effective weld width is determined based on the first feature point and the target vertical line.

6. The method according to claim 1, characterized in that, The metallographic geometric parameters also include at least one of the protrusion height and penetration depth; The method further includes: Input the third point set corresponding to the boundary line between the metallographic region and the welding region into the preset straight line equation, and solve the equation parameters of the preset straight line equation by the least squares method to obtain the reference straight line; Based on the welding area, welding feature points are extracted; wherein, the welding feature points include at least one of a fifth feature point and a sixth feature point, the fifth feature point is the feature point farthest from the reference line in the first point set corresponding to the boundary line of the welding area away from the metallographic area; the sixth feature point is the feature point farthest from the reference line in the fourth point set corresponding to the side of the welding area on the reference line closer to the metallographic area. The metallographic geometric parameters of the welded object are determined based on the reference straight line and the welding feature points.

7. The method according to claim 6, characterized in that, The metallographic geometric parameters include the protrusion height, and the welding feature point includes the fifth feature point; The step of determining the metallographic geometric parameters of the welded object based on the reference straight line and the welding feature points includes: The vertical distance between the fifth feature point and the reference line is determined as the protrusion height.

8. The method according to claim 6, characterized in that, The metallographic geometric parameters include penetration depth, and the welding feature point includes the sixth feature point; The step of determining the metallographic geometric parameters of the welded object based on the reference straight line and the welding feature points includes: The vertical distance between the sixth feature point and the reference line is determined as the penetration depth.

9. The method according to claim 1, characterized in that, After performing a first semantic segmentation process on the metallographic image of the welded object to obtain the welded area and the metallographic area in the metallographic image, the method further includes: Obtain the first coordinates of the first endpoint and the second coordinates of the second endpoint of the welding area; the first endpoint and the second endpoint are endpoints located at both ends of the weld extension direction; The orientation of the weld area in the metallographic image is determined based on the first coordinate and the second coordinate; If the direction is not a preset direction, the metallographic image is mirrored along the weld extension direction.

10. The method according to claim 1, characterized in that, After determining the metallographic geometric parameters of the welded object based on the welded area, the metallographic area, and the weld seam area, the method further includes: Based on the metallographic geometric parameters and the mapping relationship between unit pixels and physical dimensions, the actual physical dimensions corresponding to the metallographic geometric parameters are determined. Annotation information is generated in the metallographic image. The annotation information includes the position information indicated by the metallographic geometric parameters and the actual physical dimensions corresponding to the metallographic geometric parameters.

11. The method according to claim 1, characterized in that, Before performing the first semantic segmentation process on the metallographic image of the welded object to obtain the welded area and the metallographic area in the metallographic image, the method further includes: Obtain the initial metallographic image of the object to be welded; The initial metallographic image is preprocessed to obtain the metallographic image of the welded object; wherein the preprocessing includes at least one of image size transformation, vector transformation and normalization processing.

12. A welding inspection device, characterized in that, The device includes: The first semantic segmentation processing module is used to perform first semantic segmentation processing on the metallographic image of the welded object to obtain the welded area and the metallographic area in the metallographic image. An image cropping module is used to crop a weld image from a metallographic image based on the position of the welded area in the metallographic image; the weld image includes at least a portion of the welded area; The second semantic segmentation processing module is used to perform second semantic segmentation processing on the weld image to obtain the weld region; The determination module is used for: Based on the weld area, weld feature points are extracted; wherein, the weld feature points include at least one of a first feature point and a second feature point, the first feature point being the feature point in the point set corresponding to the weld area that is closest to a first direction, the first direction being the extension direction of the weld near one end of the weld area; the second feature point being the feature point in the point set corresponding to the weld area that is closest to a second direction and whose distance from the first feature point is less than or equal to a distance threshold, the second direction being the extension direction perpendicular to the first direction and away from the metallographic area. Based on the weld feature points and the boundary of the welding area, the metallographic geometric parameters of the welded object are determined; the metallographic geometric parameters include at least one of effective penetration depth and effective weld width.

13. An electronic device, characterized in that, The device includes: a processor and a memory storing program instructions; the processor, when executing the program instructions, implements the method as described in any one of claims 1 to 11.

14. A machine-readable storage medium, characterized in that, The machine-readable storage medium stores program instructions that, when executed by a processor, implement the method as described in any one of claims 1 to 11.

15. A computer program product, characterized in that, When the instructions in the computer program product are executed by the processor of the electronic device, the electronic device causes the electronic device to perform the method as described in any one of claims 1 to 11.