Laser scanning-linear growth depth collaborative pre-welding plate abutted seam visual center positioning line obtaining method
By employing a laser scanning-linear growth depth synergy approach, combined with vision-assisted laser-driven global scanning and local refinement, high-precision, interference-resistant, and continuous pre-weld seam inspection is achieved. This solves the bottlenecks of ultra-narrow seam positioning deviation and long-range inspection, and is adaptable to various scenario requirements.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- SHANGHAI JIAOTONG UNIV
- Filing Date
- 2026-01-19
- Publication Date
- 2026-04-28
AI Technical Summary
Existing technologies for pre-weld seam inspection in the automotive, aerospace, military, and shipbuilding industries suffer from problems such as insufficient high-precision positioning of ultra-narrow seams, poor anti-interference under complex interference, difficulty in achieving meter-level long-range one-time inspection, and low inspection efficiency. Traditional laser-vision collaborative inspection cannot meet the stringent requirements.
A laser scanning-linear growth depth synergy approach is adopted, which achieves high-precision seam center positioning through vision-assisted laser-driven global scanning and local refinement, cross-frame seed point transfer, and composite iterative edge trimming fitting.
It achieves high-precision, strong anti-interference, good continuity and strong adaptability of pre-weld seam inspection, and breaks through the bottlenecks of ultra-narrow seam positioning deviation, unreliable anchor points and long-distance inspection, adapting to the needs of multiple scenarios.
Smart Images

Figure CN121937515A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of pre-weld seam positioning technology, and in particular to a method for obtaining the visual center positioning line of pre-weld plate seams using laser scanning and linear growth depth coordination. Background Technology
[0002] In pre-weld seam inspection scenarios in the automotive, aerospace, military, and shipbuilding industries, positioning accuracy, anti-interference capabilities, inspection continuity, and efficiency directly determine welding quality and adaptability to industrial production lines, making them core aspects of precision welding quality control. However, current technologies face significant bottlenecks in meeting the four core requirements of "high-precision positioning in ultra-narrow seams," "resistance to complex interference," "meter-level long-range one-time inspection," and "fast and efficient computation," making it difficult to meet the stringent requirements of extreme working conditions. Specific problems include: 1) Bottleneck of insufficient detection and positioning accuracy in ultra-narrow slits ① Single-vision detection: Ultra-narrow slit edge detection can only obtain sparse points, and the accuracy of point selection and fitting is insufficient. Single-vision detection relies on edge detection operators (such as Canny, Sobel, etc.) to extract seam features. However, the minute grayscale differences in ultra-narrow seams (typically <0.2mm) cause edge detection to only capture sparse discrete points. On the one hand, these selected scattered points have low precision and are easily affected by seam side impurities and tiny scratches, making it impossible to accurately anchor the seam center. On the other hand, the sparsity of scattered points makes subsequent optimization lack data support, making it impossible to perform high-precision iterative edge trimming and effectively eliminate noise. Ultimately, the positioning lines generated by interpolation or fitting have deviations and cannot meet the precise positioning requirements of ultra-narrow seams.
[0003] ② Single laser scanning detection: Structured light cannot be applied to seams, resulting in sparse or ineffective seam recognition. Single laser scanning detection relies on the depth difference of the seam gap to identify the seam. However, the ultra-narrow seam gap is too small, which will cause the laser structured light to be unable to "fall into" the gap in the depth direction. The original depth fracture characteristics disappear, and the laser signal directly covers both sides of the seam and becomes a whole. This will cause single laser scanning detection to either only detect sparse discrete points or completely fail to identify the ultra-narrow seam. Subsequent point selection and fitting will also face the problem of low positioning accuracy due to insufficient data and poor representativeness of the point set, and will not be able to output a high-precision ultra-narrow seam center positioning line.
[0004] 2) Shortcomings in anti-interference capability under complex interference environments ① Single vision detection: Edge detection struggles to distinguish interference, and anti-interference operations result in a loss of accuracy. Edge detection algorithms based solely on visual inspection identify edges through abrupt changes in grayscale, failing to distinguish seams from indentations, scratches, or thin black lines based on their inherent features. When interference features are similar to those of the seam, they are often identified as seam edges, especially intersecting scratches and thin black lines, leading to severe distortion in seam edge extraction. Furthermore, morphological operations such as Gaussian blurring, filtering, and erosion / dilation introduced for noise reduction destroy subtle seam features, resulting in some degree of seam distortion and limiting the achievement of ultra-high precision positioning.
[0005] ② Single laser inspection: Surface interference and seam features are similar, making it easy to misjudge the inspection point. Single laser inspection is weak in resisting interference from surface dents, scratches, and fine black lines on the board: dents and scratches can change the laser reflection path or depth signal, which may be misidentified as seams; while the absorption of laser by fine black lines can simulate the "low reflection" characteristics of seams, making it difficult for laser inspection to distinguish between the two, and may also include fine black lines in the seam selection range, causing the positioning line to deviate from the actual seam; therefore, single laser inspection does not have the ability to resist complex interference (such as parallel / intersecting fine black lines of high-fidelity seams, parallel / intersecting deep scratches of high-fidelity seams, etc.).
[0006] 3) Bottleneck in one-time inspection of meter-level long-distance seams ① Single detection technology: Due to the limitations of wide fluctuation range and insufficient immunity throughout the process, it is difficult to meet the standards for long-term single detection. Meter-level long-range seams generally exhibit unstable width characteristics. Conventional narrow seams may randomly become ultra-narrow seams in some areas. Single vision or laser scanning has inherently insufficient accuracy in detecting ultra-narrow seams, and can only capture sparse points, or even cannot effectively select points at all. Long-range one-time inspection needs to resist complex interference throughout the process. Both types of technologies are sensitive to interference and are prone to breakage of positioning lines. Ultimately, due to the difficulty in adapting to the feature differences caused by width fluctuations, neither can meet the requirements of long-range one-time inspection.
[0007] ② Traditional laser-vision synergy: The degree of synergy between laser and vision is insufficient, making it difficult to overcome technical bottlenecks. Traditional laser-vision collaboration lacks deep integration logic and cannot form a "complementary" detection loop: when adopting the "laser scanning first, then vision detection" mode, the two independent scans add extra detection time, which directly conflicts with the efficiency requirements of long-range one-time detection; while the strategy of "switching to vision when laser fails" still faces inherent problems such as insufficient accuracy of ultra-narrow slits and interference misjudgment because vision detection still relies on edge detection operators; even if switching to vision detection, it still cannot solve the core pain points of positioning accuracy and continuity, ultimately forming a difficult technical bottleneck to overcome in meter-level long-range one-time detection scenarios.
[0008] 4) Theoretical complexity, efficiency, and generalization bottlenecks of algorithms for rapid detection and multi-scenario adaptation. ① Traditional visual inspection: Theoretical design ignores seam features, and multiple steps lead to a contradiction between complexity and efficiency. Traditional visual inspection algorithms are not designed to fit the spatial characteristics of seams (such as linear trends and continuous shapes). They only achieve detection through "passive multi-step superposition," which requires sequential execution of Gaussian blur, filtering, edge operator processing (such as Canny and Sobel), erosion / dilation, and other operations. This is close to general image processing logic and is not optimized for the spatial correlation characteristics of seams. This directly leads to problems such as high algorithm complexity, strong parameter coupling between steps, and difficulty in debugging.
[0009] ② Deep learning-assisted detection: The large number of parameters slows down efficiency, and the high annotation cost and weak generalization of scenarios are fundamental limitations. Some solutions introduce deep learning to assist in seam recognition, but the core bottlenecks are prominent; most models have a large number of parameters and take a long time to compute; the model training cost is high, the operation is cumbersome and the scene adaptability is poor, requiring large-scale and accurate labeled samples to cover seam scenes with different materials and widths, which is labor-intensive, time-consuming and requires continuous replenishment of new samples; the model has weak generalization ability to "unseen scenes" (such as unlabeled materials and new surface interference), and once it is outside the coverage of training samples, it is easy to fail to recognize, making it difficult to adapt to the needs of multiple industrial scenarios. Summary of the Invention
[0010] The purpose of this invention is to provide a method for obtaining the visual center positioning line of the pre-welding plate seam through laser scanning-linear growth depth coordination, which achieves a comprehensive upgrade in accuracy, anti-interference, continuity, efficiency and adaptability.
[0011] The objective of this invention can be achieved through the following technical solutions: A method for obtaining the visual center positioning line of the pre-welding plate joint using laser scanning and linear growth depth coordination includes: For the pre-welding plate, the laser scanning data of the laser scanning module for global scanning is acquired in real time, and the visual inspection image of the visual inspection module is acquired simultaneously. The global seed points are obtained with the scanning results as the primary factor and the visual inspection image as the auxiliary factor. Based on the global seed points, the initial position of the seed points in the visual inspection image is determined. Dense growth is performed starting from the initial position, and the resulting breakpoints are cyclically tracked and repaired to obtain the seam selection points. Based on the selected seam points, a screening process is first performed, followed by a compound iterative trimming and fitting process to obtain the seam center positioning line.
[0012] Furthermore, the step of obtaining the global seed point includes: Based on the real-time laser scanning data from the laser scanning module, the splice coordinates and selection validity data of each area of the plate before welding are obtained in real time. When the laser scanning module detects invalid points or the vertical distance between adjacent points in the area exceeds a set threshold in real time, it will switch to the visual detection module for visual detection, re-select points, and extract the initial seed points. The initial seed point is optimized by linear growth and curve fitting. The previous frame stitching growth endpoint of the visual detection module is extracted and used as the initial seed point of the subsequent frame. Combined with the inter-frame partial overlap design, the initial seed point is transferred across frames. Meanwhile, the laser scanning module operates redundantly, determining whether the conditions for switching back to the laser scanning module are met. If yes, it switches back to the laser scanning module and performs laser scanning; otherwise, the visual detection module continues to perform cross-frame transmission of initial seed points, eventually obtaining all initial seed points as global seed points.
[0013] Furthermore, the initial seed point extraction step includes: Based on the last valid laser selection point of the laser scanning module, the visual detection module backtracks backward a set length of historical laser scanning data and uses it as the backtracking range; Within the backtracking range, a local analysis region is constructed in the visual detection image with each laser scanning point as the center, and the selection point density of each local analysis region is calculated. Select the local analysis area with the highest point density, use its center point as the reference anchor point, and construct a pixel refinement area of a set size with the reference anchor point as the center. The algorithm of selecting the darkest column is used to first calculate the average gray value of each column of pixels in the pixel refinement area, filter out the column with the smallest average gray value, and then select the pixel with the smallest gray value from the column with the smallest average gray value as the initial seed point.
[0014] Furthermore, the conditions for switching back to the laser scanning module include: The vertical distance between adjacent selected points within the area does not exceed a set threshold, and the density of selected points meets the set qualification standard.
[0015] Furthermore, the step of obtaining the global seed point includes: The full-range sparse point selection data obtained by the laser scanning module after performing a global scan along the seam extension direction, and the visual inspection images synchronously acquired by the visual inspection module are acquired and temporarily stored and stacked. Using each selected point obtained by the laser scanning module as the center, a local analysis region of a set size is constructed in the visual detection image, and the selected point density of each local analysis region is calculated; Select the local analysis region with the highest point density, take its center point as the reference anchor point, and construct a pixel refinement region of a set size in a single frame visual detection image with the reference anchor point as the center. The darkest column selection algorithm is used to first calculate the average gray value of each column of pixels in the pixel refinement area, filter out the column with the smallest average gray value, and then select the pixel with the smallest gray value from the column with the smallest average gray value as the initial seed point. The initial seed point is optimized through linear growth and curve fitting. The end point of the stitching growth of the previous frame of the visual detection module is extracted, and its x-axis is used as the initial seed point at y=0 of the next frame. Combined with the inter-frame partial overlap design, the initial seed point is transferred across frames. At the same time, during the cross-frame transfer process, a lightweight matching algorithm is used to select the point that best matches the gray-scale distribution of the surrounding gray-scale distribution of the end point of the previous frame and the surrounding gray-scale distribution of the initial seed point of the next frame, and whose deviation from the fitted positioning line of the previous frame is within a set threshold. This point is used as the final initial seed point of the frame, and linear growth of the initial seed point of the next frame is performed. Determine whether there is insufficient linear growth or deviation in growth branching of the initial seed point. If so, the laser scanning module switches from standby mode to emergency mode, takes the area corresponding to the initial seed point as the current failed area, performs local scanning only on the current failed area and its surrounding area, constructs local analysis sub-regions within the local scanning range, calculates the selection point density of each local analysis sub-region, and takes the center point of the local analysis sub-region with the highest selection point density as the emergency reference anchor point. The visual detection module receives the emergency reference anchor point, selects a new initial seed point using the darkest column seed selection algorithm, re-executes the cross-frame transmission of the initial seed point, and the laser scanning module switches back to standby mode. If not, the visual detection module continues to perform the cross-frame transmission of the initial seed points, eventually obtaining all the initial seed points as global seed points.
[0016] Furthermore, the step of obtaining the seam selection points includes: (1) Based on the global seed point, the global coordinates of the seed point are obtained by triangulation method, and after coordinate mapping, they are transmitted to the visual detection module to determine the initial position in the visual detection image; (2) Take the seed point corresponding to the initial position as the starting growth point, and perform dense growth according to the vertical priority eight-neighbor breadth-first growth rule. After the growth is completed, a breadth-first growth queue containing only effective growth points is obtained. (3) Based on the breadth-first growth queue, the current distribution of seam points is obtained; (4) Extract the uppermost and lowermost endpoints from the current seam point distribution, and create pixel orientation search regions along their respective extension directions; (5) Analyze the grayscale features in the pixel orientation search area and select the darkest column and the darkest unvisited point in it as candidate breakpoints that meet the characteristics of the stitching dark area; (6) Construct a local analysis window centered on the candidate breakpoint, calculate the local dynamic threshold of the local analysis window using the Otsu algorithm, and verify the matching between the candidate breakpoint and the dark area feature of the seam based on the local dynamic threshold. If the verification is successful, connect the candidate breakpoint and repair the discontinuous part of the seam. If the verification fails, do not repair. (7) Check if there are any new seam points. If so, get the current seam point distribution again and repeat steps (4)-(6) for iterative processing. If not, determine that the repair is complete and finally get all seam selection points.
[0017] Furthermore, the step of obtaining a breadth-first growth queue containing only valid growth points includes: 1) Initialize and create an empty breadth-first growth queue. Starting from the initial growth point, add the global seed point into the breadth-first growth queue, wherein the breadth-first growth queue adopts the first-in-first-out storage rule. 2) Select the current growth point from the head of the breadth-first growth queue, and construct a local analysis window centered on the current growth point; 3) Considering that the seam and the surrounding environment present a bimodal grayscale distribution in the local analysis window, the local dynamic threshold is calculated for the local analysis window using the Otsu algorithm based on the bimodal grayscale distribution; 4) The current growth point traverses eight neighboring pixels according to the vertical priority rule, and checks whether the grayscale of each pixel meets the local dynamic threshold. If yes, then proceed to step 5); otherwise, discard it. 5) Determine if the current growth point passes the darkness check. If yes, proceed to step 6). If no, discard it. 6) Determine whether the current growth point passes the directional continuity constraint check. If yes, it is determined to be a valid growth point, marked as visited, and re-included in the breadth-first growth queue, placed at its tail. If not, it is discarded. 7) Repeat steps 2)-6) until the traversal is complete, and obtain the final breadth-first growth queue containing only valid growth points.
[0018] Furthermore, the steps for verifying the directional continuity constraint include: For the current growth point, construct a dynamic historical growth point window that contains multiple historical latest growth points; When the dynamic historical growth point window accumulates more than a set number of valid growth points, all the latest historical growth points are sorted according to their y-coordinates, and a linear fit is performed using the least squares method to construct a mathematical model for fitting the seam direction. The expected x-coordinate is calculated based on the mathematical model of the fitted seam direction. The absolute deviation between the actual x-coordinate and the expected x-coordinate is compared. If the absolute deviation is less than or equal to a set value, the verification passes; otherwise, it is determined to be an interference point and the verification fails.
[0019] Furthermore, the step of obtaining the seam center positioning line includes: All the selected seam points are sorted in order according to the vertical coordinates corresponding to the seam extension direction, so that the selected seam points with the same vertical coordinate are classified and form a point set structure distributed by row. Based on the point set structure, the points are filtered row by row according to the set dual criteria, and representative points of each row are obtained to form the filtered point set structure. Based on the filtered point set structure, a third-order polynomial is used to initially fit the representative points to obtain an initial fitting curve, which serves as the initial seam center positioning line. Calculate the deviation value of each representative point from the fitted curve, compare it with a preset threshold, filter out the representative points corresponding to the preset threshold, and retain only the representative points that meet the preset threshold. For the representative points that meet the preset threshold, a second-order polynomial iterative fitting is performed to obtain the final fitting curve, which serves as the final seam center positioning line. The number of iterations is ≤3. During each iterative fitting process, representative points that do not meet the dynamic threshold are filtered out by calculating the dynamic threshold. The expression for calculating the dynamic threshold is: dynamic threshold = mean deviation + (0.8 - number of iterations × 0.2) × standard deviation.
[0020] Furthermore, the step of obtaining the filtered point set structure includes: For the point set structure, calculate the median of the horizontal coordinate of each row, define the constraint range based on the median of the horizontal coordinate, and retain only the seam selection points that are within the constraint range and are far from the median of the horizontal coordinate. For all seam selection points in each row that satisfy the constraints, select the seam selection point with the smallest gray value as the darkest point, and use the darkest point as the representative point of the corresponding row. If a row cannot simultaneously filter out the darkest point that satisfies both the constraints and the minimum gray value, then sort the row according to the horizontal coordinate and take the seam selection point located at the midpoint as the representative point. Finally, by performing the above processing on each row of the point set structure, the filtering process is completed, and the filtered point set structure is obtained.
[0021] Compared with the prior art, the present invention has the following beneficial effects: (1) This invention addresses four major technical problems in existing pre-welding seam positioning: insufficient high-precision positioning of ultra-narrow seams, shortness of anti-interference in complex environments, bottleneck of meter-level long-range one-time detection, and low efficiency through three core technology systems: laser-vision dual-mode deep collaboration, active dense growth point selection, and composite iterative trimming fitting. It achieves a comprehensive upgrade in accuracy, anti-interference, continuity, efficiency, and adaptability.
[0022] (2) This invention proposes a global seed point positioning scheme with visual-assisted laser as the core, which integrates data backtracking point density screening, pixel-level fine-tuning of the darkest column, and cross-frame endpoint inheritance. This scheme abandons the limitations of traditional single-mode and shallow collaboration. Through the progressive logic of "global scanning and anchoring - local fine-tuning and calibration - cross-frame continuous transmission - precise switching closed loop", it fundamentally solves problems such as ultra-narrow slit positioning deviation and unreliable anchor points, providing high stability and high precision seed point starting point support for meter-level long-range one-time detection.
[0023] (3) This invention proposes a seed point positioning scheme for stitching seams, which is based on continuous visual tracking, supplemented by laser initial anchoring and emergency point filling, and integrates accelerated calculation, global screening of maximum point density, refinement of the darkest column, and seed point transfer between front and back images. This scheme breaks the traditional fixed logic of "laser as the main method and visual blind spot filling", and overcomes the problems of positioning continuity, initial point reliability and extreme interference adaptation in laser sparse point selection scenarios through the closed-loop progressive logic of "laser initial anchoring - continuous visual transfer - laser emergency point filling - visual follow-up tracking".
[0024] (4) This invention proposes a multi-constraint collaborative linear growth scheme with directional continuity constraints as the core of correction, customized window adaptive threshold as the basis of feature extraction, and breakpoint loop tracking as the integrity guarantee. This scheme abandons the traditional general image processing logic and solves the problems of point selection offset, feature loss, and structural breakage from the root through the progressive logic of "basic preparation - feature extraction - directional correction - breakpoint repair", providing high-precision point set support for laser weld seam tracking and welding torch path planning.
[0025] (5) This invention proposes a composite iterative edge trimming technology scheme with the core of precise in-line point selection through the coordination of median position constraint and grayscale essence recognition, combined with third-order initial fitting, second-order iterative reduction and dynamic threshold filtering. This scheme filters out noise and abnormal points from the root, overcomes the problem of balancing the smoothness and accuracy of the positioning line, and adapts to multiple scenarios through parameterized design. Attached Figure Description
[0026] Figure 1 This is a flowchart of the method of the present invention; Figure 2 This is a flowchart of the global seed point generation process for Scheme 1 in this invention; Figure 3This is a flowchart of the global seed point generation process for Scheme 2 in this invention; Figure 4 This is a flowchart illustrating the selection process for seam selection points in this invention. Figure 5 This is a flowchart of the fitting steps for the center positioning line of the seam in this invention. Detailed Implementation
[0027] The present invention will now be described in detail with reference to the accompanying drawings and specific embodiments. These embodiments are based on the technical solution of the present invention and provide detailed implementation methods and specific operating procedures. However, the scope of protection of the present invention is not limited to the following embodiments.
[0028] Example 1 This embodiment provides a method for obtaining the visual center positioning line of the pre-welding plate joint using laser scanning and linear growth depth coordination. Specifically, as shown in the example... Figure 1 As shown, the method includes the following steps: Step 1: Visual-assisted laser-driven seed location method, combining maximum point density backtracking and darkest column seed selection (Scheme 1) This embodiment uses two methods to select the seam seed point (also known as the global seed point), and this step uses Scheme 1 to generate it.
[0029] Addressing the core pain points of long-range seam inspection in automotive, aerospace, and other fields—namely, the failure of single-laser ultra-narrow seam selection, the weak resistance to complex interference and lack of reliable anchor points in single-vision systems, and the inadequacy of traditional laser-vision collaborative fusion—this invention proposes a seam seed point positioning scheme centered on vision-assisted laser, integrating data backtracking point density screening, pixel-level refinement of the darkest column, and cross-frame endpoint inheritance. This scheme abandons the limitations of traditional single-modality and shallow collaboration, fundamentally solving problems such as ultra-narrow seam positioning deviation and unreliable anchor points through a progressive logic of "global scanning and anchoring - local refinement and calibration - continuous cross-frame transmission - precise switching closed loop." This provides highly stable and high-precision seed point starting point support for meter-level long-range one-time inspection. The scheme is systematically advanced through four stages: collaborative equipment deployment and workflow design, high-reliability reference point screening, accurate initial seed point extraction, and cross-frame seed point transmission and switchback triggering. Figure 2 The specific plan is as follows: 1) Collaborative device deployment and workflow design To establish an efficient linkage mechanism between laser and vision sensors, clarify the execution logic, resource scheduling rules, and switching conditions for long-range board inspection tasks, and solidify the inspection foundation of "global coverage - local blind spot filling," it is necessary to prioritize the completion of equipment layout planning and workflow closed-loop design. The specific steps are as follows: ① Modular equipment layout: For long-distance board inspection scenarios, a layout scheme of vision and laser on the same equipment is adopted to build a linkage workflow of "laser global scanning - vision local fine-tuning"; the laser scanning module and the vision inspection module synchronize data in real time (laser scanning data and vision inspection images respectively), ensuring that the vision inspection module can dynamically receive global positioning data from laser scanning, providing coordinate reference for subsequent positioning.
[0030] ② Switching Trigger Logic Design: The laser scanning module prioritizes the global rapid detection and point selection tasks for long-range boards; the system monitors the effectiveness of laser point selection in real time (interference points deviating from the seam are considered invalid, which can be defined by distance thresholds and directional continuity, etc.) to check complex areas where laser point selection is difficult to be precise. As long as invalid points are detected, the system switches to the vision detection module for reprocessing; at the same time, it uses quantitative analysis of the vertical distance between adjacent points for auxiliary judgment. When the distance exceeds the preset threshold, the area is also defined as a sparse laser point segment, and the system automatically triggers a switching command, allowing the vision detection module to seamlessly take over the positioning task.
[0031] 2) High-reliability reference point selection process To provide highly reliable coordinate anchor points for the continuous positioning of the visual inspection module, it is necessary to screen low-interference and feature-stable reference points from historical laser scanning data, and construct a precise screening link of "data focusing - density optimization". The specific process is as follows: ① Data backtracking range definition: The visual inspection module calls up historical laser scanning data and backtracks backward a set length (usually the length of an image, such as 1000 pixels; if it is at the edge, the reliable pixels before laser failure are only 500 pixels, then backtrack 500 pixels) of historical scanning data to lock in the last reliable laser positioning data range, define the high-quality data source boundary for reference point screening, and avoid introducing interference data from the laser positioning failure stage.
[0032] ② Point density feature selection: Within the defined traceability range, a local analysis area (e.g., a 5x200 rectangular area) is constructed centered on each laser scanning point, and the point density of the selected laser points within each area is quantitatively calculated. The area with the highest point density means that the laser scanning is least affected by environmental interference and has the strongest feature consistency, and can be determined as the optimal target area; finally, the center point of this area is used as the core reference anchor point for visual positioning, providing a precise coordinate benchmark for the visual inspection module.
[0033] 3) Initial Seed Point Precision Extraction Process To address the issue of edge offset (potentially 0-3 pixels) caused by environmental interference or calibration deviations in laser reference points, a visual local refinement algorithm is used to anchor the true features of the stitching seams, achieving pixel-level positioning and calibration of the seed points. As the core starting point for linear growth, the accuracy of the seed points directly determines the continuity of subsequent positioning. The specific process is as follows: ① Refinement Area Focused Construction: Using the selected laser reference point as the center, construct a rectangular refinement area of a set size (e.g., a 10×50 rectangular area). The area range accurately covers a reasonable range where the reference point may shift, ensuring that the low grayscale features of the seam edge are completely included, defining an efficient analysis range for subsequent feature extraction, and avoiding interference from irrelevant areas.
[0034] ② Darkest column selection algorithm: The darkest column selection algorithm is used to accurately extract seed points. First, the average gray value of each column of pixels in the region is calculated, and the column with the smallest average gray value is selected (candidate line of the seam center). Then, the pixel with the smallest gray value in the column is locked as the initial seed point. Through the dual verification of "column-level screening - point-level positioning", the pixel-level deviation correction of the laser reference point is realized.
[0035] 4) Seed point cross-frame transmission and switchback triggering logic design process To achieve continuous connection of seed points across frames in long-range detection, and to construct a precise switching mechanism between the laser scanning module and the visual inspection module to avoid frequent switching errors and ensure the stability and efficiency of the positioning link, the specific process is as follows: ① Seed point cross-frame transmission design: When the switchback trigger logic has not yet been reached, visual detection needs to continue. Seed points are inherited frame by frame, using the "inter-frame overlap-endpoint inheritance" transmission mechanism. The camera shooting parameters are set to ensure that the subsequent frame overlaps with the previous frame by 1 / 4. After the initial seed point is optimized by linear growth and curve fitting, its precise endpoint (usually in the 0-1 / 4 height area, overlapping with the 3 / 4-1 height area of the next image) is extracted as the initial seed point of the subsequent frame. This avoids the positioning deviation caused by the re-initialization of seed points, thereby realizing the precise inheritance of seed points and continuous growth of selected points.
[0036] ② Switchback Trigger Logic Design: Accurate switchback is achieved based on "laser redundant operation - dual condition verification"; during the visual takeover of point selection, the laser scanning module continues to run to output the height data required throughout the process, and simultaneously calculates the point selection results as the basis for switching; when the dual conditions of "the vertical distance between adjacent selected points is less than the threshold and the point density within the preset rectangle meets the standard" are met, it is determined that the laser has left the ultra-narrow slit or other laser failure area, and the system automatically triggers a switchback, with the laser scanning module, which has a detection speed of extremely fast (e.g., 2ms), taking over the point selection task again, and the visual inspection module is turned off; in this overall switching and switching-back cycle between laser scanning and visual inspection, a balance is achieved between high-precision detection and fast detection.
[0037] In summary, this embodiment obtains all initial seed points as global seed points through a progressive logic of "global scanning and anchoring - local fine-tuning and calibration - continuous transmission across frames - precise switching closed loop".
[0038] For the above-mentioned Scheme 1, this embodiment takes "pre-welding positioning of ultra-narrow seams in automotive body aluminum alloy sheets" as the application scenario. Combining the three core technical solutions of this invention, namely "visual-assisted laser, seed point refinement, and cross-frame continuous transmission", it focuses on the positioning requirements of ultra-narrow seams, solves the problems of surface reflection and interference from minor scratches, and achieves seed point positioning accuracy of ±0.05mm and meter-level long-range continuous detection.
[0039] 1) Preparatory work ① Equipment calibration and collaborative deployment: The vision inspection module and the laser scanning module are integrated into the same detection device. The coordinate mapping calibration of the two is completed through a high-precision calibration board to ensure that the coordinate deviation meets the positioning accuracy requirements. A data synchronization link is configured to realize real-time interaction between laser scanning data and vision images, avoiding data delays from affecting positioning.
[0040] ② Key parameter pre-configuration: Based on the technical solution "classified adjustable parameter system", initialize the core parameters: laser selection invalid judgment standard (deviation from the stitching seam is considered invalid), spacing over-limit switching threshold (5 pixels), anchor point backtracking length (1000 pixels, matching the size of a single frame image), fine-tuning window size (10×50 pixels), and inter-frame overlap ratio (1 / 4), to adapt to the needs of ultra-narrow slit detection.
[0041] 2) Core Implementation Process ① Collaborative inspection and data synchronization: The vision inspection module is installed at the pre-welding positioning station, the laser scanning module prioritizes the global fast scan, and the vision inspection module receives the "joint coordinates - selection point validity" data of each area output by the laser in real time, focuses on the abnormal areas of laser selection, and forms a collaborative mode of "laser scan of the whole body - vision to supplement the local".
[0042] ② Dynamic switching trigger: When the laser detects that "the proportion of invalid selection points exceeds the standard" (such as misjudgment caused by reflection) or "the vertical distance between adjacent selection points is greater than 5 pixels" (sparse selection points), the system automatically switches to the vision detection module; there is no data interruption during the switching process, ensuring the continuity of positioning.
[0043] ③ Reference anchor point selection: The visual inspection module backtracks the historical data of the last 1000 pixels before the last effective laser point selection, constructs a 5×200 pixel analysis window with each laser point as the center, and calculates the point density; selects the center point of the window with the highest point density as the reference anchor point to ensure that the anchor point is minimally disturbed.
[0044] ④ Seed point pixel-level refinement: Construct a 10×50 pixel refinement area centered on the anchor point. Using the darkest column algorithm: First, select the column with the smallest average gray level in the area (candidate line of the stitching center), and then lock the pixel with the smallest gray level in that column as the initial seed point.
[0045] ⑤ Cross-frame transmission and laser switching back: A 1 / 4 frame overlap design is adopted, with the growth endpoint of the stitching seam in the previous frame serving as the initial seed point for the next frame to avoid re-initialization deviation; the laser scanning module operates redundantly, and when the dual conditions of "selection point spacing meets the standard + point density is qualified" are met consecutively, the laser scanning module is switched back to form a detection closed loop.
[0046] 3) Implementation Results ① Positioning accuracy meets standards: The positioning error of the seed point in the ultra-narrow slit is stable within ±0.05mm.
[0047] ② Enhanced anti-interference capability: It can effectively shield interference under conditions of surface reflection and scratches, and the seed point positioning accuracy is high.
[0048] ③ Adapt to production line efficiency: The laser and vision can be dynamically switched to match the detection rhythm with the needs of the production line; on-site debugging only requires adjustment of a few core parameters, without the need for large-scale sample labeling, making it highly adaptable.
[0049] Step 1: Laser-assisted vision-driven seed point location method combining maximum point density backtracking and darkest column selection (Scheme 2). In this embodiment, this step utilizes Scheme 2 to generate seam seed points.
[0050] Addressing the core pain points of long-range seam inspection in fields such as automotive and aerospace—namely, sparse point selection by single lasers, detection failure under complex conditions, lack of reliable initial seed points by single vision, and the absence of emergency point replenishment mechanisms in traditional collaborative methods that only allow unidirectional switching—this invention proposes a seam seed point localization scheme that prioritizes continuous visual tracking, supplemented by laser initiation anchoring and emergency point replenishment. This scheme integrates accelerated computation, global selection based on maximum point density, refinement of the darkest column, and seed point transfer between preceding and following images. Breaking away from the traditional fixed logic of "laser as the primary method, vision for blind spots," the scheme overcomes the challenges of positioning continuity, initial point reliability, and adaptation to extreme interference in sparse laser point selection scenarios through a closed-loop progressive logic of "laser initiation anchoring – continuous visual transfer – laser emergency point replenishment – continuous visual tracking." By leveraging accelerated computation (e.g., using Numba to accelerate Python or converting Python to C / C++), the computation speed of linear growth for a single visual frame is controlled below 100ms, achieving stable and accurate long-range seam localization. The solution proceeds systematically through four key stages: collaborative equipment deployment and workflow design, initial seed point anchoring and extraction, continuous cross-frame seed point transfer, and laser emergency point supplementation triggering. Figure 3 The specific plan is as follows: 1) Collaborative device deployment and workflow design To build a highly efficient linkage mechanism of "vision-driven continuous operation and laser-based on-demand start / stop for supplementary detection," the startup logic, control allocation rules, and emergency switching conditions for long-range detection are clarified. This lays a solid foundation for "continuous visual tracking - precise laser-based point supplementation." Priority is given to completing the equipment layout and workflow closed-loop design. The specific steps are as follows: Modular Equipment Layout: For long-range scenarios with sparse laser point selection, a modular solution integrating vision and laser is adopted, simultaneously constructing a linked workflow of "laser initiation and anchoring - emergency point supplementation - continuous visual tracking". Real-time data exchange between the two modules: The laser scanning module is activated throughout the entire process to ensure height information acquisition, only transmitting seed point information to the vision detection module in the initial stage and emergency scenarios; the vision detection module is in charge of point selection and seed point transmission throughout the process, optimizing algorithm efficiency through accelerated computation, strictly controlling the single-frame linear growth time to ≤100ms, adapting to the rhythm of long-range continuous detection.
[0051] ② Switching Trigger Logic Design: Upon startup, the laser scanning module prioritizes global scanning and outputs the coordinates of the first reliable seed point candidate to the vision detection module. The vision detection module then uses these coordinates to perform continuous point selection and seed point transfer. The system monitors the effectiveness of the visual seed point transfer in real time. When it determines that "the seed point growth is significantly insufficient or the growth unexpectedly branches off," it immediately triggers a laser emergency point supplementation command. After the laser outputs new reliable coordinates, the system automatically switches back to the vision-dominated mode, and the vision detection module continues the transfer based on the new coordinates, forming a flexible closed loop of "vision-dominated - laser point supplementation."
[0052] 2) Initial Seed Point Anchoring and Extraction Process To address the lack of reliable sources of initial seed points in sparse laser selection scenarios, this project leverages the equipment's characteristics of "synchronous laser and vision movement and faster laser processing speed." By combining laser scanning data with stacked visual images, pixel-level calibration is achieved through "collaborative screening and visual refinement," providing a high-precision starting point for continuous visual transmission. The specific process is as follows: ① Laser-Vision Collaborative Screening: The laser and vision modules move synchronously. The laser leverages its speed advantage to perform rapid scanning, outputting sparse selected point data in real time. The vision detection module simultaneously acquires images and temporarily stores and stacks them (no immediate parsing is required; several frames can be stacked). When initially transmitting seed points, an 8×300 rectangular local analysis region is uniformly constructed in the stacked image, centered on each laser selected point. The density of laser selected points within each region is calculated. The region with the highest point density (least affected by interference and with the most significant seam features) is selected, and its center point is used as the initial reference anchor point for visual positioning.
[0053] ② Darkest Column Algorithm Refinement Extraction: To correct the possible 0-3 pixel offset of the laser reference anchor point (caused by calibration deviation or environmental interference), a 12×60 rectangular refinement area (covering the offset range and low grayscale features of the stitching seam) is constructed in a single frame visual image with the anchor point as the center. The darkest column algorithm is adopted: first, the average grayscale of each column in the area is calculated, the column with the smallest average grayscale is selected (candidate line of stitching center), and then the pixel point with the smallest grayscale in the column is locked as the final initial seed point. The accuracy is ensured by double verification of "column-level screening-point-level positioning".
[0054] 3) Seed point continuous transmission process across frames To achieve long-range continuous positioning under vision-driven conditions and avoid efficiency loss due to frequent reliance on lasers, seed points are accurately transferred through correlation between consecutive image frames. Real-time performance is ensured by relying on accelerated computing. The specific process is as follows: ① Transmission Mechanism Design: In the vision-driven stage, seed points are transmitted using a "feature association between preceding and following frames - endpoint inheritance" method, without the need for laser intervention. By setting camera parameters, the subsequent frame maintains a 1 / 4 overlap with the preceding frame. After linear growth and curve fitting, the precise endpoint of the initial seed point in the preceding frame is extracted. This endpoint is located in the 3 / 4-1 height region of the preceding frame, which overlaps with the 0-1 / 4 height region of the following frame. Its x-coordinate will serve as a reference for selecting seed points in the following frame, and the reference point for the following frame is set at y=0.
[0055] ② Validity verification of transmission: Relying on a lightweight matching algorithm with accelerated computing, the transmitted seed point is double-matched: First, the deviation between the seed point and the fitted positioning line of the previous frame is calculated, which must be less than 2 pixels (default threshold); Second, the grayscale distribution of the 5×5 pixel area around the seed point is matched, which must meet the "dark center and bright sides" feature of the stitching seam; If the double matching is successful, the seed point is confirmed to be valid, and the linear growth of the subsequent frame is started.
[0056] 4) Laser emergency repair triggering and continuation process To address the issue of visual seed point transmission failure under extreme interference, an emergency seed point replacement mechanism is constructed based on the "vision-led - laser-supplemented" linkage framework to ensure uninterrupted positioning link. The specific process is as follows: ① Emergency Point Supplement Triggering Conditions: During visual transmission, the system monitors the effectiveness of seed point growth in real time. When it is determined that "seed point growth is obviously insufficient or growth unexpectedly branches off", the laser emergency point supplement command is triggered. The laser scanning module switches from standby to emergency working mode and starts local scanning (only covering the current failure area and a range of 500 pixels before and after it to avoid the time consumption of global scanning).
[0057] ② Point Selection and Visual Continuation: After the laser completes the local scan, the core logic of "maximum point density selection" is used: a 5×200 rectangular local analysis sub-region is constructed within the scanning range, the laser point selection density in each sub-region is calculated, and the sub-region with the highest point density (least affected by interference and with the strongest correlation of seam features) is selected, with its center point used as an emergency reference anchor point; after the visual inspection module receives the anchor point, it completes pixel-level refinement through the darkest column algorithm, obtains new effective seed points, restarts the cross-frame transmission process, and the laser scanning module returns to standby state.
[0058] Regarding the above-mentioned Scheme 2, this embodiment takes "long-distance pre-welding positioning of high-strength steel (Q690) for engineering machinery" as the application scenario. Combining the three core technical solutions of this invention, namely "laser-assisted vision-driven, seed point cross-frame transmission, and laser emergency point supplementation", it focuses on the detection needs of medium-narrow seams (0.15-0.3mm) where laser selection points are generally sparse, and solves the problems of rust spots, mechanical scratches, interference, and local reflection on the surface of high-strength steel, achieving a seed point positioning accuracy of ±0.05mm and long-distance uninterrupted continuous detection.
[0059] 1) Preparatory work ① Equipment Adaptation and Coordinate Calibration: The industrial vision inspection module adapted to the surface characteristics of high-strength steel and the laser triangulation module are integrated into the same long-range inspection device; the coordinate mapping calibration of the two is completed through a high-precision metal calibration plate to ensure that the deviation between the global (x,y) coordinates of the laser and the coordinates of the visual image meets the positioning accuracy requirements; a real-time data synchronization link is configured to avoid positioning connection delays during long-range movement.
[0060] ② Key parameter pre-configuration: Based on the technical solution's "classified adjustable parameter system", initialize the core parameters: seed point search rectangle width and height (adapting to the reference point x-coordinate ±5 pixel offset range), laser point density analysis window size (8×300 pixels), seed point refinement window size (12×60 pixels), inter-frame overlap ratio (1 / 4), seed point transmission deviation threshold, and laser emergency point supplementation local scanning range; configure the acceleration environment to control the computation time of the visual single-frame linear growth algorithm within a reasonable range that adapts to the pipeline rhythm.
[0061] ③ Lightweight preprocessing settings: Only grayscale conversion is performed on the original high-strength steel seam image to remove redundant color information and retain the grayscale feature differences between the seam and surface interference; operations that easily damage the fine edges of the seam are abandoned, providing a data foundation for subsequent selection of the darkest column and threshold verification.
[0062] 2) Core Implementation Process ① Initial Anchoring and Seed Point Refinement: The detection device moves at a constant speed along the seam extension direction. The laser scanning module prioritizes global fast scanning and outputs full-range sparse selected point data. The visual inspection module simultaneously acquires images and temporarily stores and stacks them. An 8×300 pixel analysis window is constructed with each laser selected point as the center. The point density is calculated, and the center point of the window with the highest density is selected as the initial reference anchor point. A 12×60 pixel refinement area is constructed with the anchor point as the center. The darkest column and the darkest pixel within the column are selected as the initial seed point through the darkest column algorithm to correct the laser anchor point offset.
[0063] ② Seed point continuous transmission across frames: After the visual detection module takes the lead in localization, the seed points are transmitted according to the "feature association between the previous and subsequent frames - endpoint inheritance" mechanism: the camera parameters are set to make the subsequent frame overlap with the previous frame by 1 / 4 area. After linear growth and curve fitting, the x-coordinate of the end endpoint of the seed point in the previous frame is extracted as a reference for the seed point at y=0 in the subsequent frame. The lightweight matching algorithm selects the point that best matches the gray-scale distribution around the end endpoint of the previous frame with the gray-scale distribution around the initial seed point of the subsequent frame, and uses it as the final initial seed point of the frame. After the target is met, the linear growth of the subsequent frame is started.
[0064] ③Laser emergency patching trigger: The system monitors the effectiveness of seed point growth in real time. When “seed point growth is insufficient” or “growth branch deviation” occurs, the laser emergency patching command is triggered. The laser scanning module switches from standby mode to emergency mode and performs local scanning only on the currently failed area and its surrounding area.
[0065] ④ Supplementing Points and Closing-Loop Recovery: After the laser local scanning is completed, the "maximum point density screening" logic is used to construct a local analysis sub-region within the scanning range, and the center point of the sub-region with the highest density is selected as the emergency reference anchor point; after the visual inspection module receives the anchor point, it refines and obtains new seed points through the darkest column algorithm, restarts the cross-frame transmission process, and the laser scanning module returns to the standby state.
[0066] 3) Implementation Results ① Positioning accuracy meets the standard: The positioning error of the seed point in the narrow seam of high-strength steel is stable within ±0.05mm, which meets the initial positioning accuracy requirements for welding high-strength steel in engineering machinery.
[0067] ② Enhanced anti-interference capability: It can effectively shield surface rust spots, mechanical scratches and local reflection interference, and the seed point positioning stability is high, with no positioning interruption caused by interference.
[0068] ③ Long-term continuity and reliability: Enables one-time detection of long-distance joints of high-strength steel with "no splicing and no gaps", timely laser emergency repair response, and uninterrupted positioning link.
[0069] ④ Balance between efficiency and adaptability: The visual inspection rhythm matches the pipeline requirements; on-site debugging only requires fine-tuning of core parameters to adapt to different width seams, without the need for large-scale sample annotation, and can be adapted to different grades of high-strength steel scenarios.
[0070] Step 2: Full-coverage dense growth-dominated approach, combined with customized window adaptive threshold, directional continuity constraints, and breakpoint loop tracing method for seam selection. Addressing the core pain points in weld inspection in precision manufacturing fields such as automotive and aerospace—namely, growth susceptible to bifurcation interference, feature failure due to uneven illumination and complex interference, and difficulty in achieving weld discontinuity—this invention proposes a multi-constraint collaborative linear growth scheme. This scheme uses directional continuity constraints as the core for correction, customized window adaptive thresholds as the basis for feature extraction, and cyclical breakpoint tracking as a guarantee of integrity. The scheme abandons traditional general image processing logic, employing a progressive logic of "basic preparation - feature extraction - directional correction - breakpoint repair" to fundamentally solve problems such as point selection misalignment, feature loss, and structural fracture, providing high-precision point set support for laser weld tracking and welding torch path planning. The scheme proceeds systematically through four stages: preliminary basic preparation, customized window adaptive threshold processing, directional continuity constraint control, and cyclical breakpoint tracking and repair. Figure 4 The specific plan is as follows: 1) Preliminary Basic Preparation Process To establish a standardized linear growth data foundation and parameter system, clarify core data links and preprocessing specifications, and ensure the efficient implementation of subsequent multi-constraint logic and reduce scenario adaptation costs, it is necessary to complete the basic preparatory work first. The specific steps are as follows: ① Core data input and coordinate calibration: The global (x,y) coordinates of the seed point are obtained through laser triangulation technology. After transformation and precise mapping, the coordinates are transmitted to the visual inspection module. Based on the transformed coordinates, the visual inspection module locks the initial position of the seed point in its own image (which may deviate from 0-3 pixels), providing a precise starting point for subsequent growth.
[0071] ② Categorized Adjustable Parameter System Configuration: Initialize core parameters according to functional modules, covering seed point selection parameters, window size parameters, threshold calculation parameters, linear growth parameters, directional continuity constraint parameters, breakpoint search and connection parameters, curve fitting parameters, etc.; Based on multi-scenario adaptation verification, only the seed point selection parameters (i.e., the width and height of the search rectangle of the darkest column algorithm) need to be adjusted according to the deviation of the (x,y) coordinates given by the laser scan. The remaining parameters can be adapted to most weld inspection scenarios through adaptive logic or generalized design, which greatly reduces the complexity of on-site debugging.
[0072] ③ Lightweight preprocessing optimization: Lightweight preprocessing operations are performed on the original weld seam image; only the grayscale conversion step is retained, and redundant color information is removed; the linear growth method has already obtained seed points for subsequent high-precision growth, so there is no need to sacrifice accuracy (such as loss of edge details) by performing preprocessing operations such as Gaussian blurring and filtering on the image to resist interference. This lays a solid data foundation for accurate threshold calculation and effective point selection.
[0073] 2) Customized window adaptive threshold processing flow To address the issue of weld feature extraction failure caused by uneven illumination, a precise pixel selection criterion is first constructed using local dynamic thresholding. Then, continuous feature extraction is achieved through directional breadth-first growth, forming a closed-loop mechanism of "criterion construction - rule configuration - ordered growth." The specific process is as follows: ① Customized Local Window Construction Guided by Bimodal Inter-class Variance: A local analysis window with adjustable dimensions is created centered on the current growth point of the breadth-first growth queue (typical sizes such as 7×7 and 11×11 pixels are designed according to the seam width). The window scale is designed to promote a bimodal distribution of pixel grayscale within the region. This distribution characteristic maximizes the inter-class discrimination performance of the Otsu algorithm and ensures complete coverage of the feature difference areas between the weld and the background. The window is updated synchronously as the growth point moves, accurately isolating interference outside the seam perimeter, providing a dedicated analysis range for each pixel to be judged, and isolating the influence of background noise and uneven illumination, thus laying a solid foundation for the accurate generation of subsequent local dynamic thresholds.
[0074] ② Local Dynamic Threshold Calculation: The seams and surrounding environment typically exhibit a bimodal grayscale distribution within the local analysis window. Based on this distribution, the maximum inter-class variance (Otsu's algorithm) is calculated for the window. By iterating through all grayscale values and locking the grayscale value corresponding to the maximum inter-class variance, an adaptive basic segmentation threshold is automatically generated. This process does not rely on global image statistical features and can specifically offset grayscale shifts caused by local reflections and shadows, ensuring accurate adaptation of the threshold to the local scene.
[0075] ③ Breadth-first growth rule configuration: After the seed point is verified by the threshold, the rule configuration is started to support orderly growth; the precise initial seed point of the previous refinement is included in the growth queue and the first-in-first-out (FIFO) storage rule is adopted; the eight-neighbor traversal mode is configured and the directional priority is clarified. The vertical direction (along the main extension direction of the weld) is the first priority, followed by the horizontal direction, and finally the diagonal direction. The directional guidance ensures that the growth fits the linear characteristics of the weld and avoids the risk of deviation.
[0076] ④ Threshold-driven active dense growth execution: Weld feature extraction is initiated according to the breadth-first rule. The growth point is taken from the head of the queue as the core node, and the eight neighboring pixels are traversed according to the directional priority in step ③. The grayscale of each pixel is checked to see if it meets the local dynamic threshold in step ②. Those that meet the threshold are marked as valid growth points and added to the queue. The "point selection-traversal-verification-enqueue" closed loop is executed in a loop until there are no new points to expand, so as to achieve continuous and accurate extraction of weld features.
[0077] 3) Directional continuity constraint control process To avoid bifurcation interference and point selection offset in linear growth, real-time correction of the growth direction is achieved by fitting historical point trends. The specific process is as follows: ① Dynamic Trend Modeling: A fixed-size historical growth point window (containing 50 latest growth points by default) is constructed and dynamically updated using "new points added to the queue, and points removed from the queue when capacity is exceeded," always retaining core data reflecting the real-time direction of the weld. Modeling is initiated only when the window accumulates at least 20 valid points. Before modeling, historical points are sorted by y-coordinate, and linear fitting is performed using the least squares method to establish a mathematical model describing the weld direction. An anomaly handling mechanism is also included to maximize fitting accuracy while ensuring algorithm stability in order to capture the inherent directional patterns of the weld.
[0078] ② Real-time point verification: A two-stage screening process of "early filtering - precise verification" is adopted. After new points are filtered for obviously abnormal pixels using a darkness threshold, orientation constraint verification is initiated to reduce invalid calculations. Based on the y-coordinate of the new point, the trend model is called to calculate the expected x-coordinate. The absolute deviation between the actual and expected x-coordinates is compared. If it is less than a preset threshold (default 2 pixels), it is considered valid. This combination of proactive prediction and deviation verification rejects off-target points at the source, which is more targeted than passive noise filtering and effectively avoids bifurcation and offset.
[0079] ③ Adaptive constraint adjustment: When there are fewer than 20 points, there are no constraints, and samples are accumulated freely; when there are 20 but less than 50 points (the window is not full), linear modeling is started with all existing growth points, and constraints are introduced as early as possible; after the window is full of 50 points, the data is dynamically updated and the model is reconstructed according to "adding new points and dequeuing overcapacity" to adapt to changes in seam direction and balance the ability to resist bifurcation and the adaptability to bending.
[0080] Steps 2)-3) above involve using the seed point corresponding to the initial position of the seed point as the starting growth point and performing dense growth according to the vertical priority eight-neighbor breadth-first growth rule. After growth is completed, a breadth-first growth queue containing only valid growth points is obtained. The specific steps include the following: 1) Initialize and create an empty breadth-first growth queue. Starting from the initial growth point, add the global seed point to the breadth-first growth queue. The breadth-first growth queue uses the first-in-first-out storage rule. 2) Select the current growth point from the head of the breadth-first growth queue, and construct a local analysis window centered on the current growth point; 3) Considering that the seam and the surrounding environment present a bimodal gray-scale distribution in the local analysis window, the local dynamic threshold is calculated for the local analysis window based on the bimodal gray-scale distribution using the Otsu algorithm; 4) The current growth point traverses its eight neighboring pixels according to the vertical priority rule, and checks whether the grayscale of each pixel meets the local dynamic threshold. If yes, proceed to step 5); otherwise, discard it. 5) Determine if the current growth point passes the darkness check. If yes, proceed to step 6). If no, discard it. 6) Determine whether the current growth point passes the directional continuity constraint check. If yes, it is determined to be a valid growth point, marked as visited, and re-included in the breadth-first growth queue, placed at its tail. If not, it is discarded. 7) Repeat steps 2)-6) until the traversal is complete, and obtain the final breadth-first growth queue containing only valid growth points.
[0081] 4) Breakpoint loop tracing and repair process To automatically identify and connect fractured sections of the weld, a continuous weld structure is achieved through iterative iteration. The specific process is as follows: ① Breakpoint-oriented search and candidate selection: Based on the existing splice point distribution, the top and bottom endpoints of the splice are extracted, and a directional rectangular pixel-oriented search area (such as a 3×50 rectangular search area) is created along the extension direction of the endpoints. By analyzing the column grayscale features within the area, the darkest column and the darkest unvisited point in it are selected as candidate breakpoints that meet the characteristics of the weld dark area, thereby improving the targeting and efficiency of the search.
[0082] ② Breakpoint feature verification and constrained growth: A local analysis window is constructed with candidate breakpoints as the center. The adaptive local dynamic threshold is calculated using the Otsu algorithm to verify the matching between candidate points and the dark area features of the weld. For breakpoints that pass the verification, they are included in the directional history record and eight-directional breadth-first growth is started. Valid points are selected through multiple constraints such as visited status, darkness, and directional continuity to ensure that the new growth segment is consistent with the original weld direction.
[0083] ③ Iterative loop and dynamic update: The iterative closed loop is built around the core of "search-verification-growth". After each iteration, it is checked whether new weld points have been added. If new points are found, the process is repeated to search for new breakpoints and then grow. If no new points are found or the iteration limit is reached (usually the iteration limit is set to 5 times), the process is terminated. The direction history and the set of visited points are updated in real time during the process. The complete connection of complex fracture structures is achieved through multiple iterations.
[0084] For this step, this embodiment takes "long-range pre-welding inspection of SiC / Al composite material seams in aerospace applications" as the application scenario. Combining the three core technologies of this invention, namely "full-coverage dense growth point selection, directional continuity constraint, and breakpoint cyclic tracking and repair", it focuses on the inspection requirements of meter-level SiC / Al composite material seams (width fluctuation 0.05-0.2mm), solves the problems of uneven lighting, intersecting scratches and interference from black fine lines, avoids seam feature distortion and positioning breakpoints, and achieves long-range high-precision continuous point selection.
[0085] 1) Preparatory work ① Equipment Adaptation and Coordinate Calibration: The vision inspection module adapted to the characteristics of SiC / Al composite materials and the laser triangulation measurement module are integrated into the long-range detection device. The coordinate mapping between the two is completed through high-precision calibration to ensure that the global coordinates of the seed point transmitted by the laser can be accurately mapped to the visual image, avoiding the influence of coordinate deviation on the growth starting point.
[0086] ② Key parameter pre-configuration basis: "Classified adjustable parameter system", initialize core parameters, seed point search rectangle width and height (adapting to 0.05-0.2mm seam), 7×7 pixel local analysis window (guided by dual isopeak distribution), 50-point dynamic history window, 3×50 pixel breakpoint search area and 5 breakpoint repair iterations upper limit; only the seed point search parameters need to be adjusted to adapt to the seam width, and the other parameters are adapted to the scene through adaptive logic.
[0087] ③ Lightweight preprocessing: Only grayscale operation is performed on the original stitched image to remove redundant color information and retain the grayscale feature differences between the stitch and the interference (scratches, thin black lines); operations such as Gaussian blur and filtering that may destroy the subtle features of the stitch are discarded, laying a solid data foundation for subsequent threshold calculation.
[0088] 2) Core Implementation Process ① Data Integration and Dense Growth: The laser scanning module is activated to obtain the global coordinates of the seed point through triangulation. The coordinates are then transferred to the visual detection module via coordinate mapping to lock the initial position of the seed point in the image. Starting from this seed point, dense growth is initiated according to the "vertical priority" eight-neighborhood breadth-first growth rule. First, a 7×7 pixel local window is constructed with the current growth point as the center. A dynamic threshold is generated through the Otsu algorithm (to compensate for uneven illumination). Then, pixels that meet the threshold are marked as valid growth points and included in the queue.
[0089] ② Directional continuity constraint verification: Construct a 50-point dynamic historical window (updated by "adding new points and removing points from the queue"). When the number of valid points in the window is ≥20, the least squares method is used to fit the direction of the seam. New candidate growth points must meet the requirement that "the deviation between the actual x-coordinate and the predicted value is ≤2 pixels". Otherwise, they are judged as interference points and removed to shield the influence of scratches and black lines from the source.
[0090] ③ Breakpoint Loop Tracking and Repair: Extract the top and bottom endpoints of the seam, construct a 3×50 pixel directional search area along the extension direction, and select the darkest column as candidate breakpoints; after verifying that the candidate breakpoints meet the seam characteristics through local thresholding, start constrained growth to connect the original seam; iterate this process 5 times or until no new breakpoints are generated to ensure that there is no structural break in the long-distance seam.
[0091] 3) Implementation Results ① Successful anti-interference and feature fidelity: It shields intersecting scratches and black fine lines, and ensures that the subtle features of the seams are not distorted, effectively avoiding positioning deviations caused by preprocessing operations.
[0092] ② Long-distance continuity meets the standard: Achieve meter-level SiC / Al composite material splices without positioning breaks, with positioning lines conforming to the actual splice direction, meeting the continuity requirements of long-distance aerospace testing.
[0093] Step 3: High-precision calibration is the primary method, combined with the fitting of the seam center positioning line using the median darkest point screening and composite iterative trimming method. In precision manufacturing fields such as automotive and aerospace, the positioning accuracy, anti-interference capability, long-range continuity, and adaptation efficiency of pre-weld seam inspection directly determine welding quality. Current technologies, however, face bottlenecks in four key areas: ultra-narrow seam positioning, complex interference resistance, meter-level long-range inspection, and multi-scenario adaptation. In particular, issues such as noise-prone growth point selection, distortion with traditional single-fitting methods, and persistent interference from outliers significantly impact accuracy. To address this, this invention proposes a composite iterative trimming technique centered on precise intra-row point selection through a combination of median position constraints and grayscale essence recognition. This technique integrates third-order initial fitting, second-order iterative reduction, and dynamic threshold filtering to filter out noise and outliers at their source, overcoming the challenge of balancing smoothness and accuracy in positioning lines. Furthermore, it adapts to multiple scenarios through parametric design. The solution progresses through three main stages: pre-data regularization, intra-row feature optimization and screening, and composite iterative trimming fitting and result output. This provides reliable support for high-precision seam positioning and facilitates upgrades in welding quality control. Figure 5 The specific plan is as follows: 1) Pre-process data organization To build an orderly data foundation and ensure the consistency of subsequent row-by-row median darkest point selection, core preprocessing is required for the raw weld point data obtained by linear growth. The specific steps are as follows: ① Row-based sorting and classification: The discrete weld point data output by the growth algorithm is directly sorted in order according to the vertical coordinate corresponding to the weld extension direction, so that the candidate points under the same vertical coordinate are grouped together to form a row-based point set structure, which lays the foundation for accurately extracting the darkest point near the median row by row.
[0094] 2) Optimized screening process for the darkest feature in the row median To accurately pinpoint the actual seam location in each row, the system integrates both positional trends and grayscale characteristics. It optimizes in-row point selection through a progressive logic of "median constraint - darkest filtering - fault-tolerant completion," reducing noise interference at the source. The specific steps are as follows: ①Median position constraint: For each candidate point in the row set, calculate its median x-coordinate, define a reasonable constraint range, retain only points within the threshold distance of the median, and filter out discrete noise points that deviate significantly from the stitching trend.
[0095] ② Darkest feature matching: Among the valid points that meet the median position constraint, the "darkest point" with the smallest gray value is selected as the representative point of the row, which closely matches the optical characteristics of the seam area and ensures that the selected point accurately fits the real seam center.
[0096] ③ Fault-tolerant completion mechanism: If a row does not have a valid point that simultaneously satisfies the median constraint and the darkest feature, the median of the selected points in that row, sorted by the horizontal coordinate, is directly used as the representative point to avoid fitting discontinuities caused by missing local features and to ensure the continuity of the point set.
[0097] 3) Composite Iterative Trimming Fitting and Result Output Process To further eliminate residual anomalies and generate seam positioning lines that combine accuracy, smoothness, and industrial adaptability, a closed-loop logic of "fitting-trimming-verification-output" is used to optimize the entire process. The specific steps are as follows: ① Preliminary fitting and deviation filtering: A third-order polynomial is used to perform preliminary fitting on the median darkest representative point after row-by-row screening to fit the general outline of the seam; the deviation value of each representative point from the fitted curve is calculated, and convex points or discrete points with excessive deviation are filtered out based on the preset threshold, laying a solid quantitative foundation for subsequent accurate edge trimming.
[0098] ② Dynamic composite iterative trimming: A composite iterative mechanism is introduced, which switches to second-order polynomial fitting during the iteration process to reduce curve complexity and enhance smoothness; at the same time, a dynamic threshold filtering mechanism is set up, which is calculated according to "iteration deviation threshold = mean deviation + (initial threshold factor - iteration number × decreasing factor) × standard deviation". The initial threshold factor is 0.8 by default and decreases by 0.2 with each iteration. The filtering strictness is dynamically adjusted by using statistical characteristics to continuously remove outliers with deviations exceeding the limit and achieve precise trimming.
[0099] ③ Iteration Termination Control: A multi-condition termination strategy is adopted. When any of the following conditions are met, the iteration is terminated: "the maximum number of preset iterations is reached (default ≤ 3 times to avoid negative coefficients), the number of effective points is ≤ 20 (the point set is too small and continuing to fit is meaningless), or no new points are filtered in a single iteration (the curve has become stable)". This balances fitting accuracy and computational efficiency and avoids feature loss caused by excessive trimming.
[0100] ④ Result verification and standardized output: Verification is performed from two dimensions: curve smoothness and point set fit, to ensure that the positioning line has no obvious inflection points, fits the actual direction of the joint, and the fitting error meets industrial requirements; finally, a standardized joint center positioning line is output to provide a high-precision reference for welding robot tracking and welding torch posture adjustment.
[0101] In summary, addressing the stringent requirements of pre-weld seam inspection in the automotive, aerospace, military, and shipbuilding industries for positioning accuracy, anti-interference capability, long-range continuity, inspection efficiency, and industrial adaptability, this invention aims to overcome four core bottlenecks in existing technologies: insufficient positioning accuracy in ultra-narrow seams, weak resistance to complex interference, difficulty in achieving meter-level long-range single-pass inspection, and poor algorithm efficiency and generalization adaptability. It proposes three collaborative technical solutions: dual-mode laser-vision dynamic fusion positioning, full-coverage dense growth point selection, and high-precision iterative calibration fitting. Through adjustable parameter design, it adapts to various seam scenarios with different materials and widths. The core objectives are as follows: ① Overcoming the bottleneck of positioning accuracy in ultra-narrow slits and sparse slits: A deep fusion architecture with dual modes of "vision-assisted laser and laser-assisted vision" that can be switched on demand is adopted. The vision-assisted laser scene relies on historical laser data to backtrack and select highly reliable reference anchor points, while the laser-assisted vision scene combines stacked images and sparse laser data to globally select anchor points. Both types of scenes are equipped with the darkest column selection algorithm to achieve pixel-level refinement, which makes up for the defects of single technology in detecting ultra-narrow slits (<0.1mm) in terms of scattered sparse points and selection deviation. The seed point positioning error is stably controlled within ±1 pixel (±0.05mm), laying a solid foundation for subsequent high-precision fitting.
[0102] ② Overcoming the shortcomings of complex interference and lighting adaptation: Relying on a customized window adaptive threshold algorithm, the effects of reflection and uneven lighting are dynamically offset; the innovative direction continuity constraint logic (least square method fitting historical growth points to predict the trend) actively shields interference such as bifurcation, scratches, and thin black lines; a new dual emergency check for "insufficient growth - bifurcation deviation" in laser-assisted vision scenes is added to identify extreme interference in real time; the entire process abandons traditional morphological operations such as corrosion / expansion, and significantly improves the accuracy of point selection under complex working conditions while ensuring that the subtle features of the splicing seam are not distorted.
[0103] ③ Achieve meter-level long-range continuous detection in one go: Through the "dual closed-loop - 1 / 4 frame overlap transmission" mechanism, the vision-assisted laser scene adopts a "laser parameter scanning - visual interpolation - laser restart" dual-trigger dual-switch closed loop, and the laser-assisted vision scene adopts a "laser initiation anchoring - visual continuous transmission - laser emergency point supplementation" closed loop (only local scanning is performed during laser emergency, without the need for global time-consuming operations); combined with breakpoint loop tracking technology to automatically repair splicing seams, the problem of feature discontinuity and switching error in long-range detection is completely solved, achieving meter-level long-range one-time positioning with "no splicing and no gaps", which is suitable for the rhythm of industrial production lines.
[0104] ④ Optimize fitting accuracy, detection efficiency, and multi-scene adaptability: Employ a dual-criteria selection method of "median position constraint - minimum grayscale feature" and a composite trimming logic of "third-order initial fitting - second-order iterative reduction" (maximum 3 iterations) to efficiently filter out noise and avoid over-computation; retain only lightweight grayscale preprocessing and eliminate redundant operations; introduce accelerated computing technology (such as Numba acceleration) to strictly control the visual single-frame detection time of laser-assisted vision scenes to ≤100ms; through the adjustable design of core parameters such as anchor point backtracking length and seed point search rectangle width and height, it can adapt to different materials and different widths (0.05-0.4mm) of seams without large-scale sample annotation, avoiding the defects of weak generalization and high cost of deep learning, and achieving the optimal balance between accuracy, efficiency, and adaptability.
[0105] For this step, this embodiment takes "pre-welding fitting of narrow seams in thick ship plates" as the application scenario. Combining the three core technical solutions of this invention, namely "in-line dual-criteria screening, composite iterative trimming fitting, and multi-material adaptation parameter design", it focuses on the pre-welding positioning line fitting requirements of thick ship plate seams (0.05-0.4mm), solves the problem of growth point discrete noise interference, takes into account the smoothness and fit of the positioning line, and achieves multi-material scenario adaptation such as carbon steel and alloy steel.
[0106] 1) Preparatory work ① Equipment Adaptation and Coordinate Calibration: An industrial camera (1280×1024 resolution) adapted to the surface characteristics of ship thick plates (carbon steel, alloy steel) is integrated into the pre-welding inspection device for thick plates; the coordinate calibration of the vision inspection module is completed through a high-precision calibration plate to ensure that the acquisition deviation of discrete growth point (x,y) coordinates meets the fitting accuracy requirements of thick plate joints; the camera exposure parameters are adjusted synchronously to avoid grayscale deviation caused by the oxide layer on the surface of the thick plate from affecting feature recognition and to ensure the effectiveness of data acquisition.
[0107] ② Classification key parameter pre-configuration: Based on the technical solution "multi-material adaptation parameter system", initialize the core parameters: median threshold for in-row filtering (set to 3 pixels), polynomial order of composite iteration (third-order initial fitting, second-order iteration), dynamic threshold calculation coefficients (initial threshold factor 0.8, decreasing factor 0.2), maximum number of iterations (3 times), effective point termination threshold (20).
[0108] 2) Core Implementation Process ① Data regularization and in-row dual-criteria screening: First, the discrete growth points are sorted according to the vertical coordinate (y-axis) of the seam extension direction. Candidate points under the same vertical coordinate are classified into in-row point sets to form a regular data structure distributed by row. Then, dual-criteria screening is performed: First, the median of the horizontal coordinate of each row of candidate points is calculated, and points ≤3 pixels away from the median are retained to filter out discrete noise points that deviate from the seam trend. Second, the "darkest point" with the smallest gray value is selected from the valid points as the representative point of the row (which matches the low gray value characteristics of thick plate seams). If there are no valid points in a row, the median of the selected points in that row is used to fill in the gaps, ensuring the continuity of the point set.
[0109] ② Composite Iterative Trimming and Fitting: The composite iterative process begins with the following steps: First, a third-order polynomial is used to initially fit the representative points selected within the row, outlining the general contour of the seam. The deviation value of each representative point from the fitted curve is calculated, and large deviation anomalies exceeding the limit are filtered out. Second, the process switches to second-order polynomial iteration, and the filtering threshold for each iteration is calculated according to "dynamic threshold = mean deviation + (0.8 - iteration number × 0.2) × standard deviation". This continuously removes residual noise points exceeding the limit and improves the smoothness of the fitted curve. During the iteration process, the effective point set is updated in real time to ensure that the curve fits the actual seam direction.
[0110] ③ The termination judgment and standardized output adopt a multi-condition termination strategy: the iteration is terminated when any of the following conditions are met: "the maximum number of iterations is reached 3", "the number of effective points is ≤20 (the point set size is too small and it is meaningless to continue fitting)", or "no new points are filtered in a single iteration (the curve has stabilized)". Finally, the fitting effect is checked from "no obvious inflection point of the curve" and "point set fit". After confirming that it is qualified, the standardized splice center positioning line is output to provide path reference for the ship thick plate welding robot.
[0111] 3) Implementation Results ① Noise filtering and fitting accuracy meet the standards: Discrete noise is effectively filtered out, the fitted positioning line has no obvious inflection point, and it fits the actual direction of the thick plate joint of the ship. The average deviation from the representative point to the positioning line is <0.05mm, which meets the dual requirements of smoothness and accuracy of the positioning line for thick plate welding.
[0112] ② Excellent multi-material adaptability: Without adjusting the core algorithm logic, it can adapt to the splicing scenarios of carbon steel and alloy steel ship thick plates by only fine-tuning the grayscale judgment deviation parameters, avoiding fitting failure caused by material differences. Its adaptability is better than traditional single-material dedicated solutions.
[0113] ③ Industrial efficiency and cost advantages: No need for large-scale collection of multi-material samples for model training; on-site debugging only requires fine-tuning 1-2 parameters, greatly reducing labor and time costs; the entire fitting process takes an average of <200ms, matching the pre-welding preparation rhythm of ship thick plate welding production lines, without additional time occupation.
[0114] The innovation of the method proposed in this embodiment is reflected in: 1) Dynamic switching and reference reuse mechanism for laser-vision depth collaboration ① By employing a dual-mode closed-loop architecture, we overcome the limitations of traditional collaboration and adapt to harsh working conditions in multiple scenarios: Breaking away from the traditional single-mode "laser-based, vision-filled" collaborative logic, we construct a dual-mode closed-loop architecture of "vision-assisted laser" and "laser-assisted vision." For scenarios where laser selection fails in ultra-narrow slits, we adopt a closed loop of "laser global scanning - vision local filling - laser restart," designing dual switching trigger logic of "invalid selection judgment - selection spacing exceeding limits" and dual switching back conditions of "adjacent spacing meeting standards - point density meeting requirements." For scenarios where laser selection is generally sparse, we adopt a closed loop of "laser initiation and anchoring - continuous vision transmission - laser emergency filling - vision continuation," designing dual emergency trigger conditions of "insufficient growth - branching deviation." The dual architectures respectively adapt to the two core working conditions of "local laser failure" and "overall laser sparseness," solving the problems of traditional collaboration's only unidirectional switching and poor scenario adaptability.
[0115] ② By employing a scenario-based dual-stage positioning solution, the challenge of seed point anchoring under different working conditions is overcome: An innovative "scenario-based laser-visual collaborative positioning" strategy is adopted. In vision-assisted laser-dominated scenarios, historical laser scanning data is used as the data source to retrospectively lock reliable intervals, and the highest density area is selected as the reference anchor point through local point density calculation. In laser-assisted vision-dominated scenarios, relying on the synchronous movement characteristics of laser and vision, combined with the sparse data from rapid laser scanning and visual stacked images (stacked frames of temporary images), a local analysis region is constructed globally to select the anchor point with the highest point density. For both scenarios, the darkest column algorithm (column-level average grayscale filtering + point-level minimum grayscale locking) is subsequently used to correct 0-3 pixel offsets, forming a dual-stage process of "anchor point filtering - pixel refinement," solving the common problems of unreliable traditional seed point anchoring and positioning offset.
[0116] ③ By unifying the cross-frame transmission mechanism and differentiating reuse logic, the challenges of breakpoints and offsets in long-range detection are solved: Relying on the unified image acquisition design of "1 / 4 frame overlap", the universality of seed point transmission across frames is achieved. In vision-assisted laser-dominated scenarios, the endpoints of the previous frame after growth optimization are directly used as the initial seed points of the next frame; in laser-assisted vision-dominated scenarios, the x-coordinate of the endpoint of the previous frame is used as the reference point at y=0 in the next frame, and the seed points of the next frame are determined by combining grayscale and deviation dual verification. At the same time, a differentiating seed point reuse logic is designed: the former reuses the anchor point base of the reliable laser area, and the latter reuses the coordinate reference of laser initial anchoring and emergency point supplementation. Neither of these requires re-initialization of seed points, which not only ensures the reuse of the advantages of laser positioning, but also solves the problems of easy offset of seed points and easy breakpoints in stitching in long-range detection, achieving seamless continuous positioning.
[0117] ④ By integrating seed point-driven dynamic ROI with accelerated computing, the traditional bottlenecks in anti-interference and efficiency are overcome: Overcoming the limitations of traditional ROI broad selection or reliance on annotation, both dominant scenarios rely on precise seed points selected by laser and refined by vision, combined with directional continuity constraints to delineate dynamic ROIs, focusing on the core area of the stitching seam, and efficiently eliminating interference such as background noise and scratches; at the same time, for the visual continuous computing needs of laser-assisted vision-dominated scenarios, acceleration technologies (such as Numba acceleration of Python, Python to C / C++) are introduced to control the time for linear growth of a single visual frame to ≤100ms, which not only solves the problems of weak anti-interference and poor adaptability of traditional solutions, but also avoids the shortcomings of low efficiency in visual continuous computing, achieving a dual improvement in anti-interference and computing efficiency.
[0118] 2) Active and dense growth splicing point selection technology system ① By using dual-peak-guided adaptive thresholding and lightweight preprocessing, we can adapt to uneven lighting scenarios and avoid the defects of traditional preprocessing: Based on the pixel distribution patterns of the stitching seams and the environment, we propose a customized window adaptive thresholding strategy with dual-peak guidance. We dynamically construct customized n×n local windows with the growth point as the center, calculate the local maximum inter-class variance to generate a specific threshold, and adapt to uneven lighting and reflective scenarios. Combined with lightweight preprocessing that only retains grayscale, we avoid the accuracy loss and efficiency waste of traditional multi-step preprocessing.
[0119] ② By constraining directional continuity and predicting dynamic trends, the traditional passive interference removal mode is broken through and the accuracy of point selection is improved: The anti-interference logic of dynamic trend prediction is innovated, abandoning the passive method of traditional morphological opening operation that relies on erosion / dilation to remove burrs. By constructing a 50-point dynamic historical window, linear fitting is performed on the growth points to capture the splice direction, and the reasonable range of subsequent point selection is actively predicted, shielding interference points such as bifurcation and scratches that deviate from the trend from the source; this avoids the distortion of splice edge shrinkage or expansion caused by corrosion, and eliminates the need for traversal calculation of structural elements, thus improving the targeting of anti-interference and the accuracy of point selection.
[0120] ③ By employing a closed-loop approach with breakpoint tracing, this method overcomes the limitations of traditional gap-filling techniques and achieves precise gap repair: It breaks through the limitations of traditional morphological closure operations that rely on structuring elements to fill gaps, and innovates a closed-loop gap-filling scheme of "directional search - feature verification - iterative growth." A search region is constructed directionally along the gap endpoints. Candidate breakpoints are selected using the darkest column features. After verifying and matching the gap characteristics through local thresholding, constrained growth is initiated to connect the original gaps. This process iterates until no new breakpoints are found, achieving precise gap filling while avoiding invalid bridging, reducing algorithm complexity, and balancing continuity and computational efficiency.
[0121] 3) A composite iterative edge trimming and fitting method based on dense growth ① By using densely packed points to support ordered in-row classification, the limitations of traditional sparse point selection are overcome and the consistency of the fitting is ensured: Relying on sufficient in-row points obtained through active dense growth, the data limitations of traditional sparse point selection are overcome. The discrete points are first ordered and classified according to the vertical coordinate, forming a regular point set structure distributed by rows. This provides sufficient data support for subsequent accurate point selection and ensures the consistency of the point selection process, avoiding fitting gaps caused by missing local features.
[0122] ② A dual-criteria screening mechanism filters out discrete noise while meeting the precise positioning requirements of ultra-narrow seams: A reasonable range is defined by constraining the median position, and the median of the x-coordinate of each row of candidate points is calculated. Only points within a threshold distance of this median are retained, filtering out discrete noise points that significantly deviate from the overall seam trend. Furthermore, based on the optical characteristics of the seam area, the "darkest point" with the smallest grayscale value is selected from the valid points as the representative point of that row, accurately capturing the true center position of the seam. This dual screening ensures that the selected points possess both trend fit and feature authenticity, adapting to the positioning requirements of ultra-narrow seams <0.1mm.
[0123] ③ By employing a composite iterative edge-trimming logic supported by dense points, this method overcomes the bottleneck of limited fitting accuracy in traditional methods: Traditional sparse point selection data is insufficient to support iterative edge trimming, thus limiting fitting accuracy. This method relies on a sufficient point set accumulated through dense growth, providing conditions for deep iterative edge trimming. It constructs a composite logic of "third-order initial fitting - second-order iterative reduction," first using a third-order polynomial to outline the contour and filter out large-deviation outliers, then switching to second-order to improve smoothness, combined with mean deviation and dynamic decay threshold filtering; after multi-condition termination verification, it eliminates the need for interpolation to generate high-precision smooth positioning lines, overcoming the traditional accuracy bottleneck.
[0124] This embodiment utilizes three core technologies—"laser-vision dual-mode deep collaboration," "active dense growth point selection," and "composite iterative trimming and fitting"—to specifically address the four major bottlenecks in existing pre-welding seam positioning. Combined with optimizations such as accelerated computation and emergency point replenishment, it achieves a comprehensive upgrade in accuracy, anti-interference capability, continuity, efficiency, and adaptability, as detailed below: 1) Positioning accuracy for ultra-narrow and sparse slots covers all scenarios A dual-mode seed point positioning scheme is adopted: In the laser-dominated scene, visual assistance corrects 0-3 pixel offsets by backtracking historical laser data, selecting the highest point density, and refining the darkest column, providing reliable anchor points for ultra-narrow slits (<0.1mm); in the laser-dominated scene, combined with sparse laser data and visual stacked images, high-density anchor points are globally selected and then refined at the pixel level to adapt to medium-narrow slits (0.1-0.4mm). Both modes employ a dual-criteria selection method of "median constraint - minimum grayscale," ensuring stable positioning deviation within ±0.05mm (±1 pixel), thus solving the problems of sparse point selection and unreliable initial points in single-technology approaches.
[0125] 2) Enhanced anti-interference capability under complex working conditions in multiple dimensions A multi-layered anti-interference system is constructed: the dynamic ROI is driven by precise seed points of "laser screening-visual refinement" to eliminate background noise and scratches; in the active dense growth stage, the splicing direction is fitted by a 50-point dynamic window to actively shield forks and black thin lines without the need for erosion / dilation operations; the laser-assisted visual scene adds an emergency check for "insufficient growth-forking deviation", which is combined with the Otsu algorithm dynamic threshold to offset uneven lighting and reflection, completely solving the problem of failure of traditional detection feature extraction.
[0126] 3) Meter-level continuous inspection of long-distance splices without breaks Relying on a dual closed-loop and unified transmission mechanism: In the case of local laser failure, a closed loop of "laser parameter scanning - visual interpolation - laser restart" is adopted to avoid ultra-narrow gaps; in the case of generally sparse lasers, a closed loop of "laser initiation and anchoring - visual transmission - laser emergency point interpolation" is adopted, and the local laser scanning only covers the failure area; in both types of scenarios, seed points are transmitted through "1 / 4 frame overlap", combined with breakpoint cyclic tracking (≤5 iterations for repair), to achieve meter-level long-range "seamless and gapless" one-time detection.
[0127] 4) Optimal balance between detection efficiency and industrial adaptability In terms of efficiency: The laser scanning module (with a detection speed as low as 2ms) handles rapid scanning, and laser-assisted vision scenarios introduce acceleration technologies (such as Numba accelerating Python), with linear growth of a single visual frame taking ≤100ms; only grayscale preprocessing is retained, avoiding the waste of traditional multi-step operations. In terms of adaptability: A classification-based adjustable parameter system (such as anchor point backtracking length and fine-tuning window size) can adapt to multiple materials such as SiC / AI composite materials, aluminum and aluminum alloys, and steel, as well as splice widths of 0.05-0.4mm, without the need for large-scale annotation, avoiding the problems of weak generalization and high cost of deep learning.
[0128] 5) The industrial application value and technological upgrading significance are becoming increasingly prominent. The modular architecture supports flexible switching of scenarios (such as vision-assisted laser for ultra-narrow gaps in automobiles and laser-assisted vision for sparse gaps in aerospace composite materials), covering fields such as automobiles, aerospace, military, and shipbuilding; it can output high-precision positioning lines without complex pre-processing, reducing welding rework costs, reducing manual debugging and labeling input, and helping to upgrade industrial welding automation and intelligence.
[0129] If the aforementioned functions are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this invention, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
Claims
1. A method for obtaining the visual center positioning line of the pre-welding plate splice using laser scanning-linear growth depth coordination, characterized in that, include: For the pre-welding plate, the laser scanning data of the laser scanning module for global scanning is acquired in real time, and the visual inspection image of the visual inspection module is acquired simultaneously. The global seed points are obtained with the scanning results as the primary factor and the visual inspection image as the auxiliary factor. Based on the global seed points, the initial position of the seed points in the visual inspection image is determined. Dense growth is performed starting from the initial position, and the resulting breakpoints are cyclically tracked and repaired to obtain the seam selection points. Based on the selected seam points, a screening process is first performed, followed by a compound iterative trimming and fitting process to obtain the seam center positioning line.
2. The method for obtaining the visual center positioning line of the pre-welding plate splice using laser scanning-linear growth depth synergy as described in claim 1, characterized in that, The steps for obtaining the global seed point include: Based on the real-time laser scanning data from the laser scanning module, the splice coordinates and selection validity data of each area of the plate before welding are obtained in real time. When the laser scanning module detects invalid points or the vertical distance between adjacent points in the area exceeds a set threshold in real time, it will switch to the visual detection module for visual detection, re-select points, and extract the initial seed points. The initial seed point is optimized by linear growth and curve fitting to extract the previous frame stitching growth endpoint of the visual detection module, which is used as the initial seed point of the subsequent frame. Combined with the inter-frame partial overlap design, the initial seed point is transferred across frames. Meanwhile, the laser scanning module operates redundantly, determining whether the conditions for switching back to the laser scanning module are met. If yes, it switches back to the laser scanning module and performs laser scanning; otherwise, the visual detection module continues to perform cross-frame transmission of initial seed points, eventually obtaining all initial seed points as global seed points.
3. The method for obtaining the visual center positioning line of the pre-welding plate joint using laser scanning-linear growth depth coordination as described in claim 2, characterized in that, The initial seed point extraction step includes: Based on the last valid laser selection point of the laser scanning module, the visual detection module backtracks backward a set length of historical laser scanning data and uses it as the backtracking range; Within the backtracking range, a local analysis region is constructed in the visual detection image with each laser scanning point as the center, and the selection point density of each local analysis region is calculated. Select the local analysis area with the highest point density, use its center point as the reference anchor point, and construct a pixel refinement area of a set size with the reference anchor point as the center. The algorithm of selecting the darkest column is used to first calculate the average gray value of each column of pixels in the pixel refinement area, filter out the column with the smallest average gray value, and then select the pixel with the smallest gray value from the column with the smallest average gray value as the initial seed point.
4. The method for obtaining the visual center positioning line of the pre-welding plate splice using laser scanning-linear growth depth synergy as described in claim 3, characterized in that, The conditions for switching back to the laser scanning module include: The vertical distance between adjacent selected points within the area does not exceed a set threshold, and the density of selected points meets the set qualification standard.
5. The method for obtaining the visual center positioning line of the pre-welding plate joint using laser scanning-linear growth depth coordination as described in claim 1, characterized in that, The steps for obtaining the global seed point include: The full-range sparse point selection data obtained by the laser scanning module after performing a global scan along the seam extension direction, and the visual inspection images synchronously acquired by the visual inspection module are acquired and temporarily stored and stacked. Using each selected point obtained by the laser scanning module as the center, a local analysis region of a set size is constructed in the visual detection image, and the selected point density of each local analysis region is calculated; Select the local analysis region with the highest point density, take its center point as the reference anchor point, and construct a pixel refinement region of a set size in a single frame visual detection image with the reference anchor point as the center. The darkest column selection algorithm is used to first calculate the average gray value of each column of pixels in the pixel refinement area, filter out the column with the smallest average gray value, and then select the pixel with the smallest gray value from the column with the smallest average gray value as the initial seed point. The initial seed point is optimized through linear growth and curve fitting. The end point of the stitching growth of the previous frame of the visual detection module is extracted, and its x-axis is used as the initial seed point at y=0 of the next frame. Combined with the inter-frame partial overlap design, the initial seed point is transferred across frames. At the same time, during the cross-frame transfer process, a lightweight matching algorithm is used to select the point that best matches the gray-scale distribution of the surrounding gray-scale distribution of the end point of the previous frame and the surrounding gray-scale distribution of the initial seed point of the next frame, and whose deviation from the fitted positioning line of the previous frame is within a set threshold. This point is used as the final initial seed point of the frame, and linear growth of the initial seed point of the next frame is performed. Determine whether there is insufficient linear growth or deviation in growth branching of the initial seed point. If so, the laser scanning module switches from standby mode to emergency mode, takes the area corresponding to the initial seed point as the current failed area, performs local scanning only on the current failed area and its surrounding area, constructs local analysis sub-regions within the local scanning range, calculates the selection point density of each local analysis sub-region, and takes the center point of the local analysis sub-region with the highest selection point density as the emergency reference anchor point. The visual detection module receives the emergency reference anchor point, selects a new initial seed point using the darkest column seed selection algorithm, re-executes the cross-frame transmission of the initial seed point, and the laser scanning module switches back to standby mode. If not, the visual detection module continues to perform the cross-frame transmission of the initial seed points, eventually obtaining all the initial seed points as global seed points.
6. The method for obtaining the visual center positioning line of the pre-welding plate joint using laser scanning-linear growth depth coordination as described in claim 1, characterized in that, The steps for obtaining the seam selection points include: (1) Based on the global seed point, the global coordinates of the seed point are obtained by triangulation method, and after coordinate mapping, they are transmitted to the visual detection module to determine the initial position in the visual detection image; (2) Take the seed point corresponding to the initial position as the starting growth point, and perform dense growth according to the vertical priority eight-neighbor breadth-first growth rule. After the growth is completed, a breadth-first growth queue containing only effective growth points is obtained. (3) Based on the breadth-first growth queue, the current distribution of seam points is obtained; (4) Extract the uppermost and lowermost endpoints from the current seam point distribution, and create pixel orientation search regions along their respective extension directions; (5) Analyze the grayscale features in the pixel orientation search area and select the darkest column and the darkest unvisited point in it as candidate breakpoints that meet the characteristics of the stitching dark area; (6) Construct a local analysis window centered on the candidate breakpoint, calculate the local dynamic threshold of the local analysis window using the Otsu algorithm, and verify the matching between the candidate breakpoint and the dark area feature of the seam based on the local dynamic threshold. If the verification is successful, connect the candidate breakpoint and repair the discontinuous part of the seam. If the verification fails, do not repair. (7) Check if there are any new seam points. If so, get the current seam point distribution again and repeat steps (4)-(6) for iterative processing. If not, determine that the repair is complete and finally get all seam selection points.
7. The method for obtaining the visual center positioning line of the pre-welding plate joint using laser scanning-linear growth depth coordination as described in claim 6, characterized in that, The steps for obtaining a breadth-first growth queue containing only valid growth points include: 1) Initialize and create an empty breadth-first growth queue. Starting from the initial growth point, add the global seed point into the breadth-first growth queue, wherein the breadth-first growth queue adopts the first-in-first-out storage rule. 2) Select the current growth point from the head of the breadth-first growth queue, and construct a local analysis window centered on the current growth point; 3) Considering that the seam and the surrounding environment present a bimodal grayscale distribution in the local analysis window, the local dynamic threshold is calculated for the local analysis window using the Otsu algorithm based on the bimodal grayscale distribution; 4) The current growth point traverses eight neighboring pixels according to the vertical priority rule, and checks whether the grayscale of each pixel meets the local dynamic threshold. If yes, then proceed to step 5); otherwise, discard it. 5) Determine if the current growth point passes the darkness check. If yes, proceed to step 6). If no, discard it. 6) Determine whether the current growth point passes the directional continuity constraint check. If yes, it is determined to be a valid growth point, marked as visited, and re-included in the breadth-first growth queue, placed at its tail. If not, it is discarded. 7) Repeat steps 2)-6) until the traversal is complete, and obtain the final breadth-first growth queue containing only valid growth points.
8. The method for obtaining the visual center positioning line of the pre-welding plate joint using laser scanning-linear growth depth coordination as described in claim 7, characterized in that, The steps for verifying the directional continuity constraint include: For the current growth point, construct a dynamic historical growth point window that contains multiple historical latest growth points; When the dynamic historical growth point window accumulates more than a set number of valid growth points, all the latest historical growth points are sorted according to their y-coordinates, and a linear fit is performed using the least squares method to construct a mathematical model for fitting the seam direction. The expected x-coordinate is calculated based on the mathematical model of the fitted seam direction. The absolute deviation between the actual x-coordinate and the expected x-coordinate is compared. If the absolute deviation is less than or equal to a set value, the verification passes; otherwise, it is determined to be an interference point and the verification fails.
9. The method for obtaining the visual center positioning line of the pre-welding plate joint using laser scanning-linear growth depth synergy as described in claim 1, characterized in that, The step of obtaining the center positioning line of the seam includes: All the selected seam points are sorted in order according to the vertical coordinates corresponding to the seam extension direction, so that the selected seam points with the same vertical coordinate are classified and form a point set structure distributed by row. Based on the point set structure, the points are filtered row by row according to the set dual criteria, and representative points of each row are obtained to form the filtered point set structure. Based on the filtered point set structure, a third-order polynomial is used to initially fit the representative points to obtain an initial fitting curve, which serves as the initial seam center positioning line. Calculate the deviation value of each representative point from the fitted curve, compare it with a preset threshold, filter out the representative points corresponding to the preset threshold, and retain only the representative points that meet the preset threshold. For the representative points that meet the preset threshold, a second-order polynomial iterative fitting is performed to obtain the final fitting curve, which serves as the final seam center positioning line. The number of iterations is ≤3. During each iterative fitting process, representative points that do not meet the dynamic threshold are filtered out by calculating the dynamic threshold. The expression for calculating the dynamic threshold is: dynamic threshold = mean deviation + (0.8 - number of iterations × 0.2) × standard deviation.
10. The method for obtaining the visual center positioning line of the pre-welding plate joint using laser scanning-linear growth depth coordination as described in claim 1, characterized in that, The steps for obtaining the filtered point set structure include: For the point set structure, calculate the median of the horizontal coordinate of each row, define the constraint range based on the median of the horizontal coordinate, and retain only the seam selection points that are within the constraint range and are far from the median of the horizontal coordinate. For all seam selection points in each row that satisfy the constraints, select the seam selection point with the smallest gray value as the darkest point, and use the darkest point as the representative point of the corresponding row. If a row cannot simultaneously filter out the darkest point that satisfies both the constraints and the minimum gray value, then sort the row according to the horizontal coordinate and take the seam selection point located at the midpoint as the representative point. Finally, by performing the above processing on each row of the point set structure, the filtering process is completed, and the filtered point set structure is obtained.