A method and system for detecting automobile body welds based on machine vision

By using high-definition camera and template matching algorithm in the weld detection system, combined with dynamic window scanning technology and feature extraction, weld morphological adaptability is evaluated and divided, the misjudgment and missed detection problems in complex weld morphological detection are solved, and high-precision welding quality detection is achieved.

CN119574571BActive Publication Date: 2025-05-06CHANGCHUN GUANGHUA UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510132392.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-02-06
Publication Date
2025-05-06
Estimated Expiration
2045-02-06

AI Technical Summary

Technical Problem

Existing automotive body weld detection technology based on machine vision is difficult to adapt to complex three-dimensional weld forms, which may lead to misjudgment or missed inspection.

Method used

Weld images are captured in real time through a high-definition camera, and template matching algorithms are used for identification and positioning. Combined with dynamic window scanning technology and feature extraction such as curvature changes and surface roughness, the algorithm's adaptability to the diversity of welds is evaluated and divided into high, general, and low adaptation levels for processing.

Benefits of technology

It realizes accurate identification and detection of complex weld forms, reduces the risk of misjudgment and missed inspection, and improves the detection accuracy and production efficiency of welding quality.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119574571B_ABST
    Figure CN119574571B_ABST
Patent Text Reader

Abstract

The present invention discloses a method and system for detecting welds of automobile bodies based on machine vision, and specifically relates to the technical field of weld detection. The method captures weld images in real time through a high-definition camera and locates the welds using a template matching algorithm. Then, the dynamic window scanning technology is used to calculate the weld width and identify complex morphological areas. Then, the curvature change and surface roughness characteristics of the welds are extracted, the adaptability of the algorithm to complex morphologies is evaluated, and classification processing is performed according to the adaptability level. For areas with high adaptability levels, the system automatically determines that they are qualified. For areas with low adaptability levels, an early warning is generated and data is saved. For areas with general adaptability levels, the accuracy is improved through a dynamic optimization algorithm, which effectively improves the detection accuracy, reduces rework and missed detection, and improves the system's adaptability to various weld morphologies.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of weld detection, and in particular to a method and system for detecting welds of an automobile body based on machine vision. Background Art

[0002] Automobile body weld inspection based on machine vision is the process of automatically inspecting the quality of automobile body welding using computer vision technology. The image or video data of the weld is collected through the camera or sensor installed on the production line. Then, the system analyzes the appearance characteristics of the weld, such as the width, depth, position, surface defects, etc. of the weld through image processing algorithms, so as to determine whether the welding quality meets the standards. This technology can replace manual visual inspection, improve detection accuracy and efficiency, and reduce human errors. It can automatically identify and locate welds, detect cracks, pores or irregular welding in welding, help timely discover and correct welding defects in the body manufacturing process, ensure the reliability and consistency of welding, and improve the overall production quality of the car.

[0003] The prior art has the following deficiencies:

[0004] In the automotive welding scenario, welds are not simple straight lines or regular shapes, and complex three-dimensional weld shapes may appear. This complexity mainly arises in the design of certain specific parts of the car body, such as corners, bends, or overlapping areas of doors or hoods. In these areas, the welds will have irregular shapes, widen or narrow, or bend in a certain direction. This irregularity may be similar to the shape of welding defects (such as pores or irregular welds). If the algorithm in the machine vision system cannot adapt to the diversity of complex weld shapes, it may misjudge these design features as defective welds, resulting in unnecessary rework or false alarms. Conversely, if the system mistakes certain serious defects for normal weld shapes, these defects will also be missed, thereby affecting the welding strength. Summary of the invention

[0005] The purpose of the present invention is to provide a method and system for detecting automobile body welds based on machine vision to solve the shortcomings of the background technology.

[0006] In order to achieve the above object, the present invention provides the following technical solution: a method for detecting a weld of an automobile body based on machine vision, comprising the following steps:

[0007] S1: The high-definition camera installed on the production line captures the image data of the weld in real time, pre-processes the captured image data, and uses the template matching algorithm to identify and locate the position of the weld in the image;

[0008] S2: After locating the weld, the width of the weld is calculated by the distance between the two edges of the weld. The width of the weld is analyzed section by section using dynamic window scanning technology, and the complex morphology area of ​​the weld is determined based on the analysis results.

[0009] S3: For welds with complex morphology, feature extraction is performed on the weld morphology data. Based on the extracted curvature change characteristics of the weld and the roughness characteristics of the weld surface, the adaptability of the algorithm in the machine vision system to the diversity of weld morphology is evaluated;

[0010] S4: According to the evaluation results, the adaptability of the algorithm in the machine vision system to the diversity of weld morphology is divided into different levels, namely, high adaptability level, general adaptability level and low adaptability level, and corresponding processing is performed;

[0011] S5: For weld complex morphology areas with high adaptability levels, the weld inspection results are automatically judged as qualified and directly pass the inspection; for weld complex morphology areas with low adaptability levels, an early warning signal is automatically generated, and the collected weld morphology diversity data is saved;

[0012] S6: For welds with complex morphology of general adaptability level, the accuracy of the inspection results within a fixed time period is deeply analyzed and predicted, and the algorithm is dynamically optimized based on the prediction results.

[0013] Preferably, in S1, a template matching algorithm is used to identify welds on the preprocessed image, specifically: the image is divided into several small areas, the weld template is matched area by area, the area closest to the template is found, a sliding window technique is used on the entire image, the weld area is scanned pixel by pixel, for each window area, a similarity is calculated with the template, a similarity score is obtained, the template is compared with the actual weld morphology in the image, and when the similarity score is greater than or equal to a preset threshold, the area is confirmed to be the location of the weld.

[0014] Preferably, in S2, in each image frame, the left edge and the right edge of the weld are determined, and the width of the weld can be obtained by calculating the distance between the two edges. Move pixel by pixel along the main axis of the weld, and each pixel point corresponds to a direction perpendicular to the center line of the weld. The distance from the left edge to the right edge is calculated, which is the width value of the weld. The weld width value of each point is associated with its position coordinates in the weld path and recorded to form a curve about the change of weld width with weld length. A scanning window of a fixed size is set, and it will slide step by step along the weld path. Each time a scan is performed, the window will contain multiple weld width values. In each window, the rate of change of the weld width is calculated, and the standard deviation of the weld width in the regional window is calculated. The weld width is compared with the width value preset in the template. If the width is greater than or equal to the preset standard width value, it is marked as a weld complex morphology area; if the width is less than the preset standard width value, it is marked as a weld simple morphology area.

[0015] Preferably, in S3, a curvature change rate fluctuation index is generated according to the extracted curvature change characteristics of the weld, and the method for obtaining the curvature change rate fluctuation index is:

[0016] The curvature κ(s) of the weld is calculated along the path of the weld, where s represents the parameterized coordinate of the weld length, and the curvature change rate formula is: The calculated curvature change rate sequence is used as a signal, and discrete Fourier transform is applied to perform frequency domain analysis. The weld path length is discretized into N equally spaced sampling points, and the curvature change rate data at the sampling points are obtained. ;in, is the curvature change rate of the nth sampling point. DFT is applied to convert the curvature change rate sequence into the frequency domain to obtain the frequency component , the expression is: ; In the formula, j is the imaginary unit, k is the frequency index, which represents the different frequency components of the signal, and calculates the strength of the signal at each frequency: ; is the energy spectrum at frequency k; set the lower limit Klow and upper limit Khigh of the high frequency interval, and calculate the curvature change rate fluctuation index, the expression is: ; Where KH is the curvature change rate fluctuation index.

[0017] Preferably, a surface peak density anomaly index is generated according to the extracted roughness characteristics of the weld surface, and the method for obtaining the surface peak density anomaly index is:

[0018] All peak points are detected in the height map or grayscale map of the weld surface through the local extreme value detection algorithm, the height data of the weld surface is obtained, and the local maximum value is found in the weld surface, that is, the protrusion point on the surface. If the weld surface height map is Z(x,y), the local maximum value satisfies: ;in is the neighborhood of point (x, y), recording the coordinates of all local peak points And the corresponding height , and get the peak point set: ; Use the Gaussian mixture model to model the spatial distribution of surface peaks and find several Gaussian distributions representing normal and abnormal peak points. The expression is: ; In the formula, is the two-dimensional spatial coordinate of the peak point, is the kth Gaussian distribution with mean , the covariance matrix is , is the weight of the kth Gaussian distribution, satisfying , K is the number of mixed Gaussian distributions, and for each data point The probability of belonging to the kth Gaussian distribution , the expression is: ; The Gaussian mixture model is used to calculate the probability that each peak point belongs to a Gaussian distribution. For each peak point , calculate the probability that it belongs to the Gaussian mixture model, the expression is: ;if If the value is less than the set abnormal threshold, it is considered to be an abnormal point. The abnormal threshold is usually set to a minimum value. The probability of all peak points is calculated, and the points less than the abnormal threshold are marked as abnormal points to obtain the abnormal peak point set. The abnormal peak points are counted and the surface peak density abnormal index is calculated. The expression is: ; Where M is the number of outlier points, P is the total number of peak points, and KM is the surface peak density anomaly index.

[0019] Preferably, the curvature change rate fluctuation index and the surface peak density anomaly index are converted into a first eigenvector, and the first eigenvector is used as the input of the machine learning model. The machine learning model predicts the adaptability value label of the algorithm in the machine vision system to the weld morphology diversity with each group of first eigenvectors as the prediction target, and minimizes the sum of the prediction errors of the adaptability value labels of the algorithms in all machine vision systems to the weld morphology diversity as the training target. The machine learning model is trained until the sum of the prediction errors converges, then the model training is stopped, and the adaptability value of the algorithm in the machine vision system to the weld morphology diversity is determined according to the model output results, wherein the machine learning model is a polynomial regression model.

[0020] Preferably, in S4, according to the evaluation result, the adaptability of the algorithm in the machine vision system to the diversity of weld morphology is divided into different levels;

[0021] The obtained adaptability value of the algorithm in the machine vision system to the diversity of weld morphology is compared with the gradient standard threshold, the gradient standard threshold includes a first standard threshold and a second standard threshold, and the first standard threshold is less than the second standard threshold, and the adaptability value of the algorithm in the machine vision system to the diversity of weld morphology is compared with the first standard threshold and the second standard threshold respectively;

[0022] If the adaptability value of the algorithm in the machine vision system to the diversity of weld morphology is greater than the second standard threshold, it means that the algorithm in the machine vision system has high adaptability to the diversity of weld morphology, and a high adaptability signal is generated at this time, and it is classified as a high adaptability level;

[0023] If the adaptability value of the algorithm in the machine vision system to the diversity of weld seam shapes is greater than or equal to the first standard threshold and less than or equal to the second standard threshold, it means that the adaptability of the algorithm in the machine vision system to the diversity of weld seam shapes is general, and a general adaptability signal is generated at this time, which is classified as a general adaptability level;

[0024] If the adaptability value of the algorithm in the machine vision system to the diversity of weld morphology is less than the first standard threshold, it means that the adaptability of the algorithm in the machine vision system to the diversity of weld morphology is low. At this time, a low adaptability signal is generated and it is classified as a low adaptability level.

[0025] Preferably, in S6, for the complex morphology area of ​​the weld of the general adaptation level, the accuracy of the detection result within a fixed time period is deeply analyzed and predicted, and the algorithm is dynamically optimized according to the prediction result;

[0026] For complex morphological areas of welds with general adaptability levels, that is, the adaptability values ​​generated within a fixed time period are greater than or equal to the first standard threshold and less than or equal to the second standard threshold, the adaptability values ​​generated within the subsequent fixed time period that are greater than or equal to the first standard threshold and less than or equal to the second standard threshold are collected, and the corresponding data set is established. The mean and standard deviation of the data set are calculated, and after analysis and prediction, the algorithm is dynamically optimized according to the prediction results.

[0027] Preferably, if the mean value of the adaptability values ​​in the data set is greater than or equal to the reference threshold value of the mean value of the adaptability values, and the standard deviation of the adaptability values ​​is less than the reference threshold value of the standard deviation of the adaptability values, it indicates that the adaptability of the weld is stable and the overall performance is good. At this time, no warning signal is generated, and the production efficiency is further optimized;

[0028] If the mean value of the adaptability value is greater than or equal to the reference threshold of the mean value of the adaptability value, and the standard deviation of the adaptability value is greater than or equal to the reference threshold of the standard deviation of the adaptability value, the algorithm has good adaptability but there are fluctuations. At this time, a third-level warning signal is generated, and targeted adjustments are made to the high volatility area, the detection strength for complex forms is increased, and the model is optimized;

[0029] If the mean value of the adaptability value is less than the reference threshold value of the mean value of the adaptability value, and the standard deviation of the adaptability value is greater than or equal to the reference threshold value of the standard deviation of the adaptability value, it indicates that the system has poor adaptability performance during this period of time and the adaptability value fluctuates greatly. At this time, a first-level warning signal is generated and deep algorithm optimization is performed;

[0030] If the mean of the adaptability values ​​is less than the reference threshold of the mean of the adaptability values, and the standard deviation of the adaptability values ​​is less than the reference threshold of the standard deviation of the adaptability values, the adaptability performance is poor but the stability is good, indicating that the algorithm has consistent adaptability to the weld morphology. At this time, a secondary warning signal is generated and the overall algorithm is systematically optimized.

[0031] The present invention also provides a machine vision-based automobile body weld detection system, comprising an image capture module, a weld width calculation module, an adaptability evaluation module, an adaptability division module, a high and low adaptability area processing module, and a dynamic optimization module;

[0032] Image capture module: The high-definition camera installed on the production line captures the image data of the weld in real time, pre-processes the captured image data, and uses the template matching algorithm to identify and locate the position of the weld in the image;

[0033] Weld width calculation module: After locating the weld, the weld width is calculated by the distance between the two edges of the weld. The dynamic window scanning technology is used to analyze the weld width section by section, and the complex shape area of ​​the weld is determined based on the analysis results.

[0034] Adaptability evaluation module: For welds with complex morphology, feature extraction is performed on the weld morphology data. Based on the extracted curvature change characteristics of the weld and the roughness characteristics of the weld surface, the adaptability of the algorithm in the machine vision system to the diversity of weld morphology is evaluated;

[0035] Adaptability classification module: According to the evaluation results, the adaptability of the algorithm in the machine vision system to the diversity of weld morphology is divided into different levels, namely high adaptability level, general adaptability level and low adaptability level, and corresponding processing is performed;

[0036] High and low adaptability area processing module: For weld complex morphology areas with high adaptability levels, the weld inspection results are automatically judged as qualified and directly pass the inspection; for weld complex morphology areas with low adaptability levels, an early warning signal is automatically generated, and the collected weld morphology diversity data is saved;

[0037] Dynamic Optimization Module: For welds with complex morphology of general adaptability level, the accuracy of the detection results within a fixed time period is deeply analyzed and predicted, and the algorithm is dynamically optimized based on the prediction results.

[0038] In the above technical solution, the technical effects and advantages provided by the present invention are:

[0039] 1. The present invention uses a high-definition camera to capture weld images in real time and uses a template matching algorithm to accurately locate welds. Combining dynamic window scanning technology and feature extraction such as curvature change and surface roughness, the system can effectively identify complex morphological areas of welds and quantify the complexity of weld morphology through discrete Fourier transform and Gaussian mixture model and other technologies. The solution automatically divides weld inspection results into high, medium and low adaptability levels through adaptability evaluation and performs corresponding processing, thereby achieving efficient and accurate weld inspection.

[0040] 2. The present invention can adaptively optimize the algorithm within a fixed time period by analyzing the detection data of the general adaptation level area to ensure that the detection accuracy is continuously improved. By dynamically collecting adaptability values ​​and generating early warning signals, the system can make targeted adjustments or optimizations according to different fluctuations, greatly improving the robustness of the algorithm and the stability of weld detection, while improving production efficiency and reducing the risk of rework and production stagnation. BRIEF DESCRIPTION OF THE DRAWINGS

[0041] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in the present invention. For ordinary technicians in this field, other drawings can also be obtained based on these drawings.

[0042] Figure 1 The present invention is a flow chart of the method.

[0043] Figure 2 It is a system module diagram of the present invention. DETAILED DESCRIPTION

[0044] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0045] Example 1, please refer to Figure 1As shown, the automobile body weld detection method based on machine vision described in this embodiment includes the following steps:

[0046] S1: The high-definition camera installed on the production line captures the image data of the weld in real time, pre-processes the captured image data, and uses the template matching algorithm to identify and locate the position of the weld in the image;

[0047] S2: After locating the weld, the width of the weld is calculated by the distance between the two edges of the weld. The width of the weld is analyzed section by section using dynamic window scanning technology, and the complex morphology area of ​​the weld is determined based on the analysis results.

[0048] S3: For welds with complex morphology, feature extraction is performed on the weld morphology data. Based on the extracted curvature change characteristics of the weld and the roughness characteristics of the weld surface, the adaptability of the algorithm in the machine vision system to the diversity of weld morphology is evaluated;

[0049] S4: According to the evaluation results, the adaptability of the algorithm in the machine vision system to the diversity of weld morphology is divided into different levels, namely, high adaptability level, general adaptability level and low adaptability level, and corresponding processing is performed;

[0050] S5: For weld complex morphology areas with high adaptability levels, the weld inspection results are automatically judged as qualified and directly pass the inspection; for weld complex morphology areas with low adaptability levels, an early warning signal is automatically generated, and the collected weld morphology diversity data is saved;

[0051] S6: For welds with complex morphology of general adaptability level, the accuracy of the inspection results within a fixed time period is deeply analyzed and predicted, and the algorithm is dynamically optimized based on the prediction results.

[0052] Among them, in S1, the image data of the weld is captured in real time by a high-definition camera installed on the production line, and the captured image data is preprocessed, and the position of the weld in the image is identified and located using a template matching algorithm;

[0053] Camera installation and setup: Install high-definition cameras at critical welding areas on the production line to ensure that the camera can clearly capture all details of the weld. Depending on the specific location of the weld (such as the edge of the door or the hood area), adjust the angle and focal length of the camera to ensure that the field of view covers the entire weld area.

[0054] Light source control: Install appropriate lighting equipment to avoid reflections and shadows that interfere with the quality of the weld image. Use LED light sources or laser auxiliary lighting to ensure that light is evenly distributed in the weld area.

[0055] Real-time data capture: The camera captures the image data of the weld in real time at a fixed frame rate (e.g. 30 frames / second), ensuring that the dynamic image of the weld can be continuously obtained while the production line is running. The image data is transmitted to the processing system using a high-speed interface (such as GigE or USB 3.0).

[0056] De-noise the weld images collected in real time to filter out the noise introduced by dust, reflections or mechanical vibrations in the industrial environment. Gaussian filtering, mean filtering and other techniques can be used to smooth the image. Image enhancement techniques such as histogram equalization or contrast adjustment can be used to improve the contrast between the weld area and the background to make the weld edge clearer. Binarize the weld image to distinguish the weld part from the non-weld part in the image. Segmentation can be performed based on grayscale thresholds to make the weld present a clear contrast between white (weld) and black (background) in the image.

[0057] According to the welding scheme used in the production process, a standard template for the weld is created in advance. The template can be based on the actual weld morphology, such as a straight weld, a curved weld, or a three-dimensional weld of a specific shape. The template can be a preset shape contour or generated by a sample image of a qualified weld in previous production. The template matching algorithm (such as the normalized cross-correlation method, the Hausdorff distance method, etc.) is used to identify the weld on the preprocessed image. The specific steps are as follows:

[0058] The image is divided into several small areas, and the weld template is matched area by area to find the area closest to the template.

[0059] The sliding window technique is used on the entire image to scan the weld area pixel by pixel. For each window area, the similarity is calculated with the template to obtain a similarity score.

[0060] The template is compared with the actual weld shape in the image. When the similarity score is greater than or equal to the preset threshold, the area is confirmed to be the location of the weld.

[0061] S2: After locating the weld, the width of the weld is calculated by the distance between the edges on both sides of the weld. The width of the weld is analyzed section by section using dynamic window scanning technology, and the complex morphology area of ​​the weld is determined based on the analysis results.

[0062] After the weld is located, the weld image is edge enhanced and denoised, and the edges on both sides of the weld are extracted using the classic Canny edge detection algorithm or the Sobel operator. Through these algorithms, the system can identify the left and right edges of the weld to form a continuous boundary line. After edge extraction, the result is that the edge contour of the weld is marked in the image with pixel-level resolution.

[0063] In each image frame, the left and right edges of the weld are determined. By calculating the distance between these two edges, the width of the weld can be obtained. The system moves pixel by pixel along the main axis of the weld, and each pixel point corresponds to a direction perpendicular to the centerline of the weld, and calculates the distance between the left edge and the right edge. This distance is the width value of the weld at that point. In this way, the system can calculate the width point by point along the entire length of the weld, generating a continuous set of width data.

[0064] The weld width value of each point is recorded in association with its position coordinates in the weld path to form a curve about the change of weld width with weld length. Dynamic window scanning technology is to analyze the weld width in sections according to a certain step length and window size on the weld. This technology allows local scanning of the weld to capture subtle changes in the weld morphology. Set a fixed-size scanning window (for example, 50 pixels), which will slide step by step along the weld path. Each time it is scanned, the window will contain multiple weld width values, and the system will analyze the width in the window. In each window, the system calculates the rate of change of the weld width. If the weld width in the current window changes greatly (for example, the width fluctuation exceeds a certain threshold), the segment is marked as a possible complex morphology area. Calculate the standard deviation of the weld width in the window of the possible complex morphology area. A higher standard deviation indicates that the weld width fluctuates greatly and there may be a complex morphology. Compare the weld width of this segment with the preset width value in the template. If the width is greater than or equal to the preset standard width value, it is marked as a weld complex morphology area; if the width is less than the preset standard width value, it is marked as a weld simple morphology area.

[0065] Based on the results of the segment-by-segment width analysis, the system divides the weld into simple morphology areas and complex morphology areas: In the simple morphology area, the weld width changes slightly, the change rate is low, and the width is close to the standard value set by the template, indicating that the welding morphology in this area is relatively regular. In the complex morphology area, the weld width changes greatly, and may bend, widen, narrow or have other abnormal features. The morphology of these areas may be related to the welding process, such as the corners of the car door or the overlapping area.

[0066] For complex morphological areas with large width variations, the system automatically marks these areas in the image or video stream to prompt the operator to focus on inspection. These areas may have potential welding defects (such as pores, uneven welds) or complex structures in design. After the complex morphological areas are marked, the system can perform more advanced inspection and analysis steps on these areas, such as further checking parameters such as weld surface roughness and curvature changes.

[0067] S3: For welds with complex morphology, feature extraction is performed on the weld morphology data. Based on the extracted curvature change characteristics of the weld and the roughness characteristics of the weld surface, the adaptability of the algorithm in the machine vision system to the diversity of weld morphology is evaluated.

[0068] For welds with complex morphology, feature extraction is performed on the weld morphology data, where the weld curvature indicates the degree of curvature of the weld path. By calculating the local curvature of the weld centerline, it is analyzed whether the weld has bends, corners or irregular shapes. The larger the curvature, the more complex the weld shape. The weld centerline is extracted from the two side edges of the weld. The centerline can be calculated by taking the average position between the left and right edges. At each point of the weld, the local curvature of the point is calculated using the three-point method or the curve fitting method. For the three-point method, three adjacent points are selected and the arc is calculated using a geometric formula. The curvature of the entire weld curve is calculated point by point, and the curvature change is recorded as the weld path changes.

[0069] The curvature change rate fluctuation index is generated according to the extracted curvature change characteristics of the weld, and the method for obtaining the curvature change rate fluctuation index is:

[0070] The curvature κ(s) of the weld is calculated along the path of the weld, where s represents the parameterized coordinate of the weld length, and the curvature change rate formula is: The calculated curvature change rate sequence is used as a signal, and discrete Fourier transform is applied to perform frequency domain analysis. The weld path length is discretized into N equally spaced sampling points, and the curvature change rate data at the sampling points are obtained. ;in, is the curvature change rate of the nth sampling point. DFT is applied to convert the curvature change rate sequence into the frequency domain to obtain the frequency component , the expression is: ; In the formula, j is the imaginary unit, k is the frequency index, which represents the different frequency components of the signal and calculates the strength of the signal at each frequency: ; is the energy spectrum at frequency k; set the lower limit Klow and upper limit Khigh of the high frequency interval, and calculate the curvature change rate fluctuation index, the expression is: ; Where KH is the curvature change rate fluctuation index.

[0071] The larger the curvature change rate fluctuation index, the more dramatic the curvature change of the weld and the more complex the weld shape, which usually indicates that there are a large number of bends, corners or irregular areas in the weld. In this case, the algorithm in the machine vision system may not be able to effectively cope with these complex forms of high-frequency fluctuations, and the algorithm's adaptability to the diversity of weld shapes will be worse, which can easily lead to misjudgment or missed detection. Therefore, the larger the fluctuation index, the more it is necessary to improve the adaptability of the algorithm to ensure that the system can accurately identify the weld characteristics of these complex morphological areas.

[0072] The roughness of the weld surface is quantified using texture analysis methods through the image data of the weld. Roughness can be measured by the change in grayscale values. The texture features of the weld surface are extracted using the gray-level co-occurrence matrix (GLCM), including contrast, entropy, energy, and consistency. A higher entropy value usually indicates a rougher surface with strong irregularities, while a higher consistency indicates a smoother surface. Morphological operations (such as expansion, corrosion, and opening operations) are used to process the surface features of the weld to further enhance the visibility of rough areas and defects. The texture information of defects such as tiny pores and cracks on the weld surface is extracted to analyze the detail complexity of the surface texture. Areas with large changes in surface texture are usually accompanied by higher welding risks or possible defects.

[0073] The surface peak density anomaly index is generated according to the extracted roughness characteristics of the weld surface. The method for obtaining the surface peak density anomaly index is as follows:

[0074] The local extremum detection algorithm detects all peak points in the height map or grayscale map of the weld surface and obtains the height data of the weld surface, usually through images captured by sensors or cameras. To find the local maximum value on the weld surface, that is, the protruding point on the surface, a sliding window, gradient or other extremum detection method can be used. If the weld surface height map is Z(x,y), the local maximum value satisfies: ;in is the neighborhood of point (x, y), recording the coordinates of all local peak points And the corresponding height , and get the peak point set: ; Use the Gaussian mixture model to model the spatial distribution of surface peaks and find several Gaussian distributions representing normal and abnormal peak points. The expression is: ; In the formula, is the two-dimensional spatial coordinate of the peak point, is the kth Gaussian distribution with mean , the covariance matrix is , is the weight of the kth Gaussian distribution, satisfying , K is the number of mixed Gaussian distributions, and for each data point The probability of belonging to the kth Gaussian distribution , the expression is: ; The Gaussian mixture model is used to calculate the probability that each peak point belongs to a Gaussian distribution. For each peak point , calculate the probability that it belongs to the Gaussian mixture model, the expression is: ;if If the value is less than the set abnormal threshold, it is considered to be an abnormal point. The abnormal threshold is usually set to a minimum value. The probability of all peak points is calculated, and the points less than the abnormal threshold are marked as abnormal points to obtain the abnormal peak point set. The abnormal peak points are counted and the surface peak density abnormal index is calculated. The expression is: ; Where M is the number of outlier points, P is the total number of peak points, and KM is the surface peak density anomaly index.

[0075] The larger the surface peak density anomaly index is, the more abnormal peak points there are on the weld surface, indicating that the weld shape is more complex and irregular. This means that the algorithm in the machine vision system may face greater challenges in dealing with these complex and abnormal weld shapes and has poor adaptability. If the algorithm cannot accurately identify these abnormal shapes and distinguish them as defects or normal changes, it is easy to cause misjudgment or missed detection. Therefore, the larger the anomaly index is, the weaker the system's adaptability to the diversity of weld shapes, and the algorithm needs to be further optimized to improve the detection accuracy of complex welds.

[0076] The curvature change rate fluctuation index and the surface peak density anomaly index are converted into the first eigenvector, and the first eigenvector is used as the input of the machine learning model. The machine learning model predicts the adaptability value label of the algorithm in the machine vision system to the weld morphology diversity with each group of first eigenvectors as the prediction target, and takes minimizing the sum of the prediction errors of the adaptability value labels of the algorithms in all machine vision systems to the weld morphology diversity as the training target. The machine learning model is trained until the sum of the prediction errors converges, and the model training is stopped. The adaptability value of the algorithm in the machine vision system to the weld morphology diversity is determined according to the model output results, wherein the machine learning model is a polynomial regression model.

[0077] The method for obtaining the adaptability value of the algorithm in the machine vision system to the diversity of weld morphology is as follows: from the first eigenvector training data of the trained machine learning model, the corresponding function expression is obtained: ; Where F is the output function of the model, KH is the curvature change rate fluctuation index, KM is the surface peak density anomaly index, and DR is the adaptability value of the algorithm in the machine vision system to the diversity of weld morphology.

[0078] S4: According to the evaluation results, the adaptability of the algorithm in the machine vision system to the diversity of weld morphology is divided into different levels, namely, high adaptability level, general adaptability level and low adaptability level, and corresponding processing is performed.

[0079] The obtained adaptability value of the algorithm in the machine vision system to the diversity of weld morphology is compared with the gradient standard threshold, the gradient standard threshold includes a first standard threshold and a second standard threshold, and the first standard threshold is less than the second standard threshold, and the adaptability value of the algorithm in the machine vision system to the diversity of weld morphology is compared with the first standard threshold and the second standard threshold respectively;

[0080] If the adaptability value of the algorithm in the machine vision system to the diversity of weld morphology is greater than the second standard threshold, it means that the algorithm in the machine vision system has high adaptability to the diversity of weld morphology, and a high adaptability signal is generated at this time, and it is classified as a high adaptability level;

[0081] If the adaptability value of the algorithm in the machine vision system to the diversity of weld seam shapes is greater than or equal to the first standard threshold and less than or equal to the second standard threshold, it means that the adaptability of the algorithm in the machine vision system to the diversity of weld seam shapes is general, and a general adaptability signal is generated at this time, which is classified as a general adaptability level;

[0082] If the adaptability value of the algorithm in the machine vision system to the diversity of weld morphology is less than the first standard threshold, it means that the adaptability of the algorithm in the machine vision system to the diversity of weld morphology is low. At this time, a low adaptability signal is generated and it is classified as a low adaptability level.

[0083] S5: For weld complex morphology areas with high adaptability levels, the weld inspection results are automatically judged as qualified and pass the inspection directly; for weld complex morphology areas with low adaptability levels, an early warning signal is automatically generated, and the collected weld morphology diversity data is saved.

[0084] For weld complex morphology areas with high adaptability levels, the algorithm in the system shows good adaptability and the detection results have high accuracy. Therefore, the system can automatically determine that these areas are qualified and pass the test directly. Based on the adaptability value calculated by the machine learning model, the system determines whether the adaptability of the weld complex morphology area belongs to the high adaptability level (the adaptability value is greater than the second standard threshold). For weld areas with high adaptability assessment, the system directly judges their test results as qualified. This means that the machine vision system can reliably identify the weld morphology in this area without manual intervention or further inspection. The system automatically saves the morphological data and test results of the weld area into the database as a positive sample for future training or optimization of the machine learning model. After automatically passing the test, the system continues production without stopping or slowing down to ensure production line efficiency.

[0085] For weld complex morphology areas with low adaptability levels, the algorithm in the system has poor adaptability and may have the risk of misjudgment or missed judgment. At this time, the system should take early warning measures and save the weld data for subsequent analysis and improvement. The system determines whether the adaptability of the weld complex morphology area belongs to the low adaptability level (the adaptability value is less than the first standard threshold) based on the adaptability value calculated by the machine learning model. For weld areas with low adaptability levels, the system automatically generates an early warning signal. The early warning signal can be used to alarm with sound and light, notify the operator, or trigger the control system to intervene in the operation (such as pausing the production line). After receiving the early warning signal, the operator can manually check the inspection results of the weld to confirm whether there are welding defects. If necessary, the operator can stop the production line to repair the weld or adjust the welding process. The system automatically saves the morphological data, inspection results and reasons for the early warning signal of the weld area into the database. The saved data will be used as negative samples for subsequent training and optimization of the machine learning model to improve the system's adaptability to complex weld morphology.

[0086] S6: For welds with complex morphology of general adaptability level, the accuracy of the inspection results within a fixed time period is deeply analyzed and predicted, and the algorithm is dynamically optimized based on the prediction results.

[0087] For complex morphological areas of welds with general adaptability levels, that is, the adaptability values ​​generated within a fixed time period are greater than or equal to the first standard threshold and less than or equal to the second standard threshold, the adaptability values ​​generated within the subsequent fixed time period that are greater than or equal to the first standard threshold and less than or equal to the second standard threshold are collected, and the corresponding data set is established. The mean and standard deviation of the data set are calculated, and after analysis and prediction, the algorithm is dynamically optimized according to the prediction results.

[0088] If the mean value of the adaptability value in the data set is greater than or equal to the reference threshold of the mean value of the adaptability value, and the standard deviation of the adaptability value is less than the reference threshold of the standard deviation of the adaptability value, it indicates that the adaptability of the weld is stable and the overall performance is good, and the algorithm works normally in the current morphological area without large fluctuations or anomalies. At this time, no warning signal is generated, and production efficiency is further optimized, such as increasing the speed of automated detection or reducing the frequency of manual review, optimizing the execution speed and response time of the algorithm, and appropriately simplifying some detection steps, or reducing redundant calculations to improve detection efficiency;

[0089] If the mean value of the adaptability value is greater than or equal to the reference threshold of the mean value of the adaptability value, and the standard deviation of the adaptability value is greater than or equal to the reference threshold of the standard deviation of the adaptability value, the algorithm has good adaptability but there are fluctuations, indicating that the detection performance of some weld morphology areas is inconsistent, and there may be local complex morphologies that are difficult to handle. At this time, a three-level warning signal is generated, targeted adjustments are made to high-volatility areas, the detection intensity for complex morphologies is increased, and the model's adaptability to these local weld morphologies is optimized. By collecting data from abnormal fluctuation areas, the algorithm is locally fine-tuned, or more features (such as higher-resolution morphology data) are used to improve recognition accuracy;

[0090] If the mean value of the adaptability value is less than the reference threshold of the mean value of the adaptability value, and the standard deviation of the adaptability value is greater than or equal to the reference threshold of the standard deviation of the adaptability value, it indicates that the system has poor adaptability performance during this period of time, and the adaptability value fluctuates greatly, which may mean that the algorithm has serious problems in processing complex weld shapes and cannot detect stably. At this time, a first-level warning signal is generated and deep algorithm optimization is performed. It may be necessary to retrain the model or add new feature inputs (such as surface roughness, changes in weld curvature, etc.) to enhance the adaptability of the algorithm. Consider introducing more weld shape data for model retraining, especially by optimizing model parameters or introducing more advanced detection algorithms (such as deep learning) to improve the robustness to complex shapes;

[0091] If the mean value of the adaptability value is less than the reference threshold of the mean value of the adaptability value, and the standard deviation of the adaptability value is less than the reference threshold of the standard deviation of the adaptability value, the adaptability performance is poor but the stability is good, indicating that the algorithm has consistent adaptability to the weld morphology, but the overall performance is poor. At this time, a secondary warning signal is generated, and the overall algorithm is systematically optimized to improve the average level of the adaptability value and enhance the basic detection capability of the algorithm. It may be necessary to adjust the algorithm structure (such as introducing more features and optimizing the detection threshold) to improve the algorithm's comprehensive adaptability to various welds.

[0092] It should be noted here that the importance of the first-level warning signal is greater than that of the second-level warning signal, and the importance of the second-level warning signal is greater than that of the third-level warning signal. Relevant personnel can take corresponding optimization measures according to different warning signal levels.

[0093] In this embodiment, the weld image data is first captured in real time by a high-definition camera, and the template matching algorithm is used for identification and positioning. Subsequently, the system calculates the weld width through the edges on both sides, uses dynamic window scanning technology to analyze the width change of the weld, and determines the complex morphological area. For these areas, the curvature change and surface roughness characteristics of the weld are extracted, the adaptability of the algorithm to the diversity of weld morphology is evaluated, and it is divided into high adaptability level, general adaptability level and low adaptability level. For high adaptability level areas, the system automatically determines that it is qualified; low adaptability level areas generate warning signals and save data; general adaptability level areas are deeply analyzed based on the test results, and the detection accuracy is improved through dynamic optimization algorithms.

[0094] Example 2, please refer to Figure 2 As shown, the automobile body weld detection system based on machine vision described in this embodiment includes an image capture module, a weld width calculation module, an adaptability evaluation module, an adaptability division module, a high and low adaptability area processing module and a dynamic optimization module;

[0095] Image capture module: The high-definition camera installed on the production line captures the image data of the weld in real time, pre-processes the captured image data, and uses the template matching algorithm to identify and locate the position of the weld in the image;

[0096] Weld width calculation module: After locating the weld, the weld width is calculated by the distance between the two edges of the weld. The dynamic window scanning technology is used to analyze the weld width section by section, and the complex shape area of ​​the weld is determined based on the analysis results.

[0097] Adaptability evaluation module: For welds with complex morphology, feature extraction is performed on the weld morphology data. Based on the extracted curvature change characteristics of the weld and the roughness characteristics of the weld surface, the adaptability of the algorithm in the machine vision system to the diversity of weld morphology is evaluated;

[0098] Adaptability classification module: According to the evaluation results, the adaptability of the algorithm in the machine vision system to the diversity of weld morphology is divided into different levels, namely high adaptability level, general adaptability level and low adaptability level, and corresponding processing is performed;

[0099] High and low adaptability area processing module: For weld complex morphology areas with high adaptability levels, the weld inspection results are automatically judged as qualified and directly pass the inspection; for weld complex morphology areas with low adaptability levels, an early warning signal is automatically generated, and the collected weld morphology diversity data is saved;

[0100] Dynamic Optimization Module: For welds with complex morphology of general adaptability level, the accuracy of the detection results within a fixed time period is deeply analyzed and predicted, and the algorithm is dynamically optimized based on the prediction results.

[0101] The above formulas are all dimensionless and numerical calculations. The formula is a formula for the most recent real situation obtained by collecting a large amount of data and performing software simulation. The preset parameters in the formula are set by technicians in this field according to actual conditions.

[0102] The above embodiments can be implemented in whole or in part by software, hardware, firmware or any other combination. When implemented by software, the above embodiments can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions or computer programs. When the computer instructions or computer programs are loaded or executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from one website site, computer, server or data center to another website site, computer, server or data center by wired or wireless (e.g., infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that contains one or more available media sets. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium. The semiconductor medium can be a solid-state hard disk.

[0103] It should be understood that the term "and / or" in this article is only a description of the association relationship of associated objects, indicating that there can be three relationships. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. A and B can be singular or plural. In addition, the character " / " in this article generally indicates that the associated objects before and after are in an "or" relationship, but it may also indicate an "and / or" relationship. Please refer to the context for specific understanding.

[0104] It should be understood that in the various embodiments of the present application, the size of the serial numbers of the above-mentioned processes does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.

[0105] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.

[0106] The above description is only a specific implementation manner of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application.

Claims

1. A method for detecting weld seams of automobile bodies based on machine vision, characterized in that: The steps include: S1: The high-definition camera installed on the production line captures the image data of the weld in real time, pre-processes the captured image data, and uses the template matching algorithm to identify and locate the position of the weld in the image; S2: After locating the weld, the width of the weld is calculated by the distance between the two edges of the weld. The width of the weld is analyzed section by section using dynamic window scanning technology. The complex morphology area of ​​the weld is determined based on the analysis results, specifically: In each image frame, the left and right edges of the weld are determined. By calculating the distance between the two edges, the width of the weld can be obtained. Move pixel by pixel along the main axis of the weld. Each pixel point corresponds to a direction perpendicular to the center line of the weld. The distance from the left edge to the right edge is calculated, which is the width value of the weld. The weld width value of each point is associated with its position coordinates in the weld path and recorded to form a curve about the change of weld width with weld length. A fixed-size scanning window is set and will slide step by step along the weld path. Each time the scan is performed, the window will contain multiple weld width values. In each window, the rate of change of the weld width is calculated, and the standard deviation of the weld width in the regional window is calculated. The weld width is compared with the preset width value in the template. If the width is greater than or equal to the preset standard width value, it is marked as a weld complex morphology area. If the width is smaller than the preset standard width value, it is marked as a simple weld shape area; S3: For welds with complex morphology, feature extraction is performed on the weld morphology data. Based on the extracted curvature change characteristics of the weld and the roughness characteristics of the weld surface, the adaptability of the algorithm in the machine vision system to the diversity of weld morphology is evaluated; S4: According to the evaluation results, the adaptability of the algorithm in the machine vision system to the diversity of weld morphology is divided into different levels, namely, high adaptability level, general adaptability level and low adaptability level, and corresponding processing is performed; S5: For weld complex morphology areas with high adaptability levels, the weld inspection results are automatically judged as qualified and directly pass the inspection; for weld complex morphology areas with low adaptability levels, an early warning signal is automatically generated, and the collected weld morphology diversity data is saved; S6: For welds with complex morphology of general adaptability level, the accuracy of the inspection results within a fixed time period is deeply analyzed and predicted, and the algorithm is dynamically optimized based on the prediction results.

2. The method for detecting automobile body welds based on machine vision according to claim 1, characterized in that: In S1, the template matching algorithm is used to identify the welds in the preprocessed image. Specifically, the image is divided into several small areas, the weld template is matched area by area, the area closest to the template is found, the sliding window technology is used on the entire image, the weld area is scanned pixel by pixel, for each window area, the similarity with the template is calculated to obtain a similarity score, the template is compared with the actual weld morphology in the image, and when the similarity score is greater than or equal to the preset threshold, the area is confirmed to be the location of the weld.

3. The method for detecting automobile body welds based on machine vision according to claim 1, characterized in that: In S3, a curvature change rate fluctuation index is generated according to the extracted curvature change characteristics of the weld, and the method for obtaining the curvature change rate fluctuation index is: Calculates the curvature of the weld along its path , where s represents the parameterized coordinate of the weld length, and the curvature change rate formula is: The calculated curvature change rate sequence is used as a signal, and discrete Fourier transform is applied to perform frequency domain analysis. The weld path length is discretized into N equally spaced sampling points, and the curvature change rate data at the sampling points are obtained. ;in, is the curvature change rate of the nth sampling point. DFT is applied to convert the curvature change rate sequence into the frequency domain to obtain the frequency component , the expression is: ; In the formula, j is the imaginary unit, k is the frequency index, which represents the different frequency components of the signal and calculates the strength of the signal at each frequency: ; is the energy spectrum at frequency k; set the lower limit Klow and upper limit Khigh of the high frequency interval, and calculate the curvature change rate fluctuation index, the expression is: ; Where KH is the curvature change rate fluctuation index.

4. The method for detecting automobile body welds based on machine vision according to claim 3, characterized in that: The surface peak density anomaly index is generated according to the extracted roughness characteristics of the weld surface. The method for obtaining the surface peak density anomaly index is as follows: All peak points are detected in the height map or grayscale map of the weld surface through the local extreme value detection algorithm, the height data of the weld surface is obtained, and the local maximum value is found in the weld surface, that is, the protrusion point on the surface. If the weld surface height map is , then the local maximum satisfies: ;in Yes Neighborhood, record the coordinates of all local peak points And the corresponding height , and get the peak point set: ; The Gaussian mixture model is used to model the spatial distribution of surface peaks, and several Gaussian distributions representing normal and abnormal peak points are found. The expression is: ; In the formula, is the two-dimensional spatial coordinate of the peak point, is the kth Gaussian distribution with mean , the covariance matrix is , is the weight of the kth Gaussian distribution, satisfying , K is the number of mixed Gaussian distributions, and for each data point The probability of belonging to the kth Gaussian distribution , the expression is: ; The Gaussian mixture model is used to calculate the probability that each peak point belongs to a Gaussian distribution. For each peak point , calculate the probability that it belongs to the Gaussian mixture model, the expression is: ;if If the value is less than the set abnormal threshold, it is considered to be an abnormal point. The abnormal threshold is usually set to a minimum value. The probability of all peak points is calculated, and the points less than the abnormal threshold are marked as abnormal points to obtain the abnormal peak point set. The abnormal peak points are counted and the surface peak density abnormal index is calculated. The expression is: ; Where M is the number of outlier points, P is the total number of peak points, and KM is the surface peak density anomaly index.

5. The method for detecting automobile body welds based on machine vision according to claim 4, characterized in that: The curvature change rate fluctuation index and the surface peak density anomaly index are converted into the first eigenvector, and the first eigenvector is used as the input of the machine learning model. The machine learning model predicts the adaptability value label of the algorithm in the machine vision system to the weld morphology diversity with each group of first eigenvectors as the prediction target, and takes minimizing the sum of the prediction errors of the adaptability value labels of the algorithms in all machine vision systems to the weld morphology diversity as the training target. The machine learning model is trained until the sum of the prediction errors converges, and the model training is stopped. The adaptability value of the algorithm in the machine vision system to the weld morphology diversity is determined according to the model output results, wherein the machine learning model is a polynomial regression model.

6. The method for detecting automobile body welds based on machine vision according to claim 5, characterized in that: In S4, the adaptability of the algorithms in the machine vision system to the diversity of weld morphology is divided into different levels according to the evaluation results; The obtained adaptability value of the algorithm in the machine vision system to the diversity of weld morphology is compared with the gradient standard threshold, the gradient standard threshold includes a first standard threshold and a second standard threshold, and the first standard threshold is less than the second standard threshold, and the adaptability value of the algorithm in the machine vision system to the diversity of weld morphology is compared with the first standard threshold and the second standard threshold respectively; If the adaptability value of the algorithm in the machine vision system to the diversity of weld morphology is greater than the second standard threshold, it means that the algorithm in the machine vision system has high adaptability to the diversity of weld morphology, and a high adaptability signal is generated at this time, and it is classified as a high adaptability level; If the adaptability value of the algorithm in the machine vision system to the diversity of weld seam shapes is greater than or equal to the first standard threshold and less than or equal to the second standard threshold, it means that the adaptability of the algorithm in the machine vision system to the diversity of weld seam shapes is general, and a general adaptability signal is generated at this time, which is classified as a general adaptability level; If the adaptability value of the algorithm in the machine vision system to the diversity of weld morphology is less than the first standard threshold, it means that the adaptability of the algorithm in the machine vision system to the diversity of weld morphology is low. At this time, a low adaptability signal is generated and it is classified as a low adaptability level.

7. The method for detecting automobile body welds based on machine vision according to claim 6, characterized in that: In S6, for the complex morphology areas of welds at the general adaptation level, the accuracy of the detection results within a fixed time period is deeply analyzed and predicted, and the algorithm is dynamically optimized based on the prediction results; For complex morphological areas of welds with general adaptability levels, that is, the adaptability values ​​generated within a fixed time period are greater than or equal to the first standard threshold and less than or equal to the second standard threshold, the adaptability values ​​generated within the subsequent fixed time period that are greater than or equal to the first standard threshold and less than or equal to the second standard threshold are collected, and the corresponding data set is established. The mean and standard deviation of the data set are calculated, and after analysis and prediction, the algorithm is dynamically optimized according to the prediction results.

8. The method for detecting automobile body welds based on machine vision according to claim 7, characterized in that: If the mean value of the adaptability value in the data set is greater than or equal to the reference threshold value of the mean value of the adaptability value, and the standard deviation of the adaptability value is less than the reference threshold value of the standard deviation of the adaptability value, it indicates that the adaptability of the weld is stable and the overall performance is good. At this time, no warning signal is generated, and the production efficiency is further optimized; If the mean value of the adaptability value is greater than or equal to the reference threshold of the mean value of the adaptability value, and the standard deviation of the adaptability value is greater than or equal to the reference threshold of the standard deviation of the adaptability value, the algorithm has good adaptability but there are fluctuations. At this time, a third-level warning signal is generated, and targeted adjustments are made to the high volatility area, the detection strength for complex forms is increased, and the model is optimized; If the mean value of the adaptability value is less than the reference threshold value of the mean value of the adaptability value, and the standard deviation of the adaptability value is greater than or equal to the reference threshold value of the standard deviation of the adaptability value, it indicates that the system has poor adaptability performance during this period of time and the adaptability value fluctuates greatly. At this time, a first-level warning signal is generated and deep algorithm optimization is performed; If the mean of the adaptability values ​​is less than the reference threshold of the mean of the adaptability values, and the standard deviation of the adaptability values ​​is less than the reference threshold of the standard deviation of the adaptability values, the adaptability performance is poor but the stability is good, indicating that the algorithm has consistent adaptability to the weld morphology. At this time, a secondary warning signal is generated and the overall algorithm is systematically optimized.

9. A machine vision-based automobile body weld detection system, used to implement a machine vision-based automobile body weld detection method according to any one of claims 1 to 8, characterized in that: It includes image capture module, weld width calculation module, adaptability evaluation module, adaptability division module, high and low adaptability area processing module and dynamic optimization module; Image capture module: The high-definition camera installed on the production line captures the image data of the weld in real time, pre-processes the captured image data, and uses the template matching algorithm to identify and locate the position of the weld in the image; Weld width calculation module: After locating the weld, the weld width is calculated by the distance between the two edges of the weld. The dynamic window scanning technology is used to analyze the weld width section by section, and the complex shape area of ​​the weld is determined based on the analysis results. Adaptability evaluation module: For welds with complex morphology, feature extraction is performed on the weld morphology data. Based on the extracted curvature change characteristics of the weld and the roughness characteristics of the weld surface, the adaptability of the algorithm in the machine vision system to the diversity of weld morphology is evaluated; Adaptability classification module: According to the evaluation results, the adaptability of the algorithm in the machine vision system to the diversity of weld morphology is divided into different levels, namely high adaptability level, general adaptability level and low adaptability level, and corresponding processing is performed; High and low adaptability area processing module: For weld complex morphology areas with high adaptability levels, the weld inspection results are automatically judged as qualified and directly pass the inspection; for weld complex morphology areas with low adaptability levels, an early warning signal is automatically generated, and the collected weld morphology diversity data is saved; Dynamic Optimization Module: For welds with complex morphology of general adaptability level, the accuracy of the detection results within a fixed time period is deeply analyzed and predicted, and the algorithm is dynamically optimized based on the prediction results.

Citation Information

Patent Citations

  • Weld joint grinding method and system based on machine vision

    CN117036257A

  • Weld joint morphology and surface defect online detection and evaluation method and system

    CN118602979A