An image positioning method for defects of aluminum alloy shell welding joints

By constructing concave vectors and regional features in aluminum alloy welded joints and combining them with dual threshold judgment, the problem of high false alarm rate of traditional edge detection algorithms in aluminum alloy welded joints is solved, and accurate identification and type differentiation of defects are achieved.

CN120807510BActive Publication Date: 2025-12-05SHAANXI JINXIN ELECTRIC APPLIANCE CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202511300644.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-09-12
Publication Date
2025-12-05
Estimated Expiration
2045-09-12

AI Technical Summary

Technical Problem

In existing technologies, traditional edge detection algorithms have difficulty effectively distinguishing between normal welding ripples and real defects in aluminum alloy welded joints, resulting in a high false alarm rate and difficulty in accurately determining the type and extent of defects.

Method used

By acquiring images of the welded joints of the aluminum alloy shell, edge detection is performed and a concave vector is constructed. Combining the geometric shape of the edge and regional features, the degree of anomaly of the edge and region is calculated. A dual threshold is set for joint judgment to distinguish between normal welding ripples and real defects.

Benefits of technology

It enables accurate location of defects in aluminum alloy welded joints, reduces false alarm rate, and can clearly distinguish between linear and block defects, providing accurate information for subsequent quality assessment and automated repair.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120807510B_ABST
    Figure CN120807510B_ABST
Patent Text Reader

Abstract

The application relates to the technical field of image processing, in particular to an image positioning method for defects of an aluminum alloy shell welding joint, which comprises the following steps: processing an image to obtain a welding area through segmentation; performing edge detection on the welding area to obtain a plurality of edges, and constructing a concave vector representing the concave direction of the edges; calculating the edge abnormality degree of the edges according to the correctness of the directions of the edges and the concave vector; generating a concave area block on one side of the edges, and calculating the area abnormality degree of the concave area block according to the concave area block; and determining the welding defects according to the edge abnormality degree and the area abnormality degree, so as to realize the image positioning of the defects of the aluminum alloy shell welding joint. Through the technical scheme, the normal welding corrugation and the real defects can be effectively distinguished, the linear defects such as cracks and the blocky defects such as welding bumps can be distinguished, and the accuracy of defect positioning is significantly improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of image processing technology, and in particular to an image localization method for defects in welded joints of aluminum alloy shells. Background Technology

[0002] Welding is a critical step in the manufacturing process of aluminum alloy components. The quality of the welded joints is directly related to the safety and reliability of the entire product. However, due to the influence of various factors such as process parameters and operating environment, various welding defects such as porosity, cracks, incomplete penetration, and weld beads are inevitably generated during the welding process.

[0003] Currently, edge detection algorithms are the fundamental means of extracting defect features. However, after aluminum alloys are welded, a layer of arc-shaped patterns resembling fish scales, arranged in a regular pattern, naturally forms on their surface, known as welding ripples. These normal welding ripples also appear as edges with obvious gradient changes in images, and their edge features are very similar to some real defects in local areas.

[0004] If only traditional edge detection algorithms are used, the system will misclassify a large number of normal welding ripples as defects, resulting in a high false alarm rate. Furthermore, traditional methods struggle to effectively distinguish whether detected edges represent linear defects like cracks or blocky or regional defects like weld beads or porosity clusters. Therefore, effectively distinguishing normal welding ripples from true defect edges and accurately determining the type and extent of defects is a pressing technical problem that needs to be solved in the current technology. Summary of the Invention

[0005] To address the technical problem that existing edge detection algorithms cannot effectively distinguish between normal welding ripples and defect edges, this application provides an image localization method for defects in welded joints of aluminum alloy shells, which can effectively distinguish between normal welding ripples and real defects.

[0006] This application provides an image localization method for defects in welded joints of aluminum alloy shells, comprising: acquiring an image of the welded area of ​​the aluminum alloy shell, and processing the image to segment the welded area; performing edge detection on the welded area to obtain multiple edges, and constructing a concave vector representing the concavity orientation of each edge based on its geometric shape; calculating the edge anomaly degree of the edge based on the length, curvature, smoothness of the edge, and the correctness of the direction of the concave vector; generating a concave region block on the concave side of the edge, and calculating the region anomaly degree of the concave region block based on its area, shape, and extension direction; and determining the weld defect based on the edge anomaly degree and the region anomaly degree to achieve image localization of defects in welded joints of aluminum alloy shells.

[0007] This application can comprehensively judge the geometric shape and directionality of the edge and the attributes of its concave region. By constructing two evaluation dimensions, edge anomaly degree and region anomaly degree, it can conduct collaborative analysis from two levels: micro-line features and macro-region features. This effectively distinguishes normal welding ripples with regular shapes from real defects with irregular shapes, thus effectively reducing the false alarm rate.

[0008] In one embodiment, constructing a concave vector representing the concavity orientation of each edge based on its geometry includes: connecting the two endpoints of the edge to form a line segment; determining the midpoint of the edge that is farthest from the line segment; and constructing a concave vector with the midpoint of the line segment as the starting point and the midpoint of the edge as the ending point.

[0009] In one embodiment, the degree of edge anomaly satisfies the following relationship: ;in, Indicates the degree of edge anomaly. Indicates the length of the edge. This represents the distance between the two endpoints of the edge. This is the preset ratio of the length of a normal welding corrugation to the distance between the corrugation ends. This represents the distance from the midpoint of the edge to the line segment. This represents the standard deviation of the curvature at each pixel on the edge. This represents the largest standard deviation of curvature among all edges. This represents the angle between the concave vector of the edge and the reference concave vector.

[0010] A comprehensive anomaly scoring system was constructed by evaluating multiple dimensions such as the curvature of the edge, the smoothness of the edge, and the correctness of the orientation, which has effective discrimination and accuracy.

[0011] In one embodiment, the reference concave vector is determined by performing mean-shift clustering analysis on the concave vectors of all edges; the center vector corresponding to the category containing the most edges is determined as the reference concave vector.

[0012] Since most edges in the image are normal welding ripples with a high degree of consistency in their concave direction, the mean shift non-parametric clustering algorithm can automatically find the mainstream edge direction without manual preset, thus having a stronger adaptive capability.

[0013] In one embodiment, generating the concave region block on the concave side of the edge includes: determining a reference line through the welding area within the welding area and setting multiple initial seed points; selecting the initial seed point closest to the edge and located on its concave side as the concave region seed point of the edge; and performing region growth starting from the concave region seed point to generate the concave region block.

[0014] In one embodiment, the stopping condition for the region growth is: the growth region comes into contact with an edge pixel, or the difference between the gray value of the newly grown pixel in the growth region and the gray value of the seed point in the concave region is greater than a preset gray value threshold, or the gradient value of the newly grown pixel is greater than a preset gradient threshold.

[0015] In one embodiment, the degree of anomaly in the region satisfies the following relationship: Where Q represents the degree of anomaly in the region, and n represents the number of pixels contained in the concave region block. This is the average number of pixels in all concave regions. Let be the area of ​​the circumscribed rectangle of the concave region block. Let be the area of ​​the circumscribed square of the concave region block. The angle between the longer side of the circumscribed rectangle and the normal vector of the welding area is given.

[0016] In one embodiment, determining welding defects based on the degree of edge anomaly and the degree of regional anomaly includes: setting an edge anomaly threshold and a regional anomaly threshold; determining the edge as an abnormal edge when the degree of edge anomaly is greater than the edge anomaly threshold; determining the concave region block as an abnormal region block when the degree of regional anomaly is greater than the region anomaly threshold; and classifying and marking the defects based on the determination results of the abnormal edge and the abnormal region block.

[0017] By setting dual thresholds, a two-dimensional decision space is constructed, which can jointly judge the abnormal information in both the edge and region dimensions. This not only improves the detection accuracy, but also clearly distinguishes linear defects with edge anomalies and block defects with anomalies in both the edge and region.

[0018] In one embodiment, the classification and labeling of defects includes: if the edge is determined to be an abnormal edge and its corresponding concave region block is not determined to be an abnormal region block, then the edge is labeled as a linear defect; if the edge is determined to be an abnormal edge and its corresponding concave region block is determined to be an abnormal region block, then the edge and the concave region block are jointly labeled as a block defect.

[0019] In one embodiment, when the edge is a closed edge, its edge anomaly degree is considered to be zero, and the concave region block of the edge is directly generated, and the presence of block defects is determined only based on the region anomaly degree of the concave region block.

[0020] The technical solution of this application has the following beneficial technical effects:

[0021] This application can analyze the linear features of the edge itself, as well as the planar features of the region associated with the edge. This line-planar combined analysis method provides a more robust judgment basis compared with the traditional method that only analyzes the edge. It can fundamentally distinguish between normal welding ripples and real defects that have similar edge features but completely different regional attributes.

[0022] Furthermore, by jointly determining the threshold of the two anomalies, the present invention can accurately locate the defect as a linear defect or a block defect, providing more accurate information for subsequent quality assessment and automated repair. Attached Figure Description

[0023] Figure 1 This is a flowchart of an image localization method for a welded joint defect in an aluminum alloy shell, according to an embodiment of this application.

[0024] Figure 2 This is an example image of a weld joint according to an embodiment of this application.

[0025] Figure 3 This is a simplified model diagram of welding ripples according to an embodiment of this application.

[0026] Figure 4 This is a schematic diagram of seed point setting according to an embodiment of this application. Detailed Implementation

[0027] The technical solutions in the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments.

[0028] Figure 1 This is a flowchart illustrating an image localization method for a welded joint defect in an aluminum alloy shell, according to an embodiment of this application. Figure 1 As shown, the image localization method for defects in the welded joint of the aluminum alloy shell includes steps S101 to S105, which are described in detail below.

[0029] S101: Acquire images of the welded joints of the aluminum alloy shell and process the images to segment the welded area.

[0030] In one embodiment, a high-resolution image of the welded joint of the aluminum alloy shell to be inspected can be acquired using image acquisition equipment such as an industrial camera, for example... Figure 2 The image shown is an example of a weld joint image according to an embodiment of this application.

[0031] Furthermore, in order to eliminate the interference of color information and simplify the calculation, the acquired color image is converted into a grayscale image. Then, a semantic segmentation algorithm (such as U-Net) is used to process the grayscale image to segment the welding area in the image. The segmented welding area will be used as the target area for all subsequent analysis steps.

[0032] In this way, by accurately segmenting the welding area, the scope of subsequent analysis is defined, interference from non-target areas is effectively eliminated, and the accuracy and computational efficiency of subsequent steps are improved.

[0033] S102, perform edge detection on the welding area to obtain multiple edges, and construct a concave vector representing the concavity orientation based on the geometry of each edge.

[0034] In one embodiment, the Canny edge detection algorithm can be applied to perform edge detection on the welding area, detect pixels in the image where the grayscale value changes abruptly, and connect these pixels into independent edges to obtain multiple edges.

[0035] In this optional embodiment, such as Figure 3 The diagram shown is a simplified model of welding ripples according to an embodiment of this application. Normal welding ripples exhibit an arc shape with a generally consistent concave direction. For each detected non-closed edge, a concave vector representing the direction of its concavity can be constructed. The specific construction process is as follows: First, connect the two endpoints of the edge to form a virtual straight line segment; then find the point on the edge that is furthest from the vertical distance of the line segment, i.e., the midpoint of the edge; finally, construct a vector with the midpoint of the line segment as the starting point and the midpoint of the edge as the ending point, which is the concave vector of the edge.

[0036] Furthermore, in order to establish a unified comparison benchmark, a reference concave vector can be determined. The specific method is as follows: collect the concave vectors of all edges in the image, use the mean-shift clustering algorithm to cluster these vectors, and finally determine the center vector corresponding to the category containing the most vectors as the current detection reference concave vector.

[0037] Thus, by constructing a concave vector and adaptively determining a reference concave vector, a reliable benchmark is provided for subsequently judging the correctness of the direction of each edge.

[0038] S103, calculate the edge anomaly degree based on the edge length, curvature, smoothness, and the correctness of the concave vector direction.

[0039] In an optional embodiment, for each acquired edge, the edge anomaly degree can be calculated based on the edge's length, curvature, smoothness, and the correctness of the concave vector direction. The edge anomaly degree satisfies the following relationship:

[0040]

[0041] in, Indicates the degree of edge anomaly. Indicates the length of the edge. Indicates the distance between the two endpoints of the edge. The ratio of the length of a normal welding corrugation to the distance between the corrugation ends is a preset value, which is an empirical value obtained from statistics in practice. For example, the value is 1.3. This represents the distance from the midpoint of the edge to the line segment. This represents the standard deviation of curvature at each pixel on the edge. It represents the largest standard deviation of curvature among all edges, reflecting the smoothness of the edge; This represents the angle between the concave vector of the edge and the reference concave vector.

[0042] Specifically, This represents the difference between the length of the target edge and the length assuming the target edge has normal welding ripples. and All of these can reflect the degree of concavity or curvature of the target edge. Since the curvature of welding ripples is generally small, to make it more sensitive to abnormal straight edges (such as cracks), [the following is added]... The closer the target edge is to a straight line, the better. The larger the value and the closer it is to 1, the greater the degree of edge anomaly of the target. It is worth noting that... for The simplified form of .

[0043] Furthermore, This reflects the correctness of the concave direction of the target edge. During welding, the concave direction of normal weld ripples is consistent, while the concave direction of a defective edge may differ from, or even be completely opposite to, the normal weld ripples. Therefore, when the target edge exhibits normal weld ripples, i.e. The smaller, The smaller the value, the smaller the edge anomaly of the target edge; when the target edge is the edge of a defect, that is... When it is larger, The larger the value, the greater the degree of edge anomaly. The degree of edge anomaly comprehensively assesses the length, curvature, smoothness, and direction of the edge. The greater the degree of edge anomaly, the more the shape of the edge deviates from the normal welding ripples.

[0044] Thus, by quantifying the edge morphology in multiple dimensions, a numerical value can be obtained that can characterize the degree of difference between it and normal ripples, providing a key basis for subsequent judgment.

[0045] S104 generates a concave region block with its edge concave to one side, and calculates the degree of regional anomaly of the concave region block based on its area, shape, and extension direction.

[0046] In one embodiment, to obtain the attributes of the region associated with the edge, a concave region block with the edge concave to one side can be generated. For example... Figure 4 As shown, initial seed points are set up within the welding area, and the nearest seed point to the concave side of the current target edge is found. Region growth begins from this seed point until a preset stopping condition is met. The area covered by the growth is the concave region block. The preset stopping condition is either that the grown region touches an edge pixel, or the difference between the grayscale value of a newly grown pixel within the grown region and the grayscale value of the seed point in the concave region is greater than a preset grayscale threshold (a grayscale abrupt change occurs during region growth), or the gradient value of a newly grown pixel is greater than a preset gradient threshold (a gradient abrupt change occurs during region growth).

[0047] In this optional embodiment, the degree of regional anomaly of the concave region can be calculated based on the area, shape, and extension direction of the concave region, and the degree of regional anomaly satisfies the following relationship:

[0048]

[0049] Where Q represents the degree of anomaly in the region, and n represents the number of pixels contained in the concave region block of the target edge. This is the average number of pixels in the concave regions of all edges. Let be the area of ​​the bounding rectangle of the concave region. Let be the area of ​​the circumscribed square of the concave region. The angle between the long side of the circumscribed rectangle and the normal vector of the welded area is denoted as Q. The degree of anomaly in the region is comprehensively evaluated based on the area, shape, and direction of extension of the region. The higher the Q value, the less the region resembles a normal corrugated gap and more like a blocky defect.

[0050] Specifically, when The larger the value, the greater the difference between the number of pixels contained in the concave region of the target edge and the total number of pixels contained in all concave regions. This means the concave region of the target edge is either extremely small or extremely large, and is more likely to be a defect or anomalous region in the entire image; similarly, when... The smaller the size, the smaller the difference between the number of pixels contained in the concave region block of the target edge and the number of pixels contained in all the concave region blocks. That is, the area of ​​the concave region block of the target edge is similar to that of most of the concave region blocks, and the greater the possibility that it is a region block surrounded by normal welding ripples. At this time, the degree of regional anomaly of the concave region block of the target edge is smaller.

[0051] Furthermore, This reflects the rationality of the shape of the concave area, as the area enclosed by the two normal welding corrugations resembles a semi-circular ring or a slender crescent shape. Smaller in size; while weld beads and the like are large, blocky, lacking the characteristic of being slender. Relatively large.

[0052] This reflects the correctness of the extension direction of the concave region. Since the region enclosed by the welding corrugations is elongated and extends in a consistent direction, perpendicular to the welding direction, therefore, when The smaller the value, the greater the likelihood that the concave region is a region surrounded by welding corrugations, meaning the smaller the degree of regional anomaly of the concave region at the target edge; when... The larger the value, the less likely the concave area block is a region block surrounded by welding ripples, that is, the greater the degree of regional anomaly of the concave area block at the edge of the target.

[0053] Thus, by generating and evaluating regional blocks associated with the edges, another key basis for characterizing the degree of regional morphological anomalies can be obtained, laying the foundation for distinguishing between linear and blocky defects.

[0054] S105, determine welding defects based on the degree of edge anomaly and regional anomaly, so as to achieve image localization of defects in welded joints of aluminum alloy shells.

[0055] In one embodiment, to determine welding defects based on the obtained edge anomaly degree and region anomaly degree, an edge anomaly threshold and a region anomaly threshold can be set. For example, the edge anomaly threshold is 0.6 and the region anomaly threshold is 0.7.

[0056] In this optional embodiment, for each target edge, the calculated edge anomaly degree and region anomaly degree are compared with the corresponding edge anomaly threshold and region anomaly threshold, respectively. Regardless of the size of the region anomaly degree value, as long as the edge anomaly degree is not greater than the edge anomaly threshold, it means that the shape of the edge is consistent with the height of the normal welding ripple. Therefore, the edge is determined to be normal and no marking is performed.

[0057] When the degree of edge anomaly is greater than the edge anomaly threshold, the edge can be determined as an abnormal edge; when the degree of regional anomaly is greater than the regional anomaly threshold, the concave region block is determined as an abnormal region block. Based on the determination results of abnormal edges and abnormal region blocks, the defects are classified and marked.

[0058] Specifically, if an edge is determined to be an abnormal edge, and its corresponding concave area block is not determined to be an abnormal area block, this indicates that the abnormal edge does not form an abnormal blocky area. In this case, the edge is marked as a linear defect, such as a crack. If an edge is determined to be an abnormal edge, and its corresponding concave area block is determined to be an abnormal area block, this indicates that not only is the shape of the edge abnormal, but the area enclosed by the edge also deviates significantly from the normal state in terms of area, shape, or direction. In this case, the edge and the concave area block are jointly marked as blocky defects, such as weld beads or porosity groups.

[0059] It is worth noting that when the obtained edge is a special closed edge, its edge anomaly degree is regarded as zero. The concave region block of the edge can be generated directly, and the presence of block defects is determined only based on the regional anomaly degree of the concave region block. If the regional anomaly degree is greater than the regional anomaly threshold, it can be directly judged as a block defect.

[0060] In this way, not only can defects be accurately identified from a large number of normal ripples, but also the types of defects can be effectively distinguished and marked accordingly.

[0061] It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the scope of protection of this application. Therefore, the scope of protection of this patent application shall be determined by the appended claims.

Claims

1. A method for image-based localization of defects in welded joints of aluminum alloy shells, characterized in that, include: Images of the welded joints of the aluminum alloy shell are acquired, and the images are processed to segment the welded area. Edge detection is performed on the welding area to obtain multiple edges, and a concave vector representing the concavity orientation is constructed based on the geometry of each edge. The edge anomaly degree is calculated based on the edge length, curvature, smoothness, and the correctness of the concave vector direction; the edge anomaly degree satisfies the following relationship: in, Indicates the degree of edge anomaly. Indicates the length of the edge. This represents the distance between the two endpoints of the edge. This is the preset ratio of the length of a normal welding corrugation to the distance between the corrugation ends. This represents the distance from the midpoint of the edge to the line segment. This represents the standard deviation of the curvature at each pixel on the edge. This represents the largest standard deviation of curvature among all edges. The angle between the concave vector of the edge and the reference concave vector is represented. Generate a concave region block with the edge concave to one side, and calculate the degree of regional anomaly of the concave region block based on its area, shape, and extension direction; the degree of regional anomaly satisfies the following relationship: Where Q represents the degree of anomaly in the region, and n represents the number of pixels contained in the concave region block. This is the average number of pixels in all concave regions. Let be the area of ​​the circumscribed rectangle of the concave region block. Let be the area of ​​the circumscribed square of the concave region block. The angle between the longer side of the circumscribed rectangle and the normal vector of the welding area; Welding defects are determined based on the degree of edge anomaly and the degree of regional anomaly, so as to achieve image localization of defects in welded joints of aluminum alloy shells.

2. The image localization method for defects in welded joints of aluminum alloy shells according to claim 1, characterized in that, The construction of a concave vector representing the concavity orientation based on the geometry of each edge includes: Connecting the two endpoints of the edge forms a line segment; Determine the midpoint of the edge that is farthest from the line segment on the edge; A concave vector is constructed with the midpoint of the line segment as the starting point and the midpoint of the edge as the ending point.

3. The image localization method for defects in welded joints of aluminum alloy shells according to claim 1, characterized in that, The reference concave vector is determined as follows: Perform mean-shift clustering analysis on the concave vectors of all edges; The center vector corresponding to the category containing the most edges is determined as the reference concave vector.

4. The image localization method for defects in welded joints of aluminum alloy shells according to claim 1, characterized in that, The generation of the concave region block on one side of the edge includes: A reference line is defined that runs through the welding area, and multiple initial seed points are set. Select the initial seed point that is closest to the edge and located on its concave side as the seed point of the concave region of the edge; Starting from the seed point in the concave region, region growth is performed to generate the concave region block.

5. The image localization method for defects in welded joints of aluminum alloy shells according to claim 4, characterized in that, The conditions for stopping the growth of the region are: the growth region comes into contact with an edge pixel, or the difference between the gray value of the newly grown pixel in the growth region and the gray value of the seed point in the concave region is greater than a preset gray value threshold, or the gradient value of the newly grown pixel is greater than a preset gradient threshold.

6. The image localization method for defects in welded joints of aluminum alloy shells according to claim 1, characterized in that, The determination of welding defects based on the degree of edge anomaly and the degree of regional anomaly includes: Set edge anomaly thresholds and region anomaly thresholds; When the degree of edge anomaly is greater than the edge anomaly threshold, the edge is determined to be an abnormal edge; When the degree of abnormality in the region is greater than the abnormality threshold in the region, the concave region block is determined to be an abnormal region block; Based on the determination results of the abnormal edges and the abnormal region blocks, the defects are classified and marked.

7. The image localization method for defects in welded joints of aluminum alloy shells according to claim 6, characterized in that, The classification and labeling of defects includes: If the edge is determined to be an abnormal edge, and its corresponding concave region block is not determined to be an abnormal region block, then the edge is marked as a linear defect. If the edge is determined to be an abnormal edge, and its corresponding concave region block is determined to be an abnormal region block, then the edge and the concave region block are jointly marked as a block defect.

8. The image localization method for defects in welded joints of aluminum alloy shells according to claim 1, characterized in that, When the edge is a closed edge, its edge anomaly degree is considered to be zero, and the concave region block of the edge is directly generated. The presence of blocky defects is determined only based on the regional anomaly degree of the concave region block.

Citation Information

Patent Citations

  • New energy battery hardware processing quality visual detection method

    CN117689637A

  • Quality detection method and system for metal pipe fitting forming

    CN120431092A