A machine vision-based online fast weld defect identification method

CN122473179BActive Publication Date: 2026-10-30SHANXI GUANGDA HEAVY MASCH CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202610952509.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2026-06-29
Publication Date
2026-10-30
Estimated Expiration
2046-06-29

AI Technical Summary

Technical Problem

[0003]然而,在方格栅格交叉节点区域,短焊段长度有限且形态变化集中,焊趾转折、余高过渡、阴影遮挡及局部反光常叠加出现

Benefits of technology

本发明围绕大型机械设备交叉节点区域中短焊段易受拼接边界干扰的问题,先对分块采集形成的局部焊缝图像进行拼接边界分析,再围绕拼接边界候选区提取焊缝连续性关联特征,能够将由分块采集导致的表观不连续与真实焊缝缺陷区分开来。相较于仅依据局部图像形貌直接进行缺陷识别的方式,本发明把同缝关联判定前置到缺陷识别之前,使后续识别对象由原始拼接图像中的局部焊段,转变为具有明确连续性的跨边界焊缝片段,处理链条更契合交叉节点区域的实际焊缝分布特点。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122473179B_ABST
    Figure CN122473179B_ABST
Patent Text Reader

Abstract

The application discloses a kind of based on machine vision's weld defect on-line fast identification method, specifically related to industrial welding visual detection technical field, for solving the problem that splicing boundary leads to cross node short weld section misjudgment defect;By obtaining the local weld image formed by block collection, determine the splicing boundary and extract the splicing boundary candidate area, the weld end features on both sides of splicing boundary are mapped to actual length coordinate system, the texture information and continuity geometric information are extracted in the vicinity of weld toe, generate effective correlation features representing weld continuity and form the same seam correlation result, perform cross-border segment reconstruction on the splicing boundary candidate area determined as the same short weld section, generate cross-border weld segment image and cross-border weld segment area mask, and perform defect identification on cross-border weld segment image, remove the topographic abruptness located in the vicinity of splicing boundary and consistent with the same seam correlation result, output weld defect identification result.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of industrial welding visual inspection technology, and more specifically, to a method for rapid online identification of weld defects based on machine vision. Background Technology

[0002] Box-shaped frames, grid-reinforced frames, and truss-type load-bearing components in large mechanical equipment typically have numerous short fillet welds, short lap welds, and localized reinforcing welds distributed near intersections. Due to the large size of the components, the dense distribution of nodes, and the complex spatial orientation of the welds, existing technologies generally employ a method of acquiring images in sections before stitching them together and locating the welds for online guidance and inspection. For example, the existing material "Robot Welding Equipment and Weld Positioning Method for Large Grid Components Based on Machine Vision" (publication number CN113385869A) discloses a technical solution that uses a gantry crane to perform a checkerboard-like motion to acquire local images and stitch them together to form a complete image; the existing material "Intelligent Welding Guidance System for Large Steel Structures" (publication number CN111687515A) discloses a technical solution that uses a combination of visual coarse positioning and laser fine positioning to achieve weld positioning and welding guidance for large steel structures. These solutions can solve the problems of difficult overall imaging of large components and rapid weld positioning.

[0003] However, in the intersection area of ​​the square grid, the short weld segments are of limited length and exhibit concentrated morphological changes, with weld toe transitions, excess height transitions, shadow occlusion, and local reflections often overlapping. When a short weld segment happens to cross the splicing boundary of adjacent images, the preceding and following images only retain the local tail and local first segments of the weld, respectively. This easily leads to abrupt width changes, discontinuous edges, or morphological mismatches in the spliced ​​appearance of the same continuous weld. The root cause is that existing technologies focus on the spatial splicing of local images and the geometric positioning of welds, without constraining the continuity of weld morphology on both sides of the splicing boundary. This causes the system to easily misjudge continuous qualified welds as broken seams, collapsed edges, or discontinuous defects in the node area, resulting in concentrated false alarms in this area and affecting the stability and reliability of online recognition results.

[0004] To address the aforementioned problems, a technical solution is provided. Summary of the Invention

[0005] To overcome the aforementioned deficiencies of the prior art, embodiments of the present invention provide a machine vision-based online rapid weld defect identification method. This method acquires local weld images formed by segmented acquisition, determines splicing boundaries and extracts candidate splicing boundary regions, maps the weld end features on both sides of the splicing boundary to the actual length coordinate system, extracts texture information and continuous geometric information in the weld toe neighborhood, generates effective association features characterizing weld continuity and forms a co-weld association result, performs cross-boundary segment reconstruction on the candidate splicing boundary regions determined to be the same short weld segment, generates cross-boundary weld segment images and cross-boundary weld segment region masks, and performs defect identification on the cross-boundary weld segment images, eliminating morphological abrupt changes located in the splicing boundary neighborhood that are consistent with the co-weld association result, and outputs the weld defect identification result to solve the problems mentioned in the background art.

[0006] To achieve the above objectives, the present invention provides the following technical solution: S1. Acquire local weld images formed by block acquisition, determine the splicing boundary based on the splicing relationship of adjacent local weld images, and extract the weld areas that intersect with the splicing boundary and cross the areas on both sides of the splicing boundary to obtain the splicing boundary candidate area. S2, for each candidate splicing boundary region, extract the end features of the welds on both sides of the splicing boundary, generate the association features that characterize the continuity of the welds on both sides of the splicing boundary, and input the association features into the same seam association model to generate the same seam association results; S3. Based on the same seam association results, for the candidate splicing boundary areas that are determined to be the same short weld segment, cross-boundary segment reconstruction is performed according to the weld end features to generate cross-boundary weld segment images and cross-boundary weld segment region masks. S4 inputs the cross-boundary weld segment image and the cross-boundary weld segment region mask into the defect recognition model to generate the initial defect candidate region. It then removes the morphological abrupt changes located in the neighborhood of the splicing boundary that are consistent with the same seam association result from the initial defect candidate region and outputs the weld defect recognition result.

[0007] Furthermore, the local weld image is mapped to the actual length coordinate system based on the imaging calibration results, and an effective imaging area is formed after removing the edge distortion area and the edge brightness attenuation area. The stitching relationship is established based on the overlap range of adjacent effective imaging areas, and the stitching boundary is determined according to the equidistant position of the boundaries of the two effective imaging areas within the overlap range. At the same time, the first side area and the second side area of ​​the stitching boundary are divided.

[0008] Furthermore, weld segmentation is performed on the local weld images involved in the splicing relationship to form a joint weld region located within the overlapping range; connected component separation and centerline extraction are performed on the joint weld region, and connected weld regions that intersect with the splicing boundary and have continuous centerline segments in both the first and second side regions of the splicing boundary are retained as candidate splicing boundary regions.

[0009] Furthermore, the crossing position of the splicing boundary is determined on the center line of the candidate splicing boundary area. The portion of the center line of the candidate splicing boundary area located in the first side region of the splicing boundary is defined as the center line of the first side weld, and the portion of the center line of the candidate splicing boundary area located in the second side region of the splicing boundary is defined as the center line of the second side weld. A first-side end analysis line segment is established in the first side region of the splicing boundary along the center line of the first side weld, and a second-side end analysis line segment is established in the second side region of the splicing boundary along the center line of the second side weld. The local width is measured segment by segment to obtain the local average width of the first side and the local average width of the second side, respectively. The larger of the local average width of the first side and the local average width of the second side is used to determine the end analysis length. Normal cross-sections are established segment by segment on the end analysis line segment, and the left and right weld toe lines are extracted. The intersection of the end representative cross-section and the left and right weld toe lines forms the weld toe endpoint, and the weld toe extension direction is formed according to the tangent direction of the end of the left and right weld toe lines.

[0010] Furthermore, a cross-boundary extension is performed from the endpoint of the first side weld toe along the extension direction of the first side weld toe towards the second side region of the splicing boundary, and a cross-boundary extension is performed from the endpoint of the second side weld toe along the extension direction of the second side weld toe towards the first side region of the splicing boundary. The distance between the bidirectional extension result and the endpoint of the opposite side weld toe forms the weld toe cross-boundary landing point offset value. The first side adjacent texture map and the second side adjacent texture map are formed respectively using the aforementioned first side weld centerline and second side weld centerline as the development reference, and the boundary adjacent texture area ratio is formed by the ratio of the area of ​​the receiving texture region to the area of ​​the effective comparison region.

[0011] Furthermore, the same-seam association model is constructed using a radial basis kernel support vector machine. The offset value of the weld toe across the boundary is normalized by the end analysis length and together with the boundary bearing strip area ratio to form the association feature input to the same-seam association model. After training with same-seam and different-seam samples, the radial basis kernel support vector machine outputs classification decision values, which are then used to form the same-seam confidence coefficient through probability mapping. Finally, the same-seam association result is generated based on the same-seam judgment threshold.

[0012] Furthermore, when the joint correlation result is characterized as the same short weld segment, an arc length sequence is established along the center line of the candidate area of ​​the splicing boundary. The left weld toe continuation curve is formed by the intersection of the first left weld toe and the second left weld toe, and the right weld toe continuation curve is formed by the intersection of the first right weld toe and the second right weld toe. The start and end trends of the left and right weld toe continuation curves are constrained according to the end analysis length and the tangent direction of the corresponding weld toe line end. Then, a cross-boundary center guide line is formed based on the two continuation curves.

[0013] Furthermore, the aforementioned left and right weld toe continuation curves form a cross-boundary reconstruction region. An arc length sequence is established along the centerline of the candidate region for splicing boundaries. The position of the first side weld toe endpoint on the centerline of the candidate region for splicing boundaries is taken as the first side boundary position, and the position of the second side weld toe endpoint on the centerline of the candidate region for splicing boundaries is taken as the second side boundary position. The portion before the first side boundary position is defined as the first side original retention segment, and the portion after the second side boundary position is defined as the second side original retention segment. Using the first and second side original retention segments as boundary grayscale sources, Poisson fusion is used to generate a continuous grayscale distribution within the cross-boundary reconstruction region. The first side original retention segment, the cross-boundary reconstruction region, and the second side original retention segment are then written into a unified resampling grid in spatial order to form a cross-boundary weld fragment image and a cross-boundary weld fragment region mask.

[0014] Furthermore, the cross-boundary weld segment image and the cross-boundary weld segment region mask are input into the defect recognition model to generate a defect probability map, and the initial defect candidate region is extracted from the defect probability map using the defect judgment threshold; then, the splicing boundary neighborhood is established using the aforementioned first side local average width and second side local average width, and the lateral width change of the cross-boundary weld segment region mask is extracted along the cross-boundary center guide line to form a weld width function.

[0015] Furthermore, for each initial defect candidate region, the overlap ratio with the splicing boundary neighborhood is calculated, and a corresponding local reference width function is formed based on the weld width function to calculate the morphological change amplitude corresponding to the initial defect candidate region. When the same weld association result is characterized as the same short weld segment, the overlap ratio is not lower than the splicing boundary overlap threshold, and the morphological change amplitude is not higher than the morphological change threshold, the corresponding initial defect candidate region is removed. For the retained region, the regional average defect probability, the confirmed defect centroid position, and the confirmed defect arc length range are calculated to form the weld defect identification result.

[0016] The beneficial effects of this invention are as follows: This invention addresses the problem of short weld segments in the intersection area of ​​large mechanical equipment being easily interfered with by splicing boundaries. It first analyzes the splicing boundaries of local weld images obtained through segmented acquisition, and then extracts weld continuity correlation features around candidate areas of the splicing boundaries. This allows for the differentiation between apparent discontinuities caused by segmented acquisition and actual weld defects. Compared to methods that directly identify defects based solely on local image morphology, this invention prioritizes the determination of weld seam correlation before defect identification. This transforms the subsequent identification target from local weld segments in the original spliced ​​image into cross-boundary weld segments with clear continuity, making the processing chain more consistent with the actual weld distribution characteristics of the intersection area.

[0017] Furthermore, this invention performs cross-boundary segment reconstruction only on candidate splicing boundaries identified as the same short weld segment. During the defect identification stage, it removes morphological abrupt changes located in the vicinity of the splicing boundary that are consistent with the results of the same weld seam association. This reduces the interference of residual traces at the splicing boundary, local grayscale breaks, and boundary misalignments on the identification results, making the output weld defect identification results more focused on the actual defect area. Therefore, this invention improves the targeting and stability of weld defect identification in cross-node areas without changing the online acquisition method, while making the expression of the defect area, defect location, and range along the weld seam direction clearer, facilitating subsequent review and processing. Attached Figure Description

[0018] Figure 1 This is a flowchart illustrating a machine vision-based method for rapid online identification of weld defects according to the present invention. Figure 2 This is a schematic diagram of the image splicing boundary and candidate area extraction of adjacent local weld seams in this invention; Figure 3 This is a schematic diagram of weld end feature extraction and cross-boundary geometric extension in this invention; Figure 4 This is a schematic diagram illustrating the result of the joint formation of seam correlation by geometric and texture features in this invention; Figure 5 This is a schematic diagram of the reconstruction of a cross-boundary weld segment according to the present invention; Figure 6 This is a schematic diagram illustrating the defect identification and splicing boundary pseudo-anomaly removal of the present invention. Detailed Implementation

[0019] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0020] Please see Figures 1-6 This invention provides a method for rapid online identification of weld defects based on machine vision, comprising: S1. Acquire local weld images formed by block acquisition, determine the splicing boundary based on the splicing relationship of adjacent local weld images, and extract the weld areas that intersect with the splicing boundary and cross the areas on both sides of the splicing boundary to obtain the splicing boundary candidate area. S2, for each candidate splicing boundary region, extract the end features of the welds on both sides of the splicing boundary, generate the association features that characterize the continuity of the welds on both sides of the splicing boundary, and input the association features into the same seam association model to generate the same seam association results; S3. Based on the same seam association results, for the candidate splicing boundary areas that are determined to be the same short weld segment, cross-boundary segment reconstruction is performed according to the weld end features to generate cross-boundary weld segment images and cross-boundary weld segment region masks. S4 inputs the cross-boundary weld segment image and the cross-boundary weld segment region mask into the defect recognition model to generate the initial defect candidate region. It then removes the morphological abrupt changes located in the neighborhood of the splicing boundary that are consistent with the same seam association result from the initial defect candidate region and outputs the weld defect recognition result.

[0021] The welds at the intersections of large mechanical equipment are not single long straight welds, but are composed of short fillet welds, short lap welds, and local reinforcement welds. Although the local weld images formed by segmented acquisition can cover large-sized components, the same short weld segment is often placed in adjacent local weld images. Node shadows, surface reflections, and local spatter will further interfere with the spatial correspondence between adjacent images. In this case, if the local weld images are not first unified to the same actual position reference and the weld objects that actually cross the splicing boundary are separated from the complex background, the subsequent geometric and texture discrimination based on the association of the same weld will lack a reliable object basis.

[0022] S101. Coordinate unification and effective imaging area determination of local weld seam images.

[0023] After the segmented acquisition is completed, a sequence of local weld seam images is first established according to the acquisition order and location. Then, lens distortion correction and imaging calibration conversion are performed on each local weld seam image to ensure that the pixel position in each local weld seam image corresponds to the actual length position in the reference plane of the workpiece surface, thus obtaining the imaging area in the actual length coordinate system. Based on the imaging area, an edge band is further trimmed from the edge of the imaging area inward. The trimmed edge band corresponds to the part where lens edge distortion, brightness attenuation, and edge blur are more concentrated. The trimmed area is defined as the effective imaging area. The reason for using the actual length coordinate system instead of directly using the original pixel coordinates is that the intersection node area often experiences viewpoint deflection and local height changes. If coordinate unification is not performed first, the splicing boundary inferred from adjacent local weld seam images will be affected by pixel scale differences and perspective changes, and the spatial position of the candidate splicing boundary area will also be deviated. The cutting width of the edge band is obtained through pre-calibration. Specifically, an image is first formed using a calibration plate of known size in the same mounting posture as the workpiece. The length restoration error and boundary clarity of the calibration plate edge at the image center and image edge are compared. Then, the first position where the length restoration error of the calibration plate edge continuously increases and the edge grayscale transition band continuously widens along the direction from the image center to the edge is taken as the starting position of the edge band, thereby determining the cutting range of the effective imaging area.

[0024] After the step-by-step processing, each local weld seam image corresponds to a unique effective imaging area, and subsequent splicing relationships, splicing boundaries, and candidate splicing boundary areas are all determined within the effective imaging area.

[0025] S102. Establishment of splicing relationship between adjacent local weld images and construction of splicing boundary.

[0026] After obtaining the effective imaging area corresponding to each local weld image, the system first identifies pairs of local weld images that may overlap on the workpiece surface based on the movement trajectory and stopping position of the acquisition device. Then, it compares the overlap range of the effective imaging areas of each pair of potentially adjacent local weld images in the actual length coordinate system. Only when the overlap range reaches the overlap area reference value is the splicing relationship between the two local weld images considered to exist. The overlap area reference value is determined by combining the weld width resolution requirement and the acquisition spacing. Specifically, the basic coverage requirement is that the weld width direction should at least accommodate the complete weld cross section, weld toe transition zone, and local forming undulation zone. The boundary identification requirement is that the weld length direction should at least provide a continuous weld centerline. When both requirements are met simultaneously, the corresponding minimum overlap range is taken as the overlap area reference value. For adjacent local weld seam image pairs that have already established a stitching relationship, the shortest actual distance from each point to the effective imaging region boundary on both sides is compared point by point within the overlapping area. Points equidistant from the two boundaries are connected to form a dividing line, which is defined as the stitching boundary. Based on the stitching boundary, the side where the shortest distance to the effective imaging region boundary of the previous local weld seam image is less than the shortest distance to the effective imaging region boundary of the subsequent local weld seam image is defined as the first side region of the stitching boundary, and the side where the shortest distance to the effective imaging region boundary of the subsequent local weld seam image is less than the shortest distance to the effective imaging region boundary of the previous local weld seam image is defined as the second side region of the stitching boundary. The physical meaning of the aforementioned processing logic is that the stitching boundary is not arbitrarily chosen in the middle of the overlapping area, but rather at a position where the imaging reliability of the two local weld seam images is relatively balanced. The resulting stitching boundary is more suitable as a reference line for subsequent cross-boundary extension and the assignment of the weld toe ends on both sides.

[0027] In one embodiment, there are two short fillet welds close to each other near the intersection of the box-shaped frame. After the gantry mechanism completes the acquisition of the previous frame, it moves laterally to the next frame to acquire the data again, forming two local weld images. The first local weld image includes the tail section of the short fillet weld, and the second local weld image includes the first section of the same short fillet weld and the local area of ​​the adjacent reinforcing weld. At this time, the two are first determined to have a spatial adjacency relationship based on the two stopping positions. Then, the overlapping range of the two in the actual length coordinate system is compared. After confirming the existence of a splicing relationship, a splicing boundary is constructed in the overlapping range. At the same time, the first side area and the second side area of ​​the splicing boundary are obtained. In this way, the scene where the same short weld segment is cut by two acquisitions is clearly marked from the acquisition sequence, providing an accurate object range for subsequent seam association.

[0028] S103. Weld seam area extraction and combined weld seam area formation.

[0029] After determining the splicing relationship and splicing boundary, weld seam segmentation processing is performed on the local weld seam images involved in the splicing relationship to obtain the weld seam probability distribution in each local weld seam image. Regions with weld seam probabilities higher than the weld seam determination threshold are then extracted as weld seam regions. Subsequently, the weld seam regions of two adjacent local weld seam images are uniformly mapped to the same overlapping range in the actual length coordinate system, and a joint weld seam region is formed within the overlapping range according to spatial overlap. Forming a joint weld seam region involves spatially merging the portions of two local weld seam images identified as weld seams at the same actual location, thereby obtaining a continuous weld seam connected region spanning the splicing boundary. The weld seam determination threshold is determined through validation samples. Specifically, different segmentation thresholds are applied to the weld seam probability maps of the validation samples, and the cross-union ratio (CUI) between the weld seam segmentation results corresponding to each segmentation threshold and the manually labeled weld seam regions is calculated. The segmentation threshold corresponding to the maximum CUI is determined as the weld seam determination threshold.

[0030] S104. Extraction of candidate splicing boundary area and center line of candidate splicing boundary area.

[0031] After the combined weld region is formed, the connected domains of the combined weld region are first separated to obtain multiple non-connected weld connected regions. Then, skeleton extraction is performed on each weld connected region to obtain the corresponding centerline. For each centerline, the transverse width of the weld is measured segment by segment along the centerline, and the representative width of the corresponding weld connected region is obtained based on the width distribution of the entire centerline. Then, it is checked whether the centerline intersects with the splicing boundary, and whether the centerline has continuous extension segments in both the first and second side regions of the splicing boundary. Only weld connected regions that simultaneously meet the following conditions are identified as candidate splicing boundary regions: first, the centerline passes through the splicing boundary; second, the continuous length of the centerline in the first side region of the splicing boundary is not shorter than the representative width; and third, the continuous length of the centerline in the second side region of the splicing boundary is not shorter than the representative width. The reason for using representative width as the length determination criterion is that although spatter, smudges, and shadow edges may come into contact with the splice boundary, their shapes are usually short, scattered, or locally clumped, lacking the ability to extend continuously on both sides commensurate with the weld width. Therefore, after screening according to the aforementioned conditions, the retained objects are more consistent with the actual short weld segments cut by the splice boundary. Subsequently, the weld connection area that meets the conditions is defined as the splice boundary candidate area, and the centerline corresponding to the weld connection area is defined as the centerline of the splice boundary candidate area. A one-to-one correspondence is established between the splice boundary candidate area and the centerline of the splice boundary candidate area, serving as the direct input object for extracting the weld toe endpoint and weld toe extension direction in step S2.

[0032] In one embodiment, short lap welds and dot-like spatter residues exist simultaneously at the grid reinforcement frame node. The short lap welds are divided into two local weld images. After the joint weld area is formed, the spatter residues are spatially close to the splicing boundary, but the center line of the corresponding connected area only has a very short extension on one side of the splicing boundary, and no continuous skeleton is formed on the other side, so it will not enter the splicing boundary candidate area. On the contrary, although the short lap welds have brightness changes and local narrowing at the splicing boundary, the center line still continuously passes through the splicing boundary, and there is a continuous length equivalent to the weld width in both the first side area and the second side area of ​​the splicing boundary. Therefore, it is retained as a splicing boundary candidate area, and the subsequent step S2 can extract the weld toe endpoint and weld toe extension direction around this object.

[0033] After step S1, the splicing relationship between local weld images has been clearly constrained, the splicing boundary and the region division on both sides of the splicing boundary have been established, and the weld objects crossing the splicing boundary have been extracted as splicing boundary candidate areas. At the same time, the center line of the splicing boundary candidate areas is formed. This separates the short weld segments that need to be judged in the intersection node area from the ordinary weld background, so that the subsequent analysis of the weld toe end, weld toe extension direction and texture inheritance relationship has a unified, stable and traceable input object.

[0034] Although the candidate area for splicing boundaries has identified the short weld segments that may be cut by the splicing boundaries, the aforementioned objects may still partially overlap with adjacent welds, reinforcing welds, or the edge morphology of nodes near the intersection. The mere appearance that the centerline crosses the splicing boundary is insufficient to indicate that the two sides of the splicing boundary necessarily belong to the same short weld segment. Especially in areas where weld toe turning, local narrowing, and texture disturbance occur simultaneously, it is necessary to further decompose the geometric continuity relationship of the weld end and the texture continuity relationship of the weld toe neighborhood in order to distinguish between true co-weld and boundary pseudo-continuity phenomena.

[0035] S201. Establishment of the end analysis range and determination of the end representative section.

[0036] For each candidate splicing boundary output in step S1, the splicing boundary crossing position is first determined on the centerline of the corresponding candidate splicing boundary. Specifically, if the splicing boundary intersects the centerline of the candidate splicing boundary at a single location, the intersection location is defined as the splicing boundary crossing position. If the splicing boundary forms a continuous contact segment with the centerline of the candidate splicing boundary, the middle position of the continuous contact segment along the direction of the centerline of the candidate splicing boundary is defined as the splicing boundary crossing position. Then, the portion of the centerline of the candidate splicing boundary located in the first side region of the splicing boundary is defined as the first side weld centerline, and the portion of the centerline of the candidate splicing boundary located in the second side region of the splicing boundary is defined as the second side weld centerline. The local width is measured segment by segment along the first side weld centerline and the second side weld centerline, and the average local width of the first side and the average local width of the second side are calculated respectively. The end analysis length is taken as the greater of the average local width of the first side and the average local width of the second side. The reason for this is that the width of a single cross-section near the intersection node is easily affected by local weld beads, weld toe collapse, and boundary jaggedness. The local average width obtained along the centerline range is more representative of the stable geometric dimensions of the short weld segment end. After obtaining the end analysis length, a continuous line segment not exceeding the end analysis length is cut along the centerline of the first side weld to form the first side end analysis line segment. The second side end analysis line segment is formed along the centerline of the second side weld according to the same rule. Then, the positions with gentle local width changes are found in the first side end analysis line segment and the second side end analysis line segment respectively as the first side end representative cross-section and the second side end representative cross-section. The width stability threshold is determined by the validation sample. Specifically, the weld toe endpoints are extracted from the end representative cross-sections extracted under different width change thresholds, and the positional deviation between the extraction result and the manually marked weld toe endpoints is calculated. The width change threshold corresponding to the minimum positional deviation is determined as the width stability threshold.

[0037] S202. Extraction of weld toe endpoint and weld toe extension direction.

[0038] After the first and second side end analysis segments are determined, sampling is performed point by point along the two end analysis segments according to a fixed sampling interval in the actual length coordinate system. A normal cross-section is established at each sampling position. The normal cross-section and the boundary of the candidate area of ​​the splicing boundary usually form two intersection positions, left and right. To ensure that the definitions of the left and right sides remain unique throughout all steps, it is stipulated that the left side is the direction of the weld center line turning counterclockwise and the right side is the direction of the weld center line turning clockwise. Thus, the left intersection positions at the aforementioned sampling positions are connected sequentially to form the first side left weld toe line and the second side left weld toe line, and the right intersection positions at the aforementioned sampling positions are connected sequentially to form the first side right weld toe line and the second side right weld toe line. Subsequently, a cubic B-spline curve is used to fit the aforementioned four weld toe lines to eliminate boundary jitter caused by local reflection, spatter adhesion, and pixel discrepancies. The intersection position of the first side end representative cross-section with the first side left weld toe line and the first side right weld toe line constitutes the first side left and right weld toe intersection point. The first side weld toe endpoint is defined. The first weld toe endpoint is the geometric midpoint of the intersection of the two weld toes mentioned above. The second weld toe endpoint is obtained from the geometric midpoint of the intersection of the left and right weld toes on the second side in the same way. The geometric midpoint is used as the weld toe endpoint because the intersection of the weld toes on one side only reflects the boundary of one side of the weld and is significantly affected by local undercut and unilateral reflection, while the geometric midpoint can represent the overall position of the end section. After obtaining the weld toe endpoint, the tangent direction is obtained from the end positions of the first left weld toe line, the first right weld toe line, the second left weld toe line, and the second right weld toe line. The left and right tangent directions on the same side are then normalized and summed to form the original extension direction. Then, the orientation is corrected according to the relationship between the original extension direction and the weld toe endpoint pointing to the splicing boundary crossing position, so that the first weld toe extension direction faces the second side region of the splicing boundary, and the second weld toe extension direction faces the first side region of the splicing boundary. After the aforementioned orientation correction is completed, the first and second weld toe extension directions become the unified direction marks for subsequent cross-boundary extensions.

[0039] In one embodiment, a short fillet weld exists at the cross intersection of the grid reinforcement frame. The first local weld image records the end closer to the node, and the second local weld image records the end farther from the node. The splicing boundary passes through the middle of the short fillet weld. After the first and second side end analysis segments are established, the normal cross-sections pass through the weld boundary in sequence. Local bright spots may cause some intersection positions to shift outward, but the cubic B-spline curve can still restore the left and right weld toe lines to a continuous boundary. Then, the first and second side weld toe endpoints are obtained from the end representative cross-sections. The first and second side weld toe extension directions are obtained from the tangent direction of the weld toe line end. At this time, whether the two short fillet weld segments have a natural continuity relationship has been clearly expressed by the end position and boundary trend.

[0040] S203. Formation of the offset value of the weld toe across the boundary.

[0041] After obtaining the endpoints of the first and second weld toes, as well as the extension directions of the first and second weld toes, a continuous extension is made from the endpoint of the first weld toe along the extension direction towards the second side of the splicing boundary until the position with the shortest distance to the endpoint of the second weld toe is found. This position is defined as the first side cross-boundary extension landing point. The second side cross-boundary extension landing point is obtained from the endpoint of the second weld toe along the extension direction towards the first side of the splicing boundary in the same way. The first offset is defined as the shortest actual distance between the endpoint of the second weld toe and the first side cross-boundary extension landing point, and the second offset is defined as the shortest actual distance between the endpoint of the first weld toe and the second side cross-boundary extension landing point. The weld toe cross-boundary landing point offset value is formed by the first offset and the second offset. Specifically, the squares of the first offset and the second offset are calculated separately, and then the sum of the squares of the two terms is divided by the sum of the two offsets mentioned above, thus obtaining the weld toe cross-boundary landing point offset value. The reason for using this method instead of the ordinary average of the two offsets is that near the intersection, there is often a situation where one side is fully imaged while the other side is partially obscured. If the offset on one side has significantly deviated from the natural joint position, the ordinary average is easily dragged down by the smaller offset on the other side. However, by forming the result by summing the squares and then dividing by the sum of the offsets, a stronger response is retained for the side with the more significant deviation, making it more suitable for identifying the same seam and different seams separated by the splicing boundary. The aforementioned offset value of the weld toe across the boundary is kept in the dimension of length, directly corresponding to the actual degree of misalignment of the two ends on the workpiece surface.

[0042] S204. Formation of the area ratio of the boundary bearing band.

[0043] Geometric continuity can characterize whether the ends of the weld have a basis for connection in position and direction. However, in the intersection area, when adjacent welds are parallel, the grinding marks are similar, or the surface reflection direction is consistent, the geometric continuity may still result in false connection. Therefore, it is also necessary to check the texture continuity of the weld toe neighborhood on both sides of the splicing boundary. Using the aforementioned centerlines of the first and second side welds as the development reference, a textured band near the left and right weld toe lines on the first side is extracted, and a textured band near the left and right weld toe lines on the second side is extracted. The normal half-width of the textured band near the weld toe is half the average of the local average width on the first side and the local average width on the second side. This covers both the weld metal surface near the weld toe and the base metal surface outside the weld toe, facilitating the inclusion of weld ripples, wear marks, and heat-affected zones in the comparison. Subsequently, the textured bands near the weld toe on the first and second sides are developed along the weld centerline direction to obtain the adjacent textured band diagrams on the first and second sides. During development, the arc length position corresponding to the splicing boundary crossing position is uniformly set to zero. The weld centerline position is uniformly set to the normal zero position, so that the first and second adjacent texture maps are under the same arc length reference and the same normal reference. The local binary pattern texture code and Sobel direction angle are calculated on the two adjacent texture maps respectively, and compared position by position in the common effective comparison area of ​​the two adjacent texture maps. If the difference between the local binary pattern texture codes on both sides of a certain position does not exceed the texture code difference threshold, and the minimum included angle of the Sobel direction angle on both sides does not exceed the direction angle difference threshold, then the position is identified as the receiving texture position, and the receiving texture area is formed by all receiving texture positions. The boundary receiving texture area ratio is obtained by dividing the area of ​​the receiving texture area by the area of ​​the effective comparison area. The above result is a dimensionless ratio, which is used to represent the degree of continuous receiving of the texture of the weld toe neighborhood on both sides of the splicing boundary.

[0044] The texture coding difference threshold and orientation angle difference threshold are determined through validation samples. Specifically, different combinations of texture coding difference thresholds and orientation angle difference thresholds are used to determine the inherited texture, and the classification accuracy of samples with the same seam and samples with different seams under each combination is calculated. The texture coding difference threshold and orientation angle difference threshold corresponding to the maximum classification accuracy are determined as the texture coding difference threshold and orientation angle difference threshold.

[0045] In one embodiment, a short lap weld near the stiffening plate node of the box-shaped frame is cut by the splicing boundary. In the first adjacent texture pattern, there are continuous grinding marks and weld ripples on the outer side of the weld toe. In the second adjacent texture pattern, corresponding positions also show grinding marks and weld ripples with continuous direction. Thus, the bearing texture positions form a continuous banded distribution on both sides of the splicing boundary, and the boundary bearing texture area ratio increases accordingly. If the second side of the splicing boundary actually corresponds to an adjacent reinforcing weld, although the local brightness is similar, the direction of the weld ripples and the direction of the grinding marks on the outer side of the weld toe cannot be continuously connected at the splicing boundary. The bearing texture positions will only appear sporadically, and the boundary bearing texture area ratio decreases accordingly.

[0046] S205. Generation of the same seam confidence coefficient and the same seam correlation result.

[0047] The offset value of the weld toe across the boundary reflects the degree of geometric adhesion, while the area ratio of the boundary adhesion band reflects the degree of textural adhesion. Using the aforementioned end analysis length as a length normalization scale, the offset value of the weld toe across the boundary is divided by the end analysis length to form a normalized geometric feature. This normalized geometric feature and the area ratio of the boundary adhesion band are then combined to form a two-dimensional feature vector. Specifically, the normalized geometric feature is used as the first component, and the area ratio of the boundary adhesion band is used as the second component, ensuring that each candidate region of the splicing boundary uniquely corresponds to a two-dimensional feature vector. To eliminate scale differences in feature distribution among different batches of image samples, interval normalization is performed on all two-dimensional feature vectors. Specifically, the maximum and minimum values ​​of the first and second components in the training samples are statistically analyzed, and each component is linearly mapped to the interval between 0 and 1. This ensures that the aforementioned two features enter the same seam correlation model within the same numerical range.

[0048] The same-seam correlation model is constructed using a radial basis function kernel support vector machine. During construction, manually labeled same-seam and different-seam samples are first collected. Same-seam samples are taken from scenarios where the same short weld segment is cut by a splicing boundary, while different-seam samples are taken from scenarios where two adjacent welds near the intersection node appear similar at the splicing boundary but do not belong to the same short weld segment. The corresponding two-dimensional feature vectors of each sample are then used as input, and the same-seam and different-seam category labels are used as outputs to establish a training sample set. To prevent a bias in the classification boundary caused by an excessive number of samples in one category, class balancing is performed on the training sample set. Specifically, if the number of same-seam samples and different-seam samples is inconsistent, the class with fewer samples is used as the benchmark, and random downsampling is performed on the class with more samples to ensure that the number of samples in both classes is consistent.

[0049] The training process of the radial basis function (RBF) support vector machine (SVM) employs a combination of grid search and cross-validation. Specifically, candidate ranges for the penalty parameter and the radial basis function kernel width parameter are first defined. The training sample set is then divided into five groups, with four groups selected as the training subset and one as the validation subset in turn. This process iterates through all parameter combinations, calculating the average classification accuracy, same-seam sample recognition rate, and different-seam sample recognition rate for each parameter combination across five validation iterations. The average classification accuracy is then used as the first selection criterion, and the minimum difference between the same-seam and different-seam sample recognition rates is used as the second selection criterion to determine the target parameter combination. If multiple parameter combinations simultaneously satisfy the aforementioned conditions, the combination with a smaller radial basis function kernel width parameter and a moderate penalty parameter is prioritized to ensure that the classification boundary covers the nonlinear sample distribution near the crossover nodes, while simultaneously suppressing overfitting.

[0050] In one embodiment, the candidate range for the penalty parameter can be set as a discrete sequence increasing in powers of 2, and the candidate range for the radial basis kernel width parameter can also be set as a discrete sequence increasing in powers of 2. First, a coarse-grained search is performed, and then a fine-grained search is conducted around the target parameter combination obtained from the coarse-grained search. During the fine-grained search, the candidate step size is reduced to half of the original step size to further improve the parameter localization accuracy. This approach enables the radial basis kernel support vector machine to form a more stable classification boundary in regions where samples with the same slit and samples with different slits are densely intersected.

[0051] After the radial basis function (RBF) kernel support vector machine is trained, it outputs the classification decision value corresponding to each candidate splicing boundary region. To convert the classification decision values ​​into seam-to-seam confidence coefficients that are easy to threshold, Pratt probability mapping is used to probabilize the classification decision values. The parameters of the Pratt probability mapping are obtained by maximum likelihood fitting on the training sample set. During fitting, manually labeled categories are used as the target, and classification decision values ​​are used as input to obtain probability mapping parameters used to map the classification decision values ​​to the interval between 0 and 1. After mapping, each candidate splicing boundary region obtains one seam-to-seam confidence coefficient. The closer the seam-to-seam confidence coefficient is to 1, the higher the probability that the two sides of the candidate splicing boundary region belong to the same short weld segment.

[0052] The same-seam determination threshold is determined through validation samples. Specifically, the determination logic is as follows: The same-seam confidence coefficient boundary is gradually changed within the validation samples. The number of rejected same-seam samples and the number of accepted non-same-seam samples are counted separately. The boundary position corresponding to the minimum sum of these two types of errors is determined as the same-seam determination threshold. When the same-seam confidence coefficient is not lower than the same-seam determination threshold, a same-seam association result with a value of 1 is generated, indicating that both sides of the candidate splicing boundary belong to the same short weld segment. When the same-seam confidence coefficient is lower than the same-seam determination threshold, a same-seam association result with a value of 0 is generated, indicating that both sides of the candidate splicing boundary do not belong to the same short weld segment. After the aforementioned steps are completed, step S3 does not need to trace geometric and texture details again; it directly determines whether to perform cross-boundary segment reconstruction on the corresponding candidate splicing boundary based on the same-seam association result.

[0053] After step S2, each candidate splicing boundary region has formed the first side weld toe endpoint, the second side weld toe endpoint, the first side weld toe extension direction, the second side weld toe extension direction, the weld toe cross-boundary landing point offset value, the boundary bearing texture area ratio, the same seam confidence coefficient, and the same seam association result. The geometric bearing relationship and the texture bearing relationship are uniformly compressed into a definite same seam association result in the aforementioned stage, so that the real short weld segments cut by the splicing boundary near the intersection node are clearly separated from the different seam objects that only seem to be continuous in the local field of view.

[0054] The results of the same seam association have transformed the question of whether the two sides of the splicing boundary belong to the same short weld segment into a clear judgment. However, cross-boundary defect identification cannot be directly based on the aforementioned judgment. This is because the artificial cutting traces left by the splicing boundary on the image will still remain in the middle of the weld in the form of grayscale breaks, boundary misalignments, and local slits. If the broken zone is not repaired into a continuous weld object, the defect identification will still be facing the weld surface that has been artificially cut. The splicing boundary itself will continue to interfere with the generation of defect candidates.

[0055] S301. Determining the scope of reconstruction and fixing the input objects for reconstruction.

[0056] For each candidate region of the splicing boundary output in step S2, the same seam association result is read first. Only when the same seam association result is one, the candidate region of the splicing boundary enters the cross-boundary segment reconstruction process. After entering the reconstruction process, an arc length order is established along the center line of the candidate region of the splicing boundary. The corresponding position of the first side weld toe endpoint on the center line of the candidate region of the splicing boundary is taken as the first side boundary position, and the corresponding position of the second side weld toe endpoint on the center line of the candidate region of the splicing boundary is taken as the second side boundary position. The part before the first side boundary position is defined as the first side original preserved segment, the part after the second side boundary position is defined as the second side original preserved segment, and the part between the first side boundary position and the second side boundary position is defined as the cross-boundary continuation segment. The purpose of the division method is to stably preserve the real weld part that has been imaged completely and does not need to be modified, and to separate the weld part that is really affected by the splicing boundary cutting. All subsequent reconstruction actions are only carried out in the cross-boundary continuation segment without modifying the real texture and real boundary in the first side original preserved segment and the second side original preserved segment. Subsequently, the first side weld toe endpoint, the second side weld toe endpoint, the first side weld toe extension direction, the second side weld toe extension direction, the first side left and right weld toe intersection point, the second side left and right weld toe intersection point, the first side left and right weld toe lines, the second side left and right weld toe lines, the first side local average width, the second side local average width, and the end analysis length are collectively fixed as the reconstruction input objects for the cross-boundary continuation segment, serving as the sole source of constraints for the cross-boundary segment reconstruction.

[0057] S302. Formation of the left and right weld toe joint curves.

[0058] After the cross-boundary connection section has been determined, the intersection of the first left weld toe and the second left weld toe are used as the starting and ending points of the left boundary. Then, the tangent direction at the end of the first left weld toe line and the tangent direction at the beginning of the second left weld toe line are used as the starting and ending trends of the left boundary. The left weld toe connection curve is constructed along the two ends and the two ends. The right boundary is constructed in the same way, using the intersection of the first right weld toe and the second right weld toe line as the starting and ending points, and the tangent direction at the end of the first right weld toe line and the tangent direction at the beginning of the second right weld toe line as the starting and ending trends. The construction process employs cubic Hermitian interpolation. Specifically, the intersection points of the left and right weld toes on the first and second sides are used as the endpoints of two continuation curves. The end analysis length is used as a unified scale for the tangent lengths at both ends. The continuation curves are then aligned with the boundary trend of the corresponding side weld toe line at the beginning and with the boundary trend of the other side weld toe line at the end. This ensures that the left and right weld toe boundaries at the splicing boundary are both positionally and trend-connected. After the left and right weld toe continuation curves are formed, the lateral spacing between them is checked segment by segment along the continuation direction. If the left and right weld toe continuation curves are found to be excessively close at a certain position, the left and right weld toe continuation curves are simultaneously moved outwards to both sides along the normal direction, centered on the left and right midline at that position, until the lower width limit is reached at that position. The lower limit of the width is determined by a sample statistical method. Specifically, the ratio between the minimum local width of the naturally annealed weld near the splicing boundary and the average local width on both sides is statistically analyzed in the confirmed samples of the same seam. Then, the left boundary of the high-frequency concentration area of ​​the ratio is selected as the lower limit of the ratio. Finally, the lower limit of the ratio is multiplied by the average local width on the first side and the average local width on the second side to obtain the lower limit of the width.

[0059] In one embodiment, a short lap weld exists near the intersection of truss load-bearing members. The first partial weld image records the first half of the weld, and the second partial weld image records the second half. The splicing boundary passes through the middle left of the weld. If the intersection of the left and right weld toes is simply connected by a straight line, the boundary after the splicing will suddenly turn at the splicing boundary, resulting in a hard zigzag line. Subsequent defect identification may easily mistake the hard zigzag line for a local collapse. After processing according to this step, the left weld toe continuation curve naturally extends along the first side left weld toe line and then turns into the second side left weld toe line. The right weld toe continuation curve is also continued in the same way. If the middle spacing is too narrow, the left and right weld toe continuation curves are moved outward synchronously based on the spacing inspection results, ultimately forming a continuous boundary that smoothly transitions from the first half of the weld to the second half. The sudden turn caused by the splicing boundary then disappears.

[0060] S303. Formation of cross-boundary center guide line and cross-boundary reconstruction area.

[0061] After the left and right weld toe continuation curves are formed and their widths corrected, a cross-boundary center guide line is formed using the midpoints of the corresponding positions on the left and right weld toe continuation curves. This cross-boundary center guide line represents the extension trend of the main weld body in the cross-boundary continuation section. Subsequently, using the left weld toe continuation curve as the left boundary, the right weld toe continuation curve as the right boundary, and the cross-boundary center guide line as the internal guide, a cross-boundary reconstruction region is constructed. The construction does not involve drawing a filling band near the splicing boundary, but rather enclosing the entire area between the left and right weld toe continuation curves segment by segment along the extension sequence of the cross-boundary center guide line, thus forming a complete weld surface region. Geometrically, the beginning of the cross-boundary reconstruction region connects to the end of the first side original retained section, and the end of the cross-boundary reconstruction region connects to the beginning of the second side original retained section. The left and right boundaries are constrained by the left and right weld toe continuation curves, respectively, and the internal trend is constrained by the cross-boundary center guide line. Therefore, a continuous weld outline is formed between the cross-boundary reconstruction region and the first and second side original retained sections. To prevent boundary misalignment between the cross-boundary reconstruction area and the original retained sections on both sides, a transition zone needs to be extended laterally along the weld, centered on the junction, from the beginning and end of the cross-boundary reconstruction area to both sides. This transition zone is then pressed together with the adjacent boundaries of the first and second original retained sections to form a unified weld area. Pressing is defined as aligning the boundary of the transition zone with the original weld boundaries on both sides in position and tangentially with them in direction, thereby eliminating the step-like appearance when the cross-boundary reconstruction area connects to the original retained section.

[0062] S304. Generation of cross-boundary weld segment images and cross-boundary weld segment region masks.

[0063] After the unified weld region is formed, a resampling grid is established within the unified weld region. The resampling grid is arranged with longitudinal sampling lines along the cross-boundary center guide line and transverse sampling lines along the weld transverse direction. The longitudinal sampling interval is taken from the original sampling interval of the local weld image in the actual length coordinate system, and the transverse sampling interval is taken from the narrowest position of the cross-boundary continuation segment, so that the resampled cross-boundary weld segment maintains a spatial resolution similar to the original local weld image. Resampling positions falling within the original preserved segment on the first side are directly retrieved from the corresponding local weld image on the first side; resampling positions falling within the original preserved segment on the second side are directly retrieved from the corresponding local weld image on the second side; resampling positions falling within the cross-boundary reconstruction region are generated using Poisson fusion. The specific processing logic of Poisson fusion is as follows: First, the cross-boundary reconstruction region is divided into two halves along the cross-boundary center guide line: one half closer to the first original preserved segment and the other half closer to the second original preserved segment. In the half closer to the first original preserved segment, the gray-level change direction of the adjacent position of the first original preserved segment is taken as the source gradient. In the half closer to the second original preserved segment, the gray-level change direction of the adjacent position of the second original preserved segment is taken as the source gradient. Then, using the known gray-level on the boundary of the cross-boundary reconstruction region as the boundary condition, the gray-level distribution that satisfies the gradient divergence constraint is solved inside the cross-boundary reconstruction region, so that the gray-level change after reconstruction connects the first original preserved segment at one end and the second original preserved segment at the other end. After Poisson fusion, the original grayscale values ​​of the first-side original preserved section, the reconstructed grayscale values ​​of the cross-boundary reconstructed region, and the original grayscale values ​​of the second-side original preserved section are written into the resampling mesh according to the spatial order of the unified weld region, forming a cross-boundary weld fragment image. Simultaneously, the positions inside the unified weld region are marked as weld positions, and the positions outside the unified weld region are marked as non-weld positions, forming a cross-boundary weld fragment region mask. The cross-boundary weld fragment image is used in step S4 to extract morphological abrupt changes and surface textures, while the cross-boundary weld fragment region mask is used in step S4 to limit the defect recognition range, ensuring that defect recognition only occurs within the weld entity region and does not enter the node shadows and the base material background.

[0064] In one embodiment, the weld seam of the inner node of the box-shaped frame is cut from the middle by the splicing boundary. Complete weld ripples can be seen in the original preserved section on the first side, and continuous weld ripples can also be seen in the original preserved section on the second side. However, a clear grayscale break is formed at the splicing boundary. If the aforementioned grayscale break is not processed, subsequent defect identification will recognize it as a slit-like defect. After processing according to this step, a resampling mesh is established inside the unified weld seam area. The original preserved sections on the first and second sides maintain their original grayscale. The cross-boundary reconstruction area uses the gradient source of the original preserved sections on both sides to generate a new grayscale distribution. Finally, in the cross-boundary weld seam segment image, weld ripples can be seen continuously passing through the original splicing boundary position, without any artificial breaks. The cross-boundary weld seam segment area mask only covers the weld body and does not cover the node shadow and the adjacent base material.

[0065] After step S3, the candidate area of ​​the splicing boundary with the same seam association result of one has been reconstructed into a cross-boundary weld fragment image and a cross-boundary weld fragment region mask. The real weld information in the original retained section is preserved, and the left and right weld toe boundaries and surface grayscale in the cross-boundary continuation section are continuously restored. The artificial fracture caused by the splicing boundary is converted into a smooth transition inside the weld object, so that the object to be identified is transformed from a separate weld segment into a continuous weld fragment.

[0066] The cross-boundary weld segments already possess continuous geometric contours and continuous surface grayscale, but the inherent morphological complexity of the intersection node region does not disappear due to segment reconstruction. Weld toe turns, reinforcement height fluctuations, heat-affected zone boundaries, and local wear marks will still generate abnormal responses on the weld surface. In particular, a small number of reconstruction residues may still remain near the splicing boundary. Therefore, before forming the final weld defect identification result, it is necessary to establish a set of identification and screening mechanisms for pseudo-anomalies based on the weld entity range, splicing boundary neighborhood, and weld contour changes.

[0067] S401. Generation of initial defect candidate regions.

[0068] For each cross-boundary weld segment image and corresponding cross-boundary weld segment region mask output in step S3, the positions inside the cross-boundary weld segment region mask are first defined as valid recognition positions, and the positions outside the cross-boundary weld segment region mask are defined as invalid positions. Then, the cross-boundary weld segment image and the cross-boundary weld segment region mask are fed into the defect recognition model. The cross-boundary weld segment image is used to provide the grayscale texture of the weld surface, and the cross-boundary weld segment region mask is used to define the boundary of the weld entity. After the defect recognition model outputs the defect probability map, the positions in the defect probability map that are located inside the cross-boundary weld segment region mask and have a defect probability not lower than the defect judgment threshold are extracted to form the initial defect response region. Then, the initial defect response region is segmented into connected components, and each connected component is defined as an initial defect candidate region. The defect judgment threshold is determined using verification samples. First, the defect probability distribution is statistically analyzed on labeled real defect samples and non-defect samples. Then, the defect judgment threshold is gradually adjusted from low to high. At the same time, it is observed whether the real defect area remains continuous and whether the non-defect area begins to enter the initial defect response area in patches. The position where the real defect area has not yet broken significantly and the non-defect area has not yet expanded significantly is determined as the defect judgment threshold.

[0069] In one embodiment, the defect identification model is constructed using a publicly available encoder-decoder semantic segmentation network, such as the U-Net network as its basic structure. Its input consists of cross-boundary weld fragment images and cross-boundary weld fragment region masks. The cross-boundary weld fragment images provide grayscale texture, weld toe boundary, and reinforcement height variation information of the weld surface. The cross-boundary weld fragment region masks are used to define the weld entity range and shield the base material background. During construction, sample images containing undercut, collapse, surface pits, crack-like anomalies, and defect-free welds are first acquired. Pixel-level annotations are then performed on the defect regions in the samples. The sample images and corresponding labeled images are input into the U-Net network for supervised training. The encoding part extracts local texture, edge, and shape features layer by layer, while the decoding part restores the spatial resolution layer by layer and outputs a defect probability map of the same size as the input image. During operation, the image of the cross-boundary weld segment to be detected and the cross-boundary weld segment region mask are input into the trained defect recognition model. The defect recognition model gives a probability response to whether each position within the weld entity belongs to the defect region. Then, according to the predetermined defect judgment rules, the defect candidate region is extracted, thereby completing the identification of surface defects in the cross-boundary weld segment.

[0070] S402. Establishment of splice boundary neighborhood and weld width reference.

[0071] After the initial defect candidate region is generated, a splicing boundary neighborhood is first established around the splicing boundary, and then a weld width function is established around the cross-boundary weld segment region mask. The splicing boundary neighborhood and the weld width function are used together to distinguish between splicing boundary residual traces and real defects. In specific processing, half of the average local width of the first side and the average local width of the second side is used as the half-width of the splicing boundary neighborhood. Then, the position from the inside of the cross-boundary weld segment region mask where the shortest distance to the splicing boundary is no greater than the half-width of the splicing boundary neighborhood is selected to form the splicing boundary neighborhood.

[0072] Subsequently, normal cross-sections are established segment by segment along the cross-boundary center guide line formed in step S3. The intersection of these normal cross-sections with the mask boundary of the cross-boundary weld segment region yields the left and right boundary positions. The actual distance between the left and right boundary positions is then defined as the weld width at the corresponding arc length position. The weld width function is formed from the weld widths at all arc length positions. The weld width function does not re-extract the weld toe line; instead, it continuously records the lateral opening width of the cross-boundary weld segment region mask along the weld extension direction, allowing subsequent judgments to directly observe whether the weld entity contour undergoes actual narrowing, collapse, or protrusion near the splicing boundary. After completing this sub-step, each cross-boundary weld segment corresponds to both a splicing boundary neighborhood and a weld width function. The former is used to define the spatial range of residual traces at the splicing boundary, while the latter is used to characterize the continuous variation pattern of the weld entity contour.

[0073] S403. Identification and removal of morphological mutations located in the neighborhood of the splicing boundary and consistent with the results of the same seam association.

[0074] After obtaining the splicing boundary neighborhood and weld width function, the splicing boundary overlap ratio and morphological abrupt change amplitude of the initial defect candidate regions are calculated sequentially. The splicing boundary overlap ratio is calculated by first determining the overlap area between the initial defect candidate region and the splicing boundary neighborhood, and then dividing the overlap area by the total area of ​​the initial defect candidate region. The splicing boundary overlap ratio indicates the proportion of the initial defect candidate regions concentrated near the splicing boundary; a higher overlap ratio suggests that the aforementioned candidate regions may originate from residual traces of the splicing boundary.

[0075] The method for forming the morphological abrupt change amplitude is as follows: First, the initial defect candidate region is projected along the cross-boundary center guide line to obtain the starting and ending points of the candidate region's arc length. Then, the weld width function is taken at the starting and ending points of the candidate region's arc length, and a local reference width function is constructed using these two width values ​​as endpoints, representing a linear transition along the candidate region's arc length. The local reference width function represents the natural transition trend of the weld width along the cross-boundary center guide line when no real defects are present. Subsequently, the absolute deviation of the weld width function relative to the local reference width function is calculated position by position within the candidate region's arc length. Finally, the absolute deviation is averaged over the entire candidate region's arc length to obtain the morphological abrupt change amplitude.

[0076] Based on this, the same-seam correlation result is used as a priori condition for elimination judgment. Specifically, when the same-seam correlation result is one, it is first determined whether the overlap ratio of the splicing boundary is not lower than the splicing boundary overlap threshold, and then whether the morphological change amplitude is not higher than the morphological change threshold. Only when both conditions are met simultaneously is the initial defect candidate region identified as a morphological change located in the neighborhood of the splicing boundary and consistent with the same-seam correlation result, and removed from the defect candidates. If either condition is not met, the initial defect candidate region is retained as a defect region to be confirmed and continues to enter the subsequent confirmation steps. The splicing boundary overlap threshold and the morphological change threshold are both determined using sample distribution. The process for determining the splicing boundary overlap threshold is as follows: first, the splicing boundary overlap ratio distribution is statistically analyzed in the pre-labeled splicing boundary residual trace samples and real boundary defect samples, and then the valley position between the high-frequency areas of the two types of distributions is determined as the splicing boundary overlap threshold; the process for determining the morphological change threshold is as follows: first, the morphological change amplitude distribution is statistically analyzed in the pre-labeled splicing boundary residual trace samples and real boundary defect samples, and then the boundary inflection point position between the main peaks of the two types of distributions is determined as the morphological change threshold.

[0077] In one embodiment, after the inner node weld of the box-shaped frame is reconstructed in step S3, a thin, elongated dark band remains at the original splicing boundary position. The defect identification model identifies this dark band as an initial defect candidate region. Upon entering this sub-step, it is first found that the vast majority of the initial defect candidate regions fall within the splicing boundary neighborhood. Then, the region is projected along the cross-boundary center guide line to obtain the candidate region's arc length start and end points. A local reference width function is then formed using the weld width values ​​corresponding to these two arc length positions. Further calculation reveals that the weld width function only fluctuates slightly within the corresponding range, and the morphological change amplitude remains at a low level, indicating that the dark band does not interrupt the weld body contour. Therefore, the initial defect candidate region is identified as a morphological change located in the splicing boundary neighborhood and consistent with the same seam association result, and is removed from the defect candidates. If there is actual undercut or collapse near the splicing boundary, even though the region is also close to the splicing boundary, the weld width function will still significantly deviate from the local reference width function within the corresponding range, and the morphological change amplitude will increase accordingly. The region will not be removed.

[0078] S404. Confirm the output of defect area and weld defect identification results.

[0079] After the rejection process is completed, the average defect probability is calculated for each region to be confirmed as a defect. This average defect probability is then used as the basis for region-level confirmation. The average defect probability is calculated by summing the defect probabilities within each region to be confirmed, and then dividing the sum by the total area of ​​the region to be confirmed. A defect confirmation threshold is then introduced. When the average defect probability is not lower than the threshold, the corresponding region to be confirmed as a defective region; when the average defect probability is lower than the threshold, the corresponding region to be confirmed is not included in the final output. The defect confirmation threshold is determined through validation samples. Specifically, accuracy, recall, and precision are calculated for the average defect probability results obtained under different defect confirmation thresholds, and the defect confirmation threshold corresponding to the maximum harmonic mean is determined as the defect confirmation threshold.

[0080] For each confirmed defect area, the defect location and defect range also need to be provided. The centroid location of the confirmed defect is determined by first summing the coordinates of all positions within the confirmed defect area using area average, and then dividing the sum by the total area of ​​the confirmed defect area to obtain the centroid location. The arc length range of the confirmed defect is determined by projecting the confirmed defect area along the cross-boundary center guide line, then marking the beginning of the arc length at the front of the projection and the end at the back, thus constituting the arc length range. The final weld defect identification result consists of the confirmed defect area, the confirmed defect probability, the confirmed defect centroid location, and the confirmed defect arc length range. The confirmed defect area provides the defect surface region, the confirmed defect probability provides the defect intensity, the confirmed defect centroid location provides the defect's position in the actual length coordinate system, and the confirmed defect arc length range provides the extension range of the defect along the weld direction. All of the aforementioned weld defect identification results are confined within the cross-boundary weld segment region mask, thus avoiding nodal shadows and the base material background.

[0081] After step S4, the cross-boundary weld segment image and the cross-boundary weld segment region mask have been transformed into the confirmed defect region, the confirmed defect probability, the confirmed defect centroid location, and the confirmed defect arc length range. The morphological aberrations located in the neighborhood of the splicing boundary and consistent with the results of the same weld association are identified and excluded. The remaining abnormal regions have both regional defect response and contour-level morphological basis, so that the weld defect identification results of the cross node region have both clear spatial location and higher interpretability and verification value.

[0082] The above are merely preferred embodiments of the present invention and are not intended to limit the present invention.

[0083] In the description of this specification, references to terms such as "an embodiment," "example," and "specific example" indicate that a specific feature, structure, material, or characteristic described in connection with that embodiment or example is included in at least one embodiment or example of the invention. In this specification, illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples.

[0084] The preferred embodiments of the present invention disclosed above are used to illustrate the present invention. These preferred embodiments do not describe all details exhaustively, nor do they limit the present invention to the specific implementations described. Various modifications and variations can be made based on the content of this specification. This specification selects and specifically describes embodiments to illustrate the principles and practical applications of the present invention, enabling those skilled in the art to understand and implement the present invention.

Claims

1. A method for rapid online identification of weld defects based on machine vision, characterized in that, Including the following steps: S1. Acquire local weld images formed by block acquisition, determine the splicing boundary based on the splicing relationship of adjacent local weld images, and extract the weld areas that intersect with the splicing boundary and cross the areas on both sides of the splicing boundary to obtain the splicing boundary candidate area. S2, for each candidate splicing boundary region, extract the end features of the welds on both sides of the splicing boundary, generate the association features that characterize the continuity of the welds on both sides of the splicing boundary, and input the association features into the same seam association model to generate the same seam association results; S3. Based on the same seam association results, for the candidate splicing boundary areas that are determined to be the same short weld segment, cross-boundary segment reconstruction is performed according to the weld end features to generate cross-boundary weld segment images and cross-boundary weld segment region masks. S4. Input the cross-boundary weld segment image and the cross-boundary weld segment region mask into the defect recognition model to generate the initial defect candidate region; First, a splicing boundary neighborhood is established around the splicing boundary. Then, a weld width function is established around the cross-boundary weld segment region mask. Subsequently, normal cross-sections are established segment by segment along the cross-boundary center guide line formed in step S3. The left and right boundary positions are obtained after the normal cross-sections intersect with the cross-boundary weld segment region mask boundary. The actual distance between the left and right boundary positions is defined as the weld width at the corresponding arc length position. The weld width function is formed by the weld widths at all arc length positions. For each initial defect candidate region, the overlap ratio with the splicing boundary neighborhood is calculated, and a corresponding local reference width function is formed based on the weld width function. The morphological change amplitude corresponding to the initial defect candidate region is calculated. The splicing boundary overlap ratio is formed by first calculating the overlap area between the initial defect candidate region and the splicing boundary neighborhood, and then dividing the overlap area by the total area of ​​the initial defect candidate region to obtain the splicing boundary overlap ratio. The morphological change amplitude is formed by... The formula is as follows: First, project the initial defect candidate region along the cross-boundary center guide line to obtain the starting point and ending point of the candidate region arc length. Then, take the width value of the weld width function at the starting point and ending point of the candidate region arc length, and construct a local reference width function that linearly transitions along the range of the candidate region arc length using the two width values ​​as endpoints. Subsequently, calculate the absolute deviation of the weld width function relative to the local reference width function at each position within the range of the candidate region arc length, and then average the absolute deviation along the entire range of the candidate region arc length to obtain the morphological change amplitude. When the same weld association result is characterized as the same short weld segment, the overlap ratio is not lower than the splicing boundary overlap threshold, and the morphological change amplitude is not higher than the morphological change threshold, the corresponding initial defect candidate region is removed. For the retained region, calculate the regional average defect probability, confirm the defect centroid position, and confirm the defect arc length range to form the weld defect identification result.

2. The method for rapid online identification of weld defects based on machine vision according to claim 1, characterized in that, Step S1 includes: mapping the local weld image to the actual length coordinate system according to the imaging calibration results, forming an effective imaging area after removing edge distortion areas and edge brightness attenuation areas; establishing a stitching relationship based on the overlap range of adjacent effective imaging areas, and determining the stitching boundary within the overlap range according to the equidistant positions of the boundaries of the two effective imaging areas, while dividing the first side area of ​​the stitching boundary and the second side area of ​​the stitching boundary.

3. The method for rapid online identification of weld defects based on machine vision according to claim 2, characterized in that, Step S1 further includes: performing weld segmentation on the local weld images involved in the splicing relationship to form a joint weld region located within the overlapping range; performing connected domain separation and centerline extraction on the joint weld region, retaining the connected weld regions that intersect with the splicing boundary and have continuous centerline segments in both the first side region and the second side region of the splicing boundary, as candidate splicing boundary regions.

4. The method for rapid online identification of weld defects based on machine vision according to claim 3, characterized in that, Step S2 includes: determining the splicing boundary crossing position on the centerline of the candidate splicing boundary area; defining the portion of the candidate splicing boundary centerline located in the first side region of the splicing boundary as the first side weld centerline; defining the portion of the candidate splicing boundary centerline located in the second side region of the splicing boundary as the second side weld centerline; establishing a first side end analysis line segment along the first side weld centerline within the first side region of the splicing boundary; establishing a second side end analysis line segment along the second side weld centerline within the second side region of the splicing boundary; and measuring the local width segment by segment to obtain the first side local average width and the second side local average width, wherein the larger of the first side local average width and the second side local average width is used to determine the end analysis length; after obtaining the end analysis length, cutting a section along the first side weld centerline at a distance not exceeding the end analysis length from the splicing boundary crossing position. A continuous line segment of degree is used to form the first side end analysis line segment. The second side end analysis line segment is formed along the center line of the second side weld according to the same rule. Then, the positions where the width change is relatively flat in the first side end analysis line segment and the second side end analysis line segment are respectively used as the first side end representative cross-section and the second side end representative cross-section. The width stability threshold is determined by the verification sample. Specifically, the weld toe endpoints are extracted for the end representative cross-sections extracted under different width change thresholds, and the positional deviation between the extraction result and the manually marked weld toe endpoints is calculated. The width change threshold corresponding to the minimum positional deviation is determined as the width stability threshold. Normal cross-sections are established segment by segment on the end analysis line segment and the left and right weld toe lines are extracted. The weld toe endpoints are formed by the intersection of the end representative cross-section and the left and right weld toe lines. The weld toe extension direction is formed according to the tangent direction of the end of the left and right weld toe lines.

5. The method for rapid online identification of weld defects based on machine vision according to claim 4, characterized in that, Step S2 further includes: extending across the boundary from the endpoint of the first side weld toe along the extension direction of the first side weld toe to the second side region of the splicing boundary, and extending across the boundary from the endpoint of the second side weld toe along the extension direction of the second side weld toe to the first side region of the splicing boundary, and forming the weld toe cross-boundary landing point offset value with the distance between the bidirectional extension result and the endpoint of the opposite side weld toe; forming the first side adjacent texture map and the second side adjacent texture map respectively with the aforementioned first side weld centerline and second side weld centerline as the development reference, and forming the boundary adjacent texture area ratio with the ratio of the area of ​​the receiving texture region to the area of ​​the effective comparison region.

6. The method for rapid online identification of weld defects based on machine vision according to claim 5, characterized in that, Step S2 also includes: the same seam association model is constructed using a radial basis kernel support vector machine. The offset value of the weld toe across the boundary is normalized by the end analysis length and together with the boundary bearing strip area ratio to form the association feature input to the same seam association model. After training with same seam samples and different seam samples, the radial basis kernel support vector machine outputs classification decision values, and forms the same seam confidence coefficient through probability mapping. Then, the same seam association result is generated based on the same seam judgment threshold.

7. The method for rapid online identification of weld defects based on machine vision according to claim 6, characterized in that, Step S3 includes: when the joint association result is characterized as the same short weld segment, establishing an arc length sequence along the center line of the candidate area of ​​the splicing boundary, forming a left weld toe continuation curve with the intersection of the first left weld toe and the second left weld toe, forming a right weld toe continuation curve with the intersection of the first right weld toe and the second right weld toe, and constraining the start and end trends of the left and right weld toe continuation curves according to the end analysis length and the tangent direction of the corresponding weld toe line end; and then forming a cross-boundary center guide line based on the two continuation curves.

8. The method for rapid online identification of weld defects based on machine vision according to claim 7, characterized in that, Step S3 further includes: using the aforementioned left weld toe continuation curve and right weld toe continuation curve to enclose a cross-boundary reconstruction region; establishing an arc length order along the center line of the splicing boundary candidate region, using the corresponding position of the first side weld toe endpoint on the center line of the splicing boundary candidate region as the first side boundary position, and the corresponding position of the second side weld toe endpoint on the center line of the splicing boundary candidate region as the second side boundary position, defining the portion before the first side boundary position as the first side original preserved segment, and defining the portion after the second side boundary position as the second side original preserved segment; using the first side original preserved segment and the second side original preserved segment as boundary grayscale sources, using Poisson fusion to generate a continuous grayscale distribution within the cross-boundary reconstruction region; and then writing the first side original preserved segment, the cross-boundary reconstruction region, and the second side original preserved segment into a unified resampling grid in spatial order to form a cross-boundary weld fragment image and a cross-boundary weld fragment region mask.

9. The method for rapid online identification of weld defects based on machine vision according to claim 8, characterized in that, Step S4 includes: inputting the cross-boundary weld segment image and the cross-boundary weld segment region mask into the defect recognition model to generate a defect probability map, and extracting the initial defect candidate region from the defect probability map using a defect judgment threshold; then establishing a splicing boundary neighborhood using the aforementioned first side local average width and second side local average width, and extracting the lateral width change of the cross-boundary weld segment region mask along the cross-boundary center guide line to form a weld width function.

Citation Information

Patent Citations

  • Large steel structure intelligent welding guiding system

    CN111687515A

  • Large square grid component robot welding equipment based on machine vision and welding seam positioning method

    CN113385869A

  • Automatic identification, positioning and size calculation method for super-long welding seam and typical defect

    CN116503417A

  • Cylindrical shell welding seam automatic identification and defect screening method

    CN122199548A