Online identification method and system for laser welding surface defects of automobile ornament

By employing structured light field projection and reflected light capture on the laser-welded surface of automotive trim parts, combined with visual positioning and adaptive adjustment, and utilizing a residual neural network with an integrated feature attention mechanism for defect identification, the problems of strong subjectivity, low efficiency, and low accuracy in existing technologies are solved, achieving efficient and accurate defect detection.

CN121639612APending Publication Date: 2026-03-10NANJING WANOU AUTOMOBILE PARTS CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-11-27
Publication Date
2026-03-10

AI Technical Summary

Technical Problem

Existing technologies for detecting surface defects in laser welding of automotive trim parts suffer from problems such as high subjectivity of detection results, low efficiency, low accuracy, high cost, and insufficient sensitivity, making it difficult to meet the needs of modern large-scale automobile production.

Method used

The method employs structured light field projection, reflected light capture, feature extraction, and classification recognition, combined with visual positioning and adaptive adjustment. High-quality image sequences are acquired through laser imaging and camera devices, and a residual neural network with integrated feature attention mechanism is used for defect classification to adjust welding process parameters in real time.

Benefits of technology

It enables efficient and accurate online detection of surface defects in laser-welded automotive trim parts, improving detection accuracy and efficiency, reducing costs, and minimizing the uncertainty of detection results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121639612A_ABST
    Figure CN121639612A_ABST
Patent Text Reader

Abstract

The invention discloses an automobile ornament laser welding surface defect online identification method and system, and the method comprises the steps: projecting a structured light field to a welding surface: obtaining the coordinate information of a welding region, driving to carry out the spatial displacement compensation, and adjusting the aperture range of a diaphragm; capturing reflected light of the structured light field in real time to form an image sequence, which comprises the following steps: receiving a pulse signal output by a welding equipment encoder to trigger shooting, and adjusting exposure time to a preset mapping interval according to real-time light intensity feedback; performing defect feature extraction and defect classification identification on the image sequence, namely performing edge extraction by adopting an edge detection algorithm, and calculating contour geometric parameters and gray-level co-occurrence matrix parameters to extract features; performing defect classification and identification through a residual neural network integrated with a feature attention mechanism; and a defect recognition result is obtained, and welding process parameters are adjusted based on the defect recognition result. According to the invention, the laser welding surface defect on-line identification of the automobile ornament can be realized, and the identification precision is improved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The application relates to the technical field of laser welding surface defect identification, in particular to an online identification method and system for surface defects of laser welding of automobile ornaments. BACKGROUND

[0002] In the automobile industry, the laser welding process has become a key technology to ensure the connection quality of automobile parts and the overall performance. With the continuous improvement of the automation and intelligentization of automobile production, the requirements for the quality of laser welding are becoming increasingly stringent. Laser welding is widely used in the manufacturing process of key components such as automobile body, chassis and power system due to its advantages of high precision, high efficiency and low heat-affected zone, which greatly improves the structural strength, safety and appearance quality of automobiles.

[0003] In the field of surface defect identification of automobile ornaments, traditional methods for detecting laser welding surface defects include manual visual inspection and offline sampling inspection. In manual visual inspection, the detection personnel observe and judge the laser welding surface of automobile ornaments based on their own experience and skills. Offline sampling inspection involves sampling some products from the production line and using X-ray detection, ultrasonic detection and other means for detection. X-ray detection uses X-rays to penetrate the welded part and determines whether there is a defect according to the imaging of the X-rays. Ultrasonic detection transmits ultrasonic waves in the welded part and detects defects according to the reflection of the ultrasonic waves. In addition, laser welding image analysis technology is also used for defect identification and analysis to realize real-time defect identification of laser welding.

[0004] However, these existing technologies have obvious defects. Manual visual inspection results are highly dependent on the experience and skill level of the detection personnel, and there are differences in judgment standards between different detection personnel, which can easily lead to subjectivity and uncertainty in the detection results, and the detection efficiency is low, which cannot meet the needs of modern automobile mass production and high efficiency. The detection ability for small defects and internal defects is also limited. X-ray detection equipment is expensive, the detection cost is high, and there is a risk of radiation. At the same time, the sensitivity to small cracks is insufficient, and it is easy to miss detection. Ultrasonic detection requires the use of coupling agent, and it is not suitable for rough welds. The detection results are easily affected by factors such as weld shape and surface state, which limits the detection accuracy and reliability. The existing laser welding image analysis technology is relatively broad and cannot adapt to the material properties, process requirements and defect morphology of the laser welding surface of automobile ornaments, and the recognition accuracy is not high. SUMMARY

[0005] In order to realize online identification of surface defects of laser welding of automobile ornaments and improve the recognition accuracy, the application provides an online identification method and system for surface defects of laser welding of automobile ornaments.

[0006] In a first aspect, the application provides a method for online identification of surface defects of laser welding of automobile trim parts, comprising: projecting a structured light field onto the welding surface; the generation of the structured light field comprises: obtaining coordinate information of the welding area by a visual positioning sensor in the laser imaging device; driving a three-dimensional adjustment mechanism in the laser imaging device to perform spatial displacement compensation, so that the center of the laser spot deviates from the center line of the welding seam by less than a preset deviation; adjusting the aperture range of the diaphragm according to the thickness of the welding material through the series adjustable diaphragm assembly in the laser imaging device; real-time capture of the reflected light of the structured light field to form an image sequence; the real-time capture of the reflected light comprises: setting the angle between the lens optical axis of the camera device and the welding surface to be symmetrically distributed with the laser projection angle; triggering the shooting according to the pulse signal output by the encoder of the welding equipment, and adjusting the exposure time to a preset mapping interval according to the real-time light intensity feedback; the preset mapping interval is obtained through the mapping relationship database of light intensity and exposure parameters; extracting defect features and classifying defects from the image sequence; the feature extraction step comprises: using a Gaussian filter template size for noise reduction processing; using an edge detection algorithm for edge extraction, calculating contour geometric parameters and gray level co-occurrence matrix parameters to extract features; the classification and identification step comprises: classifying and identifying defects through a residual neural network integrated with a feature attention mechanism; transmitting the defect identification result to the welding equipment controller; based on the defect identification result, adjusting the welding process parameters according to the pre-stored mapping relationship table of different defect types and welding parameters.

[0007] By using the above scheme, considering the high defect identification demand caused by factors such as material properties, process requirements and defect morphology of the laser welding surface of automobile trim parts, the structured light field is accurately projected onto the welding surface through position compensation, ensuring that the reflected light is effectively captured to form a high-quality image sequence, efficiently extracting image defect features and accurately classifying and identifying, timely transmitting the result to the controller to quickly adjust the welding parameters, realizing efficient and accurate online detection of the surface defects of the laser welding of automobile trim parts.

[0008] Preferably, it further comprises: real-time acquisition of welding working condition parameters; the welding working condition parameters include: welding speed, welding seam offset, reflected light intensity, and surface curvature; based on the acquired welding working condition parameters, any one of ROI position correction, diaphragm regulation, exposure parameter adjustment and symmetric angle regulation is adaptively completed; The ROI position correction includes: setting a correction trigger condition based on the welding working condition parameter, predicting the next frame ROI position according to the working condition parameter when the correction is triggered, recalibrating the projection position, ensuring that the projection range always covers the next frame ROI position, and adjusting the next frame ROI position to be located at the center of the field of view of the camera; the diaphragm regulation includes: dividing the working condition level based on each parameter in the welding working condition, determining the working condition level and generating a working condition parameter level combination, obtaining a preset diaphragm aperture adjustment range and aperture adaptation shape matched therewith through the working condition parameter level combination, and completing the diaphragm regulation; the symmetry angle regulation includes: making a preset angle correction based on the reflection intensity on the basis of the reference symmetry angle design; and collecting the height data of the weld area by using a plurality of laser displacement sensors, fitting the normal direction of the curved surface, taking the normal direction as the symmetry axis, adjusting the angle of the camera in real time, maintaining the angle between the lens optical axis and the welding surface and the laser projection angle in symmetrical distribution, and setting the real-time adjustment step according to the curvature of the curved surface; the exposure parameter adjustment includes: dynamic calculation of the exposure time based on the welding speed, and calculation of the exposure time adapted to the welding speed; and obtaining a preset exposure gain matched with the reflection intensity.

[0009] By adopting the above scheme, any one of the ROI position correction, diaphragm regulation, exposure parameter adjustment and symmetry angle regulation is adaptively completed according to the real-time collected welding working condition parameters, so that the projection position accurately covers the ROI position, the diaphragm aperture and shape are adapted, the exposure parameter is reasonable, and the camera and the laser projection angle are symmetrical, thereby improving the image acquisition quality and the accuracy of defect recognition.

[0010] Preferably, it further comprises: When the ROI position correction, diaphragm regulation, exposure parameter adjustment and symmetry angle regulation are synchronously adaptively completed based on the collected welding working condition parameters, a linkage priority is preset, and each item is completed in order according to the linkage priority; wherein the linkage priority order from high to low is ROI position correction, optical axis angle optimization, variable diaphragm regulation and exposure parameter adjustment.

[0011] By adopting the above scheme, when multiple regulations are synchronously adaptively completed based on the collected welding working condition parameters, the linkage priority is preset and executed in order, which can avoid the conflict and interference between the regulations, so that the system can adaptively adjust in an orderly manner, and ensure timely and effective response to different working conditions.

[0012] Preferably, it further comprises: The target welding area is divided, and the working condition parameters of the welding object in each divided target welding area are obtained, including: the number of material types, the curvature of the curved surface, the type and density of historical welding defects; it is judged whether the working condition parameters of the welding object in each divided sub-target welding area are greater than the corresponding preset working condition parameter threshold, and whether the difference between the working condition parameters of the welding object in adjacent sub-target areas is greater than the corresponding preset working condition parameter difference value; The planned welding trajectory in the target welding area is obtained, combined with the target welding area division, the sub-target welding area with a greater than corresponding preset working condition parameter threshold and the adjacent sub-target area with a greater than corresponding preset working condition parameter difference value are marked; a plurality of camera devices are set for the sub-target welding area with a greater than corresponding preset working condition parameter threshold, and the angle between the optical axis of each camera device corresponding lens and the welding surface is symmetrically distributed with the laser projection angle, so that the defect feature extraction and classification comprehensive identification are performed by using a plurality of image sequences; for the adjacent sub-target welding area with a greater than corresponding preset working condition parameter difference value, a plurality of sets of laser imaging devices and camera devices are provided, and for each set of laser imaging devices and camera devices, the structured light field projection and image sequence generation of one sub-target welding area in the adjacent sub-target welding area are completed.

[0013] By adopting the above scheme, the camera devices and laser imaging devices are flexibly configured according to the working condition parameter difference of the welding object, the comprehensive identification is performed by using a plurality of image sequences, the more accurate and comprehensive defect feature extraction and classification identification of different welding areas are realized, and the accuracy and reliability of defect identification are improved.

[0014] Preferably, it further comprises: The working process parameters of the structured light field projection and image sequence generation are collected in real time, including: projection parameters, 3D point cloud parameters and image sequence time sequence parameters; the working process parameters collected in real time are associated with the welding working condition parameters to form a real-time fusion parameter set; Based on the real-time fusion parameter set, adaptive defect feature extraction optimization and defect classification algorithm adaptation are performed; the adaptive defect feature extraction optimization includes: based on the real-time fusion parameter set, setting a preset scene corresponding parameter threshold, determining the belonging preset scene based on the parameters of the real-time fusion parameter set, dynamically switching the edge detection algorithm adapted to the preset scene to which the current real-time fusion parameter set belongs for edge detection, the edge detection algorithms matched by different preset scenes are different, and each preset scene matched edge detection algorithm adopts at least two of 2D edge fusion detection algorithm, time sequence edge tracking algorithm and 3D normal vector guided edge enhancement algorithm; in addition to calculating contour geometric parameters and gray level co-occurrence matrix parameters to extract 2D texture features and 2D edge features, 3D spatial features are also extracted; the adaptive classification algorithm adaptation includes: setting a preset scene corresponding feature vector parameter threshold, determining the belonging preset scene based on the extracted feature vector, and dynamically switching the neural network matched with the preset scene to which the current extracted feature vector belongs, the network branches and network structures of the neural networks matched by different preset scenes are different.

[0015] By adopting the above scheme, the operation process parameters are associated with the welding working condition parameters to form a real-time fusion parameter set, the defect feature extraction and the adaptive classification algorithm can be optimized according to the set, the edge detection algorithm is dynamically switched, the 3D spatial features are extracted, and different neural networks are matched, so that the comprehensiveness of defect feature extraction and the accuracy of classification recognition are improved.

[0016] Preferably, the step of transmitting the defect recognition result includes: triggering an interrupt request when the defect information is detected, preempting the data transmission channel to preferentially transmit the data packet containing the defect information, and attaching a cyclic redundancy check code to the data packet.

[0017] By adopting the above scheme, it is ensured that the defect information can be preferentially and timely transmitted to the welding equipment controller, and the completeness and accuracy of the transmitted data are ensured by using the cyclic redundancy check code, so as to avoid welding parameter adjustment errors caused by data errors.

[0018] Preferably, the step of generating the structured light field further includes: controlling the polarization direction of the laser through a polarizer, so that the polarization state of the reflected light matches the polarizer in front of the lens of the camera device.

[0019] By adopting the above scheme, the image signal-to-noise ratio is improved, the interference of ambient light on image acquisition is reduced, and the image quality is improved.

[0020] In a second aspect, the application provides a laser welding surface defect online identification system for automobile trim parts, which comprises: The structured light field projection module is configured to project a structured light field to a welding surface; the generation of the structured light field comprises: obtaining coordinate information of a welding area by a visual positioning sensor in a laser imaging device; driving a three-dimensional adjusting mechanism in the laser imaging device to perform spatial displacement compensation, so that a deviation between a center of a laser spot and a center line of a welding seam is less than a preset deviation; and adjusting an aperture range of an adjustable diaphragm assembly in series in the laser imaging device according to a thickness of a welding material; The reflected light image acquisition module is configured to capture a reflected light image sequence of the structured light field in real time; the capturing of the reflected light in real time comprises: setting an included angle between a lens optical axis and the welding surface to be symmetrically distributed with a laser projection angle; triggering shooting by receiving a pulse signal output by a welding equipment encoder, and adjusting an exposure time to a preset mapping interval according to real-time light intensity feedback; the preset mapping interval is obtained by a mapping relationship database of light intensity and exposure parameters; The defect feature extraction and identification module is configured to perform defect feature extraction and defect classification identification on the image sequence; the feature extraction step comprises: performing noise reduction processing by using a Gaussian filter template size; performing edge extraction by using an edge detection algorithm, and calculating contour geometric parameters and a gray level co-occurrence matrix parameter to extract features; the classification and identification step comprises: performing defect classification and identification by using a residual neural network integrated with a feature attention mechanism; The welding process parameter adjustment module is configured to transmit a defect identification result to a welding equipment controller; based on the defect identification result, a welding process parameter is adjusted according to a pre-stored mapping relationship table of different defect types and welding parameters.

[0021] By using the above scheme, the laser spot is accurately projected through visual positioning and displacement compensation, the image quality is improved through aperture adjustment of the diaphragm, the image acquisition effect is ensured through adaptive adjustment of the exposure time and the angle, accurate defect classification and identification are performed through the residual neural network integrated with the feature attention mechanism, the welding process parameter is adjusted according to the defect identification result through real-time feedback and closed-loop control, and efficient and accurate online detection of the surface defects of the laser welding of the automobile trim part is flexibly realized.

[0022] In a third aspect, a computer readable storage medium is provided, which includes a stored computer program, wherein the computer readable storage medium controls a device where the computer readable storage medium is located to perform the method as described above when the computer program is running.

[0023] In a fourth aspect, a computer device is provided, which includes a memory, a processor, and a program stored in the memory and executable by the processor, and the program is executed by the processor to implement the steps of the method as described above.

[0024] In summary, the present application has the following beneficial effects: 1. Considering the high demand for defect recognition due to the material properties, process requirements, and defect morphology of laser-welded automotive trim surfaces, visual positioning and displacement compensation are used to precisely project a structured light field onto the laser spot, ensuring that the laser spot accurately falls on the center line of the weld seam. Adjusting the aperture range according to the thickness of the weld material ensures that the reflected light is perpendicularly incident on the camera's image sensor. Simultaneously, the exposure time is adjusted based on real-time light intensity feedback to improve the image signal-to-noise ratio. A residual neural network integrating a feature attention mechanism is used to effectively classify and recognize image sequences. The defect recognition results are transmitted to the welding equipment controller to adjust welding process parameters, achieving real-time feedback and closed-loop control, effectively improving welding quality. 2. Based on the welding condition parameters collected in real time, the ROI position, aperture, exposure parameters and symmetry angle are adaptively adjusted to improve the accuracy and stability of image acquisition, provide more reliable data for subsequent defect feature extraction and defect classification and recognition, and further improve the accuracy and efficiency of online identification of surface defects in laser welding of automotive trim parts. 3. By associating the operation process parameters with the welding condition parameters to form a real-time fusion parameter set, the edge detection algorithm and matching neural network can be dynamically switched according to different preset scenarios to extract richer features, improve the accuracy of defect feature extraction and the adaptability of classification and recognition algorithms, thereby more efficiently and accurately identifying defects on the laser-welded surface of automotive trim parts. Attached Figure Description

[0025] Figure 1 This is a flowchart of the online identification method for surface defects in laser welding of automotive trim parts as described in a specific embodiment; Figure 2 This is a schematic diagram of the online identification system for surface defects in laser welding of automotive trim parts as described in a specific embodiment. Detailed Implementation

[0026] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.

[0027] like Figure 1As shown, the embodiment of the present application discloses a kind of automobile ornament laser welding surface defect online identification method, comprising: using structured light field projection, reflected light capture, feature extraction identification and parameter adjustment etc.; Considering that automobile ornament laser welding is significantly different from other industrial welding scene (such as vehicle body structure, pipeline welding etc.), mainly reflected in material characteristics, process requirements, defect form and online detection constraint etc., such as: the reflection of different materials is strong, uses a variety of materials with different thicknesses, sensitive to appearance quality, and most defects are in the form of micro-defects, so further optimization design is needed for each step to achieve efficient and accurate identification of automobile ornament laser welding surface defects.

[0028] S1, structured light field is projected to the welding surface.

[0029] Specifically, the main steps of projecting structured light field to the welding surface include: first, the coordinate information of the welding area is obtained by the visual positioning sensor in the laser imaging device;Wherein, the green laser with output power range of 50-100mW is selected in the laser imaging device, and the center wavelength is set to 532nm. The reflectivity of the welding surface metal material is in the appropriate interval at this wavelength. Laser beam is projected to the welding surface at an angle of 30°-45°, and the projection spot diameter is controlled to be 0.1-0.3mm. Wherein, laser imaging positioning is realized by visual positioning sensor. After the sensor obtains the initial position information of the welding area, it is transmitted to the three-dimensional adjusting mechanism. The visual positioning sensor can be a camera-based visual sensor. For example, in the laser welding of automobile ornament, the visual positioning sensor can be installed at a suitable position of the welding equipment. By shooting the image of the welding area, the coordinates of the welding area are calculated by using image processing algorithm. Or use other types of sensors such as laser displacement sensor to obtain coordinate information.

[0030] Secondly, drive three-dimensional adjusting mechanism in laser imaging device to carry out space displacement compensation, so that the center of laser spot and the center line of welding seam deviation is less than preset deviation, such as: make laser spot accurately fall on the center line of welding seam, and the adjustment accuracy reaches 0.01mm. Wherein, the three-dimensional adjusting mechanism can be a screw nut mechanism driven by motor. The control system drives the motor to rotate the screw rod, so that the nut moves along the screw rod, thereby realizing displacement compensation of laser imaging device. Or use the combination structure of linear guide and slider, and realize displacement by driving slider to slide on linear guide by motor.

[0031] In addition, in order to further adapt to the welding characteristics of automobile trim parts and realize flexible regulation of light field, an adjustable diaphragm assembly in series with the laser imaging device can be used to adjust the diaphragm aperture range according to the thickness of the welding material. The adjustable diaphragm assembly can be a variable diaphragm composed of multiple blades, and the diaphragm aperture can be adjusted by controlling the opening degree of the blades, with a range of 0.5-2 mm. During the welding process, the opening degree of the blades is adjusted according to the thickness of the welding material, so as to adjust the size of the diaphragm aperture. The adjustable diaphragm assembly can also use other types of diaphragms such as liquid crystal diaphragms to adjust the diaphragm aperture by changing the optical properties of the liquid crystals.

[0032] In addition, in order to further improve the image signal-to-noise ratio, reduce external interference, and improve the image acquisition quality, the polarization direction of the laser can be controlled by a polarizer to match the polarization state of the reflected light with the polarizer in front of the camera lens.

[0033] S2, real-time capture of the reflected light of the structured light field to form an image sequence.

[0034] Specifically, the step of real-time capture of the reflected light of the structured light field to form an image sequence includes: first, setting up a camera for collecting the reflected light of the structured light field, using a CMOS industrial camera with a resolution not less than 2048x1536 pixels, setting the frame rate to 50-100 fps, selecting a fixed-focus industrial lens with a focal length of 16 mm, adjusting the aperture value to F2.8-F4.0, and setting the angle between the optical axis of the lens and the welding surface to be symmetrically distributed with the laser projection angle, to ensure that the reflected light is perpendicular to the camera photosensitive chip.

[0035] Secondly, set the camera parameters. Including setting the collection frequency, such as receiving the pulse signal of the welding equipment encoder to trigger the shooting. That is, the pulse signal output by the welding equipment encoder is used as the trigger signal for camera shooting, and the camera shoots once for every pulse signal output by the encoder. The shooting frequency of the camera is synchronized with the running speed of the welding equipment, and the overlapping area of adjacent images is ensured to be within a suitable range, such as 15%-20% of the overlapping area of adjacent images. Including setting the exposure time, adjusting the exposure time to the preset mapping interval according to the real-time light intensity feedback; the preset mapping interval is obtained by pre-collecting the surface reflected light intensity data under different welding conditions to establish a mapping relationship database between light intensity and exposure parameters. That is, the photosensitive sensor built-in the camera collects the incident light intensity (i.e. reflected light intensity) in real time, and the corresponding exposure time is calculated by interpolation through the mapping relationship database, with a range of 10-100us, and the shutter speed is dynamically adjusted with the light intensity, with an adjustment response time not exceeding 1ms.

[0036] In addition, a chromatic aberration lens group with a focal length of 35mm can be installed to focus the reflected light onto the camera photosensitive surface, and a narrow-band filter is installed in front of the lens group to allow only light with a wavelength of 532nm±5nm to pass through, filtering out environmental light interference.

[0037] S3, defect feature extraction and defect classification recognition are performed on the acquired image sequence.

[0038] In order to more accurately collect and classify the feature data, the acquired image collection sequence is input into an edge computing device or a local data processing unit. First, the acquired image sequence is preprocessed. The data processing unit uses a multi-core processor with a main frequency of not less than 2.8GHz, 8GB and above cache, built-in special image processing acceleration chip, and supports parallel computing architecture. The communication module uses an industrial-grade Ethernet module, supports 1000Mbps transmission rate, is compatible with Modbus-TCP communication protocol, and establishes physical connection with the welding equipment controller through RJ45 interface.

[0039] The preprocessing includes image graying processing. During graying processing, the weighted average method is used, the red channel weight is set to 0.299, the green channel weight is set to 0.587, and the blue channel weight is set to 0.114. The color image is converted into a single-channel gray image through matrix operation. After graying processing, image filtering is performed, such as Gaussian filtering with a 5x5 filter template. The center pixel weight of the template is 0.256, and the adjacent 8 pixel weights from the center to the outside are 0.144, 0.088, respectively. The gray image is smoothed through convolution operation to filter out high-frequency noise. Finally, image enhancement is performed by redistributing the gray value of the image pixels to make the histogram of the image close to uniform distribution. During histogram equalization, the gray histogram of the gray image is first counted, the cumulative distribution function is calculated, and then the original gray value is converted into a new gray value through mapping transformation to make the gray distribution of the new image uniform. Specifically, the output gray value corresponding to each pixel point of the image is calculated according to the cumulative distribution function to complete the expansion of the gray dynamic range.

[0040] Secondly, after pretreatment, feature extraction is carried out by using the data processing unit, and the specific steps include: adopting a Gaussian filter template size for noise reduction processing; adopting an edge detection algorithm for edge extraction, such as adopting Canny algorithm for edge detection, first smoothing the pretreated image twice through a 5*5 Gaussian filter template, then calculating the gradient amplitude and direction of each pixel point in the image, the gradient calculation adopts Sobel operator, and the horizontal and vertical operators are respectively subjected to convolution operation. The adaptive threshold is determined by Otsu algorithm, first calculating the gray histogram of the image, then traversing different threshold values, finding the threshold value that makes the inter-class variance of the foreground and background maximum as the high threshold value, and setting the low threshold value as 1 / 2.5 of the high threshold value. The contour geometric parameters and the gray level co-occurrence matrix parameters are calculated to extract the features, such as extracting the contour through the findContours function, adopting the CHAIN_APPROX_SIMPLE contour approximation method, removing redundant contour points, and retaining the key feature points of the contour. When calculating the morphological parameters, the contourArea function is used to calculate the contour area, the arcLength function is used to calculate the contour perimeter, the moments function is used to calculate the barycentric coordinates of the contour, and the circularity, rectangularity and other parameters of the contour are calculated, the circularity is calculated by 4 × area / perimeter 2, and the rectangularity is calculated by the ratio of the area of the smallest circumscribed rectangle of the contour to the area of the contour. In the calculation of the gray level co-occurrence matrix, the gray level of the image is quantized to 16 levels, with a step of 1 pixel, and the co-occurrence matrices in 0°, 45°, 90° and 135° directions are calculated, then four feature parameters (2D features) of contrast, correlation, energy and entropy are extracted from each matrix, the contrast is calculated by the product sum of the square of the pixel gray difference in the matrix and the corresponding probability, and the correlation is calculated by the ratio of the product of the covariance and the standard deviation of the two pixel gray values.

[0041] Then, the defect classification and identification is performed, and the specific steps include: performing the defect classification and identification through a residual neural network integrated with a feature attention mechanism. In the optimization of the deep residual network, a feature attention module is added at the output end of each residual block based on the original network. The module converts the feature map into a feature vector through global average pooling, generates attention weights through two fully connected layers and a Sigmoid activation function, and then element-wise multiplies the original feature map to enhance the weight of the key defect features. In the construction of the sample library, the resolution of the collected images is uniformly adjusted to 224x224 pixels, and data enhancement methods such as random flipping, rotation, translation and brightness adjustment are used to expand the sample size. The translation distance does not exceed 5% of the image width, and the brightness adjustment amplitude is 0.8-1.2 times the original brightness. In the model training, the batch size is set to 32, the training rounds are set to 100 rounds, the Adam optimizer is used, the initial learning rate is set to 0.001, and when the validation set accuracy does not improve for 5 consecutive rounds, the learning rate is decayed to 1 / 10 of the original. In the model inference, the extracted multi-dimensional feature vector is input into the fully connected layer, and the probability values of each type of defect and normal sample are output through the Softmax activation function. The class with the maximum probability value is the recognition result, and the coordinate information of the defect area is output through the bounding box regression in the target detection algorithm. The coordinates take the top left corner of the image as the origin, and the left top and right bottom coordinates of the bounding box are output.

[0042] S4, transmitting the defect recognition result to a welding equipment controller; based on the defect recognition result, adjusting the welding process parameters according to a pre-stored mapping relationship table of different defect types and welding parameters.

[0043] Specifically, before the defect information is transmitted, the recognition result is subjected to data formatting processing, the defect type is converted into a corresponding code, such as a porosity code 001 and a crack code 002, the severity is divided into three levels according to the proportion of the defect area to the weld area, and is encoded as 1, 2 and 3 respectively, and the position information is converted into a distance value based on the starting point of the weld. The data is packaged in JSON format, including the fields of "device number", "detection time", "defect code", "severity", "position coordinates", etc. The packaged data is checked by the CRC32 algorithm to generate a check code and is attached to the end of the data packet. In the communication transmission process, the data transmission is triggered by interruption, and when the defect information is detected, an interruption request is triggered immediately to preempt the current data transmission channel, so that the data packet containing the defect information is transmitted preferentially, and the transmission delay is controlled within 50 ms. After receiving the data, the welding equipment controller verifies the data integrity through the check code, requests retransmission if the verification fails, parses the JSON data after the verification is successful, extracts the key information and stores it in the local cache.

[0044] According to the received defect identification result, the welding parameter is adjusted to avoid the generation of subsequent welding defects. Specifically, during parameter adjustment, a pre-stored mapping relationship table of different defect types, defect levels and welding parameters is used, and the relationship table includes the adjustment range of laser power, welding speed, pulse frequency, pulse width and other parameters. For porosity defects, when the severity is level 1, the laser power is increased by 5%-8% based on the original, and the welding speed is reduced by 5%-6%; when the severity is level 2, the laser power is increased by 8%-12%, the welding speed is reduced by 6%-8%, and the protective gas flow is increased by 10%-15%; when the severity is level 3, in addition to the above adjustments, the laser pulse frequency is increased by 5Hz. For crack defects, the laser pulse waveform is adjusted by the waveform generator, the pulse rising edge time is extended from 100us to 150-200us, the pulse width is increased by 15%-30% according to the severity, and the welding speed is reduced by 10%-15%. After parameter adjustment, the laser generator and the conveying mechanism are controlled by the PWM signal to execute the new parameters, and the camera is triggered to focus on the adjusted welding area for shooting. The adjustment effect is verified by the subsequent defect identification result, if the defect is not eliminated, the parameter adjustment strategy is matched again according to the new identification result, until the defect is eliminated or the maximum adjustment times are reached.

[0045] In a specific embodiment, in order to further improve the precision and efficiency of online identification of surface defects of laser welding of automobile ornaments, the ROI position, diaphragm, exposure parameter and symmetry angle are adjusted adaptively according to the real-time collected welding working condition parameters, so as to improve the accuracy and stability of image acquisition; the method further comprises: Integrate multi-dimensional sensor data to collect welding working condition parameters in real time; the welding working condition parameters include welding speed, weld offset, reflection intensity, surface curvature, etc. Based on the collected welding working condition parameters, any one of ROI position correction, diaphragm control, exposure parameter adjustment and symmetry angle control is adaptively completed.

[0046] Specifically, based on the collected welding working condition parameters, adaptive RIO position correction is performed to dynamically track the matching of the weld and the working condition. In the welding start-up stage, based on the offline calibrated weld trajectory template, combined with the welding robot motion instruction (TCP coordinates), the ROI region is initially set (default: width = weld width x 3, height = 5-10 mm, center aligned with the weld center line). In the welding operation stage, based on the weld working condition parameter setting correction trigger condition, when the trigger condition is triggered, the RIO position correction is performed, the projection position is recalibrated, it is ensured that the projection range always covers the next frame ROI position, and the next frame ROI position is adjusted to be located in the center of the camera field of view. In the embodiment, the weld working condition parameter setting correction trigger condition includes: the weld offset is greater than or equal to plus or minus 0.1 mm, the welding speed change rate is greater than 10%, and the curved surface curvature change is greater than 5%. Wherein, the next frame RIO prediction algorithm can be selected to use Kalman filtering and RANSAC fitting algorithm, fuse the weld tracking offset, the robot motion trajectory, the curved surface data of the laser displacement sensor, predict the weld center position at the next time, and for high-speed welding (v≥2m / s), the predicted position is output in advance 50us, to avoid correction lag. The correction includes: position correction: according to the predicted weld center coordinates, the ROI is translated; size correction: the welding speed v and the ROI area S are negatively correlated (S=k / v, k is the material correlation coefficient), the RIO area is adjusted according to the real-time welding speed; shape correction: when it is determined as a complex curved surface according to the curved surface curvature greater than the preset curved surface curvature, the rectangular ROI is converted into an adaptive polygonal ROI.

[0047] Specifically, based on the collected welding working condition parameters, the diaphragm is adaptively controlled to adapt the light flux and depth of field to the working condition. Considering that the reflection intensity, welding speed and surface curvature are all influencing factors of aperture adjustment, for example, in low reflection conditions, the diaphragm aperture can be adjusted to the maximum to increase the light flux, and high-gain exposure is used to avoid underexposure; in high reflection conditions, the diaphragm aperture is adjusted to reduce the amount of light, and polarization filtering is used to suppress overexposure while increasing the depth of field to avoid loss of details in the reflection area; or in high-speed welding conditions, the diaphragm aperture is increased to increase the light flux, and short exposure time is used; in low-speed welding conditions, the diaphragm aperture is reduced to increase the depth of field, and long exposure time is used; in flat or small curvature surface conditions, the circular aperture is used to ensure uniform distribution of the light field; and in large curvature surface conditions, the aperture is adjusted to an elliptical shape. Thus, the parameters in the welding working condition are classified into working condition levels, such as high reflection, medium reflection, low reflection, high-speed welding, low-speed welding, flat curvature surface, and large curvature surface; the current working condition level is determined and a working condition parameter level combination is generated, the preset diaphragm aperture adjustment range and aperture adaptation shape that match the working condition parameter level combination are obtained, and the diaphragm control is completed. The preset diaphragm aperture adjustment range and aperture adaptation shape that match different working condition parameter level combinations are pre-set, which can be determined according to expert experience or through reinforcement learning.

[0048] Specifically, based on the collected welding working condition parameters, the diaphragm is adaptively controlled to adapt the diaphragm to the working condition. The symmetry angle is adjusted to maintain the symmetry relationship between the camera optical axis, the laser projection axis and the weld normal line, suppress mirror reflection, ensure that the proportion of diffuse reflection light in the weld area is the largest, and adapt to the changes in surface deformation and material reflection characteristics. Based on the design of the reference symmetry angle, for example, the angle between the camera optical axis and the laser projection axis is 45°, and both are symmetrical about the weld normal line. The preset angle is corrected according to the reflection intensity. For example, high-reflective materials (reflection intensity > 5000 lux) reduce the symmetrical angle to 30°-40° to shorten the reflection light path and reduce the amount of mirror reflection light entering the camera; low-reflective materials (reflection intensity < 500 lux) increase the symmetrical angle to 50°-55° to improve light utilization and enhance image brightness. The height data of the weld area is collected by multiple laser displacement sensors, the surface normal direction is fitted, the normal direction is used as the symmetry axis, the angle of the camera is adjusted in real time, the angle between the lens optical axis and the welding surface is maintained symmetrical to the laser projection angle, and the real-time adjustment step is set according to the surface curvature, for example, the larger the surface curvature, the smaller the angle adjustment step. In addition, the movement trajectory of the robot can be obtained to predict the change of the weld direction in advance and pre-adjust the optical axis angle (100us in advance). If there are multiple cameras working simultaneously, each camera adjusts the angle independently according to the local surface normal to ensure that the optical axes of all cameras are symmetrical to the normal of the corresponding area, achieving full coverage of complex surfaces without dead angles. The angle between the optical axes of adjacent cameras is ≥30° to avoid mutual shielding, and the image stitching algorithm is used to ensure the continuity of the weld image.

[0049] Specifically, based on the collected welding working condition parameters, the exposure parameters are adaptively adjusted. The specific steps include: knowing that there is a correlation between the welding speed and the exposure time, the formula is t=k / v (k is the material characteristic coefficient), and then based on the exposure time dynamic calculation of the welding speed, the exposure time suitable for the welding speed is calculated; based on the reflected light intensity, the preset exposure gain matched with it is obtained, which can be determined according to the reflected light intensity level, such as: the reflected light intensity is low, the gain is set to 11-20dB; the reflected light intensity is medium, the gain is set to 6-10dB; the reflected light intensity is high, the gain is set to 0-5dB.

[0050] In addition, when the ROI position correction, diaphragm control, exposure parameter adjustment and symmetry angle control are synchronously and adaptively completed based on the collected welding working condition parameters, the linkage priority is preset, and each item is completed in the order of linkage priority; wherein the linkage priority order from high to low is respectively ROI position correction (to ensure that the weld is in the field of view, otherwise other parameter adjustment is meaningless), optical axis angle optimization (to suppress the reflected light core, which is prior to light field and exposure), variable diaphragm control (light flux basic control) and exposure parameter adjustment (fine optimization of image brightness and details).

[0051] In one specific embodiment, in order to further improve the defect recognition ability of different working condition areas, a regional precise control system based on multi-parameter linkage is realized; the method further comprises: The target welding area is divided, which can be divided according to the welding track preset division range. The working condition parameters of the welding object in each divided target welding area are obtained, including: the number of material types, the surface curvature, the historical welding defect type and the density; the regional material characteristics can be divided into single material area and multi-material transition area; the regional surface characteristics can be divided into plane area, low curvature area and high curvature area; according to the historical regional welding material characteristics, the regional historical welding defect type can be divided into micro defect sparse area and preset defect sparse area.

[0052] It is judged whether the working condition parameters of the welding object in each divided sub-target welding area are greater than the corresponding preset working condition parameter threshold, such as: the preset material type number parameter, the preset surface curvature threshold, and the preset micro defect density threshold; it is judged whether the difference between the working condition parameters of the welding object in each two adjacent sub-target areas is greater than the preset working condition parameter difference, such as: the preset material type number parameter difference, the preset surface curvature difference, and the preset micro defect density difference.

[0053] Obtain the planned welding track in the target welding area, and mark the sub-target welding area with a greater than the corresponding preset working condition parameter threshold and the adjacent sub-target area with a greater than the corresponding preset working condition parameter difference based on the target welding area division. The reason for marking is that the sub-target welding area with a greater than the corresponding preset working condition parameter threshold often has complex material properties, high complex curvature and high density defects, and requires more accurate image acquisition and identification. If there are complex material changes, curvature changes and multiple defects in the same area, the parameters of the camera device and the emitting device need to be continuously adjusted adaptively, therefore, the area is marked in advance to take measures to ensure that the subsequent image sequence is generated more accurately. Similarly, if there are large differences in material properties, curvature and other changes between adjacent areas, the area is marked in advance to take measures to ensure that the subsequent emitting light field structure and image sequence are generated more accurately.

[0054] Specifically, multiple camera devices are arranged for the sub-target welding area with a greater than the corresponding preset working condition parameter threshold. By using multiple camera devices, image sequences are acquired under the same welding situation, so that errors caused by continuous adjustment of parameters of a single camera device are excluded through redundant image sequences. Correspondingly, the angle between the lens optical axis of each camera device and the welding surface and the laser projection angle are symmetrically distributed, so that multiple image sequences are used for defect feature extraction and classification comprehensive identification.

[0055] Specifically, multiple sets of laser imaging devices and camera devices are arranged for the adjacent sub-target welding area with a greater than the corresponding preset working condition parameter difference. Different areas can replace different laser imaging devices for projection, further excluding errors caused by continuous adjustment of parameters of a single projection device, so that the structured light field projection and image sequence generation of one sub-target welding area in the adjacent sub-target welding area are completed for each set of laser imaging devices and camera devices.

[0056] In addition, in order to further assist the setting of laser imaging devices and camera devices in different areas, multiple groups of modular laser imaging devices and camera devices can be prearranged to adapt to the working condition parameter characteristics of the welding object in different areas. For example, based on the working condition parameter characteristics of the welding object, a basic acquisition module is set to match the basic laser imaging device and camera device, a high light reflection adaptation module is set to match a set of laser imaging device and camera device containing linear polarization, polarizer and narrowband filter group, a complex curved surface adaptation module is set to match a set of laser imaging device and camera device containing deformable structured light and 3D point cloud acquisition, and a microscopic defect dense adaptation module is set to match a set of laser imaging device and camera device containing multi-band light source and high pixels. According to the working condition parameter characteristics of the welding object in the next area, a matched set of laser imaging device and camera device is called in advance.

[0057] One specific embodiment, unlike the above embodiment, is that the timing characteristics of the 3D point cloud data generated by structured light field projection, image sequence are taken as the core input, the imaging, light source, polarization, optical and other collection parameters and welding working condition parameters are fused to construct a multi-dimensional decision space, and the full-link algorithm dynamic adaptation from gray processing to depth network fusion is realized; the accuracy and comprehensiveness of defect feature extraction are further improved, and the precision of defect classification and identification is improved; the method further comprises: Real-time collection of structured light field projection and image sequence generation operation process parameters, including: projection parameters, 3D point cloud parameters and image sequence timing parameters, etc. Among them, the structured light projection parameters include: stripe density, projection angle, power, frame synchronization frequency, etc.; 3D point cloud data includes depth value, point cloud density, surface curvature, etc. to reflect the surface morphology, micro concave-convex, density mutation caused by pores, which can be realized by various sensors. Image sequence timing parameters include: frame sequence gray value, frame sequence noise timing, etc. to distinguish real defects from transient interference. Imaging, light source, polarization, optical and other parameters can also be collected, such as: polarization state; the real-time collected operation process parameters are associated with the welding working condition parameters to form a real-time fusion parameter set.

[0058] Based on the real-time fusion parameter set, adaptive defect feature extraction optimization and defect classification and identification algorithm adaptation are performed. Among them, the premise of adaptive defect feature optimization is to perform feature extraction to obtain the following real-time fusion parameter features: In the formula, v is the speed, I is the current, U is the voltage, P is the laser power, M is the material, R is the reflectivity, C is the curvature, S is the stripe density, is the point cloud density, is the depth variance, is the inter-frame gray scale change, is the region stability.

[0059] Considering the material properties, process requirements, defect morphology and online detection constraints of automobile trim welding, based on typical working conditions, specific adaptive gray processing, edge detection, feature extraction methods and neural network structure design methods are set to complete feature extraction and defect recognition optimization.

[0060] First, adaptive defect feature extraction optimization includes: Edge detection optimization: based on the real-time fusion parameter set, set the preset scene corresponding parameter threshold, determine the preset scene based on the parameters of the real-time fusion parameter set, dynamically switch the edge detection algorithm suitable for the preset scene to which the current real-time fusion parameter set belongs for edge detection. Among them, the edge detection algorithm matched by different preset scenes is different, and at least two of the 2D edge fusion detection algorithm, the time sequence edge tracking algorithm and the 3D normal vector guided edge enhancement algorithm are matched by each preset scene.

[0061] Specifically, the preset scene is based on typical welding conditions, and the parameter threshold is set based on parameter statistical analysis under typical welding conditions, such as: the first preset scene: high-speed welding (v 30mm / s) and time sequence stability ( 0.8), the corresponding edge detection algorithm set to adapt to it is: time sequence edge tracking (retaining edges for more than 2 consecutive frames, filtering false edges with no depth change); the second preset scene: complex curved surface (C 0.8) and point cloud integrity ( 250 points / mm²), the corresponding edge algorithm set to adapt to it is 3D curvature gradient and 2D edge fusion detection algorithm, that is, the point cloud curvature gradient graph is calculated, and logical AND operation is performed with the 2D Canny edge graph, only the real edges with 2D edge and 3D curvature mutation are retained; the third preset scene: large depth variance ( >8um), the corresponding edge algorithm set to adapt to it is: 3D normal vector guided edge enhancement, that is, the gradient calculation direction is adjusted based on the 3D normal vector direction (0° / 45° / 90° / 135°+normal vector direction), and the edge positioning is determined by combining 2D gradient and 3D depth mutation point.

[0062] Feature extraction optimization: in addition to calculating contour geometric parameters and gray level co-occurrence matrix parameters and extracting 2D texture features (energy, entropy, contrast, correlation), 2D edge features (edge length, edge gradient amplitude, edge closure), 3D space features (depth difference (ΔZ), point cloud density ( ), curvature (C) and the like) are also extracted.

[0063] Second, the adaptive defect classification and recognition algorithm adaptation includes; The system sets threshold parameters for feature vectors corresponding to preset scenarios, determines the preset scenario based on the extracted feature vectors, and dynamically switches the neural network that matches the preset scenario to which the currently extracted feature vector belongs. The network branches and network structures of the preset matching neural networks differ for different scenarios. For example, the first preset scenario matches the first neural network, whose structure is a pruned version of YOLOv8n and a temporal feature compression branch (3D feature branches are closed, only 2D and temporal features are retained; channel pruning rate is 50%); the second preset scenario matches the second neural network, whose structure is YOLOv8s, a 3D feature fusion branch, and ECA attention.

[0064] In addition, if multiple regions are divided, a real-time fusion parameter set is generated for each region, and feature extraction and defect classification and recognition optimization are performed for each region's real-time fusion parameter set.

[0065] like Figure 2 As shown, this embodiment discloses an online identification system for surface defects in laser welding of automotive trim parts, specifically including: The structured light field projection module 101 is used to project a structured light field onto the welding surface; the generation steps of the structured light field include: acquiring the coordinate information of the welding area through the visual positioning sensor in the laser imaging device; driving the three-dimensional adjustment mechanism in the laser imaging device to perform spatial displacement compensation so that the deviation between the center of the laser spot and the center line of the weld seam is less than a preset deviation; and adjusting the aperture range of the aperture according to the thickness of the welding material through the adjustable aperture assembly connected in series in the laser imaging device. The reflected light image acquisition module 102 is used to capture the reflected light of the structured light field in real time to form an image sequence. The steps of capturing reflected light in real time include: setting the angle between the lens optical axis and the welding surface to be symmetrically distributed with the laser projection angle; receiving the pulse signal output by the encoder of the welding equipment to trigger the shooting, and adjusting the exposure time to a preset mapping range according to the real-time light intensity feedback; the preset mapping range is obtained through a mapping relationship database between light intensity and exposure parameters. The defect feature extraction and recognition module 103 is used to extract defect features and classify and recognize defects in the image sequence. The feature extraction steps include: noise reduction processing using Gaussian filter template size; edge extraction using edge detection algorithm; and calculation of contour geometric parameters and gray-level co-occurrence matrix parameters to extract features. The classification and recognition steps include: defect classification and recognition using a residual neural network with integrated feature attention mechanism. The welding process parameter adjustment module 104 is used to transmit the defect identification results to the welding equipment controller; based on the defect identification results, the welding process parameters are adjusted according to the pre-stored mapping relationship table between different defect types and welding parameters.

[0066] In one specific embodiment, the system further includes: The working condition parameter acquisition module 105 is configured to acquire welding working condition parameters in real time; the welding working condition parameters include welding speed, weld offset, reflected light intensity, and surface curvature.

[0067] The projection and acquisition optimization module 106 is configured to adaptively complete any one of ROI position correction, diaphragm control, exposure parameter adjustment, and symmetric angle control based on the acquired welding working condition parameters; and when several of the ROI position correction, diaphragm control, exposure parameter adjustment, and symmetric angle control are adaptively completed simultaneously based on the acquired welding working condition parameters, the linkage priority is preset, and each item is completed in the order of the linkage priority.

[0068] In one embodiment, the system further comprises: The projection and acquisition configuration module 107 is configured to divide a target welding area, acquire working condition parameters of a welding object in each divided target welding area, determine whether the working condition parameters of the welding object in each divided sub-target welding area are greater than a corresponding preset working condition parameter threshold value, and whether the difference between the working condition parameters of the welding object in adjacent sub-target areas is greater than a corresponding preset working condition parameter difference value, acquire a planned welding track in the target welding area, mark the sub-target welding area in which the corresponding preset working condition parameter threshold value is greater than the corresponding preset working condition parameter threshold value and the adjacent sub-target area in which the corresponding preset working condition parameter difference value is greater than the corresponding preset working condition parameter difference value in combination with the target welding area division, set a plurality of camera devices for the sub-target welding area in which the corresponding preset working condition parameter threshold value is greater than the corresponding preset working condition parameter threshold value, and the angle between the optical axis of each camera device and the welding surface is symmetrically distributed with the laser projection angle, so that the defect feature extraction and classification comprehensive identification are performed by using a plurality of image sequences, and a plurality of sets of laser imaging devices and camera devices are provided for the adjacent sub-target welding area in which the corresponding preset working condition parameter difference value is greater than the corresponding preset working condition parameter difference value, and the structured light field projection and image sequence generation of one sub-target welding area in the adjacent sub-target welding area are completed for each set of laser imaging devices and camera devices.

[0069] In one embodiment, the system further comprises: The working condition parameter acquisition module 105 is further configured to acquire working condition parameters of the structured light field projection and image sequence generation in real time, including projection parameters, 3D point cloud parameters, and image sequence timing parameters; and associate the acquired working condition parameters with the welding working condition parameters to form a real-time fusion parameter set.

[0070] The feature extraction and recognition optimization module 108 is configured to adaptively perform defect feature extraction optimization and defect classification recognition algorithm adaptation based on the real-time fusion parameter set. The adaptive defect feature extraction optimization includes: setting a preset scene corresponding parameter threshold based on the real-time fusion parameter set, determining a preset scene to which the real-time fusion parameter set belongs based on parameters of the real-time fusion parameter set, and dynamically switching an edge detection algorithm adapted to the preset scene to which the current real-time fusion parameter set belongs to perform edge detection. In addition to calculating contour geometric parameters and gray level co-occurrence matrix parameters to extract 2D texture features and 2D edge features, 3D space features are also extracted. The adaptive classification recognition algorithm adaptation includes: setting a preset scene corresponding feature vector parameter threshold, determining a preset scene to which an extracted feature vector belongs, and dynamically switching a neural network matched with the preset scene to which the extracted feature vector belongs. Different preset matched neural networks have different network branches and network structures.

[0071] The embodiment of the application further discloses a computer readable storage medium.

[0072] Specifically, the computer readable storage medium stores a computer program capable of being loaded and executed by the processor to implement the online identification method for surface defects of laser welding of automobile ornaments, and the computer readable storage medium includes various program code storage media such as a U disk, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.

[0073] The embodiment of the application further discloses a computer device.

[0074] Specifically, the computer device includes a memory and a processor, and the memory stores a computer program capable of being loaded and executed by the processor to implement the online identification method for surface defects of laser welding of automobile ornaments.

[0075] The above are preferred embodiments of the application, and do not limit the protection scope of the application. Any feature disclosed in the specification (including the abstract and the drawings) can be replaced by other equivalent or similar features unless specifically described. That is, each feature is only an example of a series of equivalent or similar features unless specifically described.

Claims

1. An online identification method for surface defects of laser welding of automobile trim parts, characterized in that, Comprising: Projecting a structured light field to the welding surface; The generation step of the structured light field comprises: acquiring the coordinate information of the welding area by the visual positioning sensor in the laser imaging device; driving the three-dimensional adjusting mechanism in the laser imaging device to perform spatial displacement compensation, so that the center of the laser spot is deviated from the center line of the welding seam by less than a preset deviation; adjusting the aperture range of the adjustable diaphragm assembly in series in the laser imaging device according to the thickness of the welding material; Real-time capture of the reflected light of the structured light field to form an image sequence; the step of real-time capturing the reflected light comprises: setting the included angle between the lens optical axis of the camera device and the welding surface to be symmetrically distributed with the laser projection angle; receiving the pulse signal output by the encoder of the welding equipment to trigger shooting, and adjusting the exposure time to a preset mapping interval according to the real-time light intensity feedback; the preset mapping interval is obtained through the mapping relationship database of light intensity and exposure parameter; Extracting defect features and classifying and identifying defects from the image sequence; the feature extraction step comprises: noise reduction processing by using a Gaussian filter template size; edge extraction by using an edge detection algorithm, calculation of contour geometric parameters and gray level co-occurrence matrix parameters to extract features; the classification and identification step comprises: classifying and identifying defects by using a residual neural network integrated with a feature attention mechanism; Transmitting the defect identification result to the welding equipment controller; based on the defect identification result, adjusting the welding process parameters according to the pre-stored mapping relationship table of different defect types and welding parameters.

2. The online identification method of the surface defects of the laser welding of the automobile trim part according to claim 1, characterized in that, Further comprising: Real-time acquisition of welding working condition parameters; The welding working condition parameters include: welding speed, weld offset, reflected light intensity, and surface curvature; based on the acquired welding working condition parameters, any one of ROI position correction, diaphragm regulation, exposure parameter adjustment, and symmetric angle regulation is adaptively completed; The ROI position correction comprises: setting a correction trigger condition based on the weld working condition parameters, predicting the next frame ROI position according to the working condition parameters when the correction is triggered, recalibrating the projection position, ensuring that the projection range always covers the next frame ROI position, and adjusting the next frame ROI position to be located at the center of the camera device field of view; the diaphragm regulation comprises: dividing the working condition level based on each parameter in the welding working condition, determining the working condition level and generating the working condition parameter level combination, obtaining the preset diaphragm aperture adjustment range and aperture adaptive shape matched therewith through the working condition parameter level combination, and completing the diaphragm regulation; the symmetric angle regulation comprises: making preset angle correction according to the reflected light intensity based on the design of the reference symmetric angle; and collecting the height data of the weld area by using multiple groups of laser displacement sensors, fitting the normal direction of the curved surface, taking the normal direction as the symmetric axis, adjusting the angle of the camera device in real time, maintaining the symmetric distribution of the included angle between the lens optical axis of the camera device and the welding surface and the laser projection angle, and setting the real-time adjustment step according to the surface curvature; the exposure parameter adjustment comprises: dynamic calculation of the exposure time based on the welding speed to obtain the exposure time adaptive to the welding speed; and obtaining the preset exposure gain matched with the reflected light intensity.

3. The online identification method of the surface defects of the laser welding of the automobile trim part according to claim 2, characterized in that, Further comprising: When the welding working condition parameters are collected, the ROI position correction, diaphragm control, exposure parameter adjustment and symmetric angle control are synchronously and adaptively completed, and the linkage priority is preset, and each item is completed according to the priority order of linkage; wherein the linkage priority order from high to low is ROI position correction, optical axis angle optimization, variable diaphragm control and exposure parameter adjustment.

4. The online identification method of the surface defects of the laser welding of the automobile trim part according to claim 2, characterized in that, Also includes: Divide the target welding area, and obtain the working condition parameters of the welding object in each divided target welding area, including: the number of material types, the curvature of the curved surface, the type and density of historical welding defects; determine whether the working condition parameters of the welding object in each divided sub-target welding area are greater than the corresponding preset working condition parameter threshold, and whether the difference between the working condition parameters of the welding object in adjacent sub-target areas is greater than the corresponding preset working condition parameter difference; Obtain the planned welding trajectory in the target welding area, combine the target welding area division, mark the sub-target welding area with a greater than the corresponding preset working condition parameter threshold, and the adjacent sub-target area with a greater than the corresponding preset working condition parameter difference; set multiple camera devices for the sub-target welding area with a greater than the corresponding preset working condition parameter threshold, and the angle between the lens optical axis of each camera device and the welding surface is symmetrically distributed with the laser projection angle, so that the multiple image sequences are used for defect feature extraction and classification comprehensive identification; for the adjacent sub-target welding area with a greater than the corresponding preset working condition parameter difference, multiple sets of laser imaging devices and camera devices are provided, and for each set of laser imaging devices and camera devices, the structured light field projection and image sequence generation of one sub-target welding area in the adjacent sub-target welding area are completed.

5. The online identification method of the surface defects of the laser welding of the automobile trim part according to claim 1, characterized in that, Also includes: Real-time collection of structured light field projection and image sequence generation job process parameters, including: projection parameters, 3D point cloud parameters and image sequence timing parameters; correlate the real-time collected job process parameters with the welding working condition parameters to form a real-time fusion parameter set; Based on the real-time fusion parameter set, adaptively perform defect feature extraction optimization and defect classification recognition algorithm adaptation; adaptive defect feature extraction optimization includes: based on the real-time fusion parameter set, setting a preset scene corresponding parameter threshold, determining the belonging preset scene based on the parameters of the real-time fusion parameter set, dynamically switching the edge detection algorithm adapted to the current real-time fusion parameter set belonging preset scene for edge detection, different preset scene matching edge detection algorithm, each preset scene matching edge detection algorithm uses at least two of 2D edge fusion detection algorithm, timing edge tracking algorithm and 3D normal vector guided edge enhancement algorithm; in addition to calculating contour geometric parameters and gray level co-occurrence matrix parameters to extract 2D texture features and 2D edge features, 3D space features are also extracted; adaptive classification recognition algorithm adaptation includes: setting a preset scene corresponding feature vector parameter threshold, determining the belonging preset scene based on the extracted feature vector, and dynamically switching the neural network matched with the current extracted feature vector belonging preset scene, the network branch and network structure of the neural network matched with different scene preset are different.

6. The online identification method of the surface defects of the laser welding of the automobile trim part according to claim 1, characterized in that, Also includes: The step of transmitting the defect identification result comprises triggering an interrupt request when the defect information is detected, preempting a data transmission channel to preferentially transmit a data packet containing the defect information, and attaching a cyclic redundancy check code to the data packet.

7. The online identification method of the surface defects of the laser welding of the automobile trim part according to claim 1, characterized in that, Further comprising: The step of generating the structured light field further comprises controlling the polarization direction of the laser through a polarizer, so that the polarization state of the reflected light matches a polarizer in front of a camera lens.

8. An online system for identifying surface defects of laser welding of automobile trim parts, characterized in that, Further comprising: A structured light field projection module is configured to project a structured light field to a welding surface. The step of generating the structured light field comprises: obtaining coordinate information of a welding area through a vision positioning sensor in a laser imaging device; driving a three-dimensional adjustment mechanism in the laser imaging device to perform spatial displacement compensation, so that the center of a laser spot deviates from the center line of a welding seam by less than a preset deviation; and adjusting the aperture range of an adjustable diaphragm assembly in series in the laser imaging device according to the thickness of a welding material; A reflected light image acquisition module is configured to capture a reflected light image sequence of the structured light field in real time. The step of capturing the reflected light in real time comprises: setting the included angle between the optical axis of a lens and the welding surface to be symmetrically distributed with the laser projection angle; triggering shooting by receiving a pulse signal output by a welding equipment encoder, and adjusting the exposure time to a preset mapping interval according to real-time light intensity feedback; the preset mapping interval is obtained through a mapping relationship database of light intensity and exposure parameters. A defect feature extraction and identification module is configured to perform defect feature extraction and defect classification identification on the image sequence. The feature extraction step comprises: performing noise reduction processing using a Gaussian filter template size; performing edge extraction using an edge detection algorithm, and calculating contour geometric parameters and gray level co-occurrence matrix parameters to extract features; the classification identification step comprises: performing defect classification identification through a residual neural network integrated with a feature attention mechanism. A welding process parameter adjustment module is configured to transmit the defect identification result to a welding equipment controller. Based on the defect identification result, a mapping relationship table of different defect types and welding parameters is pre-stored, and the welding process parameters are adjusted.

9. A computer-readable storage medium, characterized in that, The computer readable storage medium comprises a stored computer program, wherein the computer program controls the device in which the computer readable storage medium is located to perform the method of any one of claims 1 to 7 when the computer program is running.

10. A computer device, comprising: The computer device comprises a memory, a processor, and a program stored on the memory and executable by the processor, and the program is executed by the processor to implement the steps of the method of any one of claims 1 to 7.