Welding spot defect detection method, electronic equipment and storage medium

Through edge detection and shape information extraction methods, the problem of low efficiency in solder joint defect detection is solved, efficient welding defect identification is achieved, and the labor cost of data acquisition and labeling is reduced.

CN120634962APending Publication Date: 2025-09-12FAW JIEFANG AUTOMOTIVE CO
View PDF 0 Cites 4 Cited by

Patent Information

Application Number
CN202510628728.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-05-15
Publication Date
2025-09-12

AI Technical Summary

Technical Problem

The efficiency of solder joint defect detection in existing technologies is low, mainly because the proportion of good solder joints is high, making it difficult to obtain a large number of defect images, resulting in difficulty in obtaining training data and wasting human resources.

Method used

By acquiring an image of the solder joint to be inspected, edge detection is performed to generate a solder joint edge image, solder joint shape information is extracted, and defect detection is performed based on the shape information, thus avoiding the need for a large amount of labeled data for deep learning.

Benefits of technology

It improves the efficiency of weld defect detection, reduces the labor cost of data acquisition and annotation, and realizes efficient welding defect identification.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120634962A_ABST
    Figure CN120634962A_ABST
Patent Text Reader

Abstract

The invention discloses a welding spot defect detection method, electronic equipment and a storage medium. The mode relates to the field of image detection, and the method comprises the following steps: obtaining a to-be-detected image of a to-be-detected welding spot; edge detection is carried out on the to-be-detected image, a welding spot edge image of the to-be-detected welding spot is obtained, and the welding spot edge image is used for representing contour features of the to-be-detected welding spot in the image space; parameter extraction is conducted on the welding spot edge image, welding spot shape information of the to-be-detected welding spot is obtained, and the welding spot shape information is used for representing shape features of the to-be-detected welding spot in a parameter space; welding spot defect detection is conducted on the to-be-detected welding spot based on the welding spot shape information, a defect detection result is obtained, and the defect detection result is used for representing whether the to-be-detected welding spot has welding defects or not. According to the invention, the technical problem of low efficiency of detecting the welding spot defect in the prior art is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of image detection, and in particular to a method for detecting solder joint defects, an electronic device, and a storage medium. Background Art

[0002] In industrial manufacturing, such as vehicle manufacturing, solder joint quality impacts the safety, performance, and service life of these products. The diversity of solder joint defects, such as cold joints, missing welds, offset welds, and weld penetrations, requires defect detection technology that can cover a wide range of defect types while ensuring high detection accuracy and stability, placing high demands on both detection techniques and methods.

[0003] At present, the defect detection methods of combining visual inspection with deep learning in related technologies usually require pre-acquisition of a large number of welding defect images, and require a lot of manpower to label the welding defect images as training sets and train the deep learning network or model. However, in the normal production and manufacturing process, good welding products usually account for a high proportion, and it is difficult to obtain a large number of welding defect images, that is, it is difficult to obtain training data, and the above process consumes more human resources and is costly, resulting in low efficiency in detecting solder joint defects in related technologies.

[0004] To address the above-mentioned problems, no effective solutions have been proposed so far. Summary of the Invention

[0005] The embodiments of the present invention provide a method for detecting solder joint defects, an electronic device, and a storage medium, so as to at least solve the technical problem of low efficiency in detecting solder joint defects in the related art.

[0006] According to one aspect of an embodiment of the present invention, a method for detecting solder joint defects is provided, the method comprising: acquiring an image of a solder joint to be detected; performing edge detection on the image to be detected to obtain a solder joint edge image of the solder joint to be detected, wherein the solder joint edge image is used to characterize the contour features of the solder joint to be detected in the image space; performing parameter extraction on the solder joint edge image to obtain solder joint shape information of the solder joint to be detected, wherein the solder joint shape information is used to characterize the shape features of the solder joint to be detected in the parameter space; performing solder joint defect detection on the solder joint to be detected based on the solder joint shape information to obtain a defect detection result, wherein the defect detection result is used to characterize whether there is a welding defect in the solder joint to be detected.

[0007] In an embodiment of the present invention, edge detection is performed on an image to be detected to obtain a weld edge image of a weld to be detected, including: grayscale processing the image to be detected to obtain a grayscale image; determining gradient parameters of a plurality of pixel points in the grayscale image, wherein the gradient parameters are used to describe changes in grayscale values ​​at corresponding pixel points; screening the plurality of pixel points based on the gradient parameters to obtain a plurality of edge pixel points; and generating a weld edge image based on the plurality of edge pixel points.

[0008] In an embodiment of the present invention, the gradient parameters include at least a gradient strength; screening a plurality of pixel points based on the gradient parameters to obtain a plurality of edge pixel points includes: obtaining a plurality of first pixel points having a gradient strength greater than a first preset threshold value from the plurality of pixel points; obtaining a plurality of third pixel points having a gradient strength greater than a second preset threshold value from the plurality of second pixel points, wherein the plurality of second pixel points are used to represent pixel points adjacent to the plurality of first pixel points from the plurality of pixel points, and the second preset threshold value is less than the first preset threshold value; and obtaining a plurality of edge pixel points based on the plurality of first pixel points and the plurality of third pixel points.

[0009] In an embodiment of the present invention, a plurality of edge pixel points are obtained based on a plurality of first pixel points and a plurality of third pixel points, including: obtaining position information of the plurality of first pixel points and the plurality of third pixel points in a grayscale image; based on the position information, determining pixel points with adjacent positional relationships among the plurality of first pixel points and the plurality of third pixel points to obtain a plurality of edge pixel points.

[0010] In an embodiment of the present invention, parameter extraction is performed on a weld edge image to obtain weld shape information of a weld to be detected, including: constructing an initial three-dimensional space, wherein a first dimension of the initial three-dimensional space represents the abscissa of a circle center position, a second dimension of the initial three-dimensional space represents the ordinate of the circle center position, and a third dimension of the initial three-dimensional space represents the radius of the circle; in the initial three-dimensional space, based on the position coordinates of a plurality of edge pixels in the weld edge image and a preset radius range, determining at least one weld circle; and generating weld shape information based on the at least one weld circle.

[0011] In an embodiment of the present invention, in an initial three-dimensional space, at least one welding circle is determined based on the position coordinates and a preset radius range of multiple edge pixel points in a weld edge image, including: determining multiple first candidate circles based on the position coordinates and the preset radius range of the multiple edge pixel points; performing an accumulation operation on overlapping circles in the multiple first candidate circles to obtain multiple second candidate circles and accumulated values ​​corresponding to the multiple second candidate circles, wherein the accumulated value is used to represent the number of first candidate circles contained in each second candidate circle; and obtaining at least one welding circle based on circles in the multiple second candidate circles whose accumulated values ​​are greater than the preset accumulated value.

[0012] In an embodiment of the present invention, the defect detection result is used to characterize whether there is a weld-through defect in the weld to be detected; weld defect detection is performed on the weld to be detected based on the weld shape information to obtain a defect detection result, including: when the number of welding circles in the weld shape information is less than a preset threshold, determining that the defect detection result is that there is no weld-through defect in the weld to be detected; when the number of welding circles in the weld shape information is greater than or equal to the preset threshold, determining the defect detection result based on the positional relationship of the welding circles.

[0013] In an embodiment of the present invention, based on the positional relationship of the welding circles, the defect detection result is determined, including: obtaining a target welding circle and other welding circles in the welding circle, wherein the target welding circle is used to represent the circle with the largest radius in the welding circle, and the other welding circles are used to represent other circles in the welding circle except the target welding circle; based on the positional relationship between the target welding circle and the other welding circles, determining whether there is an inclusion relationship between the target welding circle and the other welding circles; in response to the absence of an inclusion relationship between the target welding circle and the other welding circles, determining that the defect detection result is that there is no weld-through defect in the weld to be detected; in response to the presence of an inclusion relationship between the target welding circle and the other welding circles, determining that the defect detection result is that there is a weld-through defect in the weld to be detected.

[0014] According to another aspect of an embodiment of the present invention, a device for detecting weld defects is also provided, which includes: an acquisition module for acquiring an image of a weld to be detected; an edge detection module for performing edge detection on the image to be detected to obtain a weld edge image of the weld to be detected, wherein the weld edge image is used to characterize the contour features of the weld to be detected in the image space; a parameter extraction module for performing parameter extraction on the weld edge image to obtain weld shape information of the weld to be detected, wherein the weld shape information is used to characterize the shape features of the weld to be detected in the parameter space; a defect detection module for performing weld defect detection on the weld to be detected based on the weld shape information to obtain a defect detection result, wherein the defect detection result is used to characterize whether there is a welding defect in the weld to be detected.

[0015] According to another aspect of an embodiment of the present invention, an electronic device is provided, including: a memory storing an executable program; and a processor for running the program, wherein the program executes the methods of various embodiments of the present invention when running.

[0016] According to another aspect of an embodiment of the present invention, a computer-readable storage medium is provided. The computer-readable storage medium includes a stored executable program, wherein when the executable program is running, the device where the computer-readable storage medium is located is controlled to execute the methods in various embodiments of the present invention.

[0017] According to another aspect of an embodiment of the present invention, a computer program product is provided, including a computer program. When the computer program is executed by a processor, the method in each embodiment of the present invention is implemented.

[0018] According to another aspect of an embodiment of the present invention, a computer program product is provided, including a non-volatile computer-readable storage medium, wherein the non-volatile computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method in each embodiment of the present invention is implemented.

[0019] According to another aspect of an embodiment of the present invention, a computer program is provided. When the computer program is executed by a processor, the method in each embodiment of the present invention is implemented.

[0020] In an embodiment of the present invention, an image of a weld to be inspected is first acquired. Next, edge detection is performed on the image to generate a weld edge image. The weld edge image represents the contour features of the weld in image space. Parameters are then extracted from the weld edge image to obtain weld shape information. The weld shape information describes the shape features of the weld in parameter space. Finally, weld defect detection is performed based on the weld shape information to obtain defect detection results to determine whether there are welding defects in the weld. It is easy to notice that this application uses image processing technology to perform edge detection on the image to be detected to obtain a weld edge image, and then extracts the weld shape information of the weld from the weld edge image to perform weld defect detection. Through edge detection, the contour features of the weld edge can be highlighted, making the weld more obvious in the image. By extracting parameters from the weld edge image, the geometric features of the weld can be accurately quantified, providing accurate data support for the identification of welding defects. This application can realize defect judgment of welding welds by analyzing the weld shape and utilizing geometric rules, which can avoid the strong demand of deep learning for a large amount of labeled data, reduce the labor cost of data acquisition and labeling, and thus solve the technical problem of low efficiency in detecting weld defects in related technologies. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] The drawings described herein are used to provide a further understanding of the present invention and constitute a part of this application. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation of the present invention. In the drawings:

[0022] Figure 1 is a flow chart of a method for detecting solder joint defects according to an embodiment of the present invention;

[0023] Figure 2 is a schematic diagram of an optional detection process of a weld penetration defect according to an embodiment of the present invention;

[0024] Figure 3Schematic diagram of a device for detecting solder joint defects according to an embodiment of the present invention. DETAILED DESCRIPTION

[0025] In order to enable those skilled in the art to better understand the solutions of the present invention, the technical solutions 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 embodiments described are only 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 making creative efforts should fall within the scope of protection of the present invention.

[0026] It should be noted that the terms "first," "second," and the like in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or precedence. It should be understood that the numbers used in this manner are interchangeable where appropriate so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having," as well as any variations thereof, are intended to cover non-exclusive inclusions. For example, a process, method, system, product, or apparatus comprising a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units that are not explicitly listed or that are inherent to these processes, methods, products, or apparatus.

[0027] According to one aspect of an embodiment of the present invention, a method for detecting solder joint defects is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.

[0028] Figure 1 FIG. 1 is a flow chart of a method for detecting solder joint defects according to an embodiment of the present invention. Figure 1 As shown, the method includes the following steps:

[0029] Step S102: obtaining an image of the weld to be inspected.

[0030] The above-mentioned welds to be inspected may be welds that require welding defect detection, and may be welds formed when two or more metal parts are connected by a spot welding process during vehicle manufacturing. On the production line, each weld can be a potential inspection object to determine whether there are welding defects in the welds to be inspected. For example, in the vehicle manufacturing process, the connection point between the door and the side of the vehicle body can be used as a weld to be inspected. The welds to be inspected may be welds that are determined to have welding defects through subsequent inspections, or they may be welds that are found not to have welding defects through subsequent inspections. The welds to be inspected may be specifically determined according to actual needs and are not limited here.

[0031] The above-mentioned image to be detected may refer to one or more images containing welds to be detected captured by an image acquisition device, such as an industrial camera. The same image to be detected may include one weld to be detected or multiple welds to be detected, that is, it supports welding defect detection of one or more welds to be detected based on the same image. In actual application scenarios, the image to be detected may be a high-resolution partial image of the body of a white car, which contains multiple welds to be detected. The image to be detected can be obtained immediately after the spot welding process of the production line for immediate weld defect detection.

[0032] In an optional embodiment, an image acquisition device, such as an industrial camera, can first be positioned so as to cover the weld area. This can take into account the speed of the production line, the distribution of the welds, and the viewing angle and resolution of the camera, so as to ensure that the shooting can clearly capture the welds to be inspected; a higher brightness and uniform light source can be used to reduce shadows and highlights to ensure that the welds and their surrounding areas are clearly visible. The intensity and angle of the light source can be adjusted according to the material and color of the weld surface to obtain better contrast and clarity; when the weld to be inspected passes through the inspection area, a trigger mechanism, such as a photoelectric sensor or a signal from a production line, can be used to start the image acquisition device for shooting. In actual applications, parameters such as the frame rate, exposure time, and shutter speed of the image acquisition device can be set according to actual needs to adapt to the speed of the production line and ambient light conditions to ensure the real-time and accuracy of image acquisition. Users can also use handheld shooting equipment to shoot the welds to be inspected. There is no specific limitation on the shooting method here.

[0033] In the above process, through precise image acquisition, images of the solder joints to be inspected can be quickly obtained, providing a data basis for subsequent automated inspection, significantly improving inspection efficiency, and adapting to the high-speed and continuous production requirements on the production line. The image acquisition process combined with light source control can ensure the clear presentation of solder joint features, reduce misjudgments caused by poor image quality, and thus improve the accuracy of welding defect detection.

[0034] Step S104 , performing edge detection on the image to be detected to obtain a weld edge image of the weld to be detected.

[0035] The solder joint edge image is used to characterize the contour features of the solder joint to be detected in the image space.

[0036] The above-mentioned weld edge image may refer to an image obtained by performing edge detection processing on the image to be inspected. Edge detection can highlight the edge contour of the weld, making the shape characteristics of the weld more obvious, which is convenient for subsequent shape analysis. In the weld edge image, the weld contour is more clearly depicted, while the background and other non-weld area are suppressed, thereby reducing the complexity of subsequent processing and reducing interference, so as to improve the accuracy of subsequent detection.

[0037] In an optional embodiment, edge detection can be performed directly on the image to be detected, or the image to be detected can be preprocessed, such as grayscale processing and Gaussian filtering processing, and then edge detection is performed, which is not limited here; when performing grayscale processing, the collected colored image can be converted into a grayscale image to reduce the data dimension and simplify the calculation. Each pixel in the grayscale image can represent the brightness information of the point in the image to be detected, which is convenient for subsequent gradient calculation and edge detection; then, a Gaussian filter can be used to smooth the grayscale processed image. The Gaussian filter performs a weighted average of the values ​​of adjacent pixel points through convolution operation, thereby removing random noise interference in the image, ensuring the accuracy of subsequent edge detection, reducing the noise in the grayscale image, and improving the accuracy and reliability of edge detection. Edge detection can be performed specifically by gradient calculation. For example, an edge detection operator or a similar edge detection operator can be used to calculate parameters such as the gradient strength and gradient direction of each pixel in the image. The gradient strength can reflect the degree of change of the grayscale value at the pixel point, and the gradient direction can indicate the direction of the grayscale change. In turn, the contour features of the weld to be detected in the image space, that is, the weld edge image, can be obtained.

[0038] In the above process, edge detection can highlight the contour features of the weld edge, making the weld more obvious in the image, which is convenient for subsequent feature extraction and defect detection. The image after edge detection retains the key contour information of the weld edge, which can reduce the amount of calculation for subsequent processing and improve the efficiency of the overall detection process. High-precision edge detection can accurately reflect the shape and size of the weld, which helps to accurately identify welding defects, reduce misjudgments and missed judgments, and improve the accuracy of detection results.

[0039] Step S106 , performing parameter extraction on the weld edge image to obtain weld shape information of the weld to be detected.

[0040] The solder joint shape information is used to characterize the shape characteristics of the solder joint to be detected in the parameter space.

[0041] The above-mentioned solder joint shape information may refer to quantitative data about the solder joint shape extracted from the solder joint edge image by transforming from image space to parameter space and performing parameter extraction, which may include but is not limited to information such as the center position, radius size, and circular confidence of the solder joint. The circular confidence here can indicate the degree of matching between the solder joint contour and the standard circle.

[0042] In an optional embodiment, key feature points, such as the start and end points of the edge and any inflection points, can be located in the weld edge image. These feature points can serve as the basis for subsequent shape analysis. Next, a contour tracing algorithm, such as contour tracing or chain coding, can be used to extract a relatively complete weld contour from the edge image. Contour extraction ensures the continuity and integrity of the weld edge. Based on the extracted weld contour, a series of shape descriptors can be calculated, such as the weld area, perimeter, major and minor axis lengths, roundness, and ellipticity. These descriptors quantify the weld's geometric characteristics from different perspectives. The calculated shape descriptors can then be organized into feature vectors, which convert the weld's complex shape into a set of numerical values ​​that are easier for computers to understand and process. The feature vectors can then be mapped into a parameter space. This parameter space can be multidimensional, with each dimension corresponding to a different shape feature. In the parameter space, the weld's shape information is represented as a point or region, thereby obtaining the shape features of the weld to be inspected in the parameter space, i.e., the weld's shape information.

[0043] In the above process, contour extraction can accurately quantify the geometric features of the weld, such as roundness and ellipticity, to provide accurate data support for the identification of welding defects. The parameter space mapping and feature vectorization of shape features simplify the data structure and improve the efficiency of the overall detection process.

[0044] Step S108 , performing solder joint defect detection on the solder joint to be detected based on the solder joint shape information to obtain a defect detection result.

[0045] The defect detection result is used to indicate whether there is a welding defect in the weld to be detected.

[0046] The above-mentioned defect detection results may refer to the results of determining whether there are welding defects in the welds to be detected by analyzing the weld shape information. The welding defects may preferably be weld-through defects. The weld-through defects here may refer to excessive heat during welding causing the weld to penetrate the base material and form a through hole. Welding defects may also be crack defects, slag inclusion defects, weld deviation defects, etc., which are not limited here. The defect detection results obtained can be used for quality control of the vehicle production process, and can promptly identify welds that need to be reworked or have defects, thereby preventing defective products from entering subsequent production processes and entering the market.

[0047] In an optional embodiment, based on the extracted weld shape information, such as area, perimeter, roundness, and ellipticity, the weld's geometric features can be analyzed to determine whether they conform to the expected standard weld shape. For example, the roundness of a weld should be close to a standard circle, while welds with welding defects will deviate from this standard. Inspection and analysis can also be performed based on information such as the size and location of the weld to improve the comprehensiveness and accuracy of the inspection. For example, the weld can be analyzed to determine whether it is located in the intended location, whether the weld size exceeds the allowable tolerance range, and whether there are any factors around the weld that affect its quality. When a weld's shape characteristics are detected to be inconsistent with those of a standard weld, the weld can be marked as abnormal and the specific defect type, such as weld penetration, can be recorded. The inspection results can be visually fed back to the user or connected to the production control system to automatically adjust welding parameters to prevent the defect from recurring. Defect detection based on weld shape information can be performed in real time on the production line. When a defective weld is discovered, timely measures can be taken to prevent unqualified products from flowing into the next stage, achieving real-time monitoring and early warning of welding quality.

[0048] In the above process, by analyzing the shape characteristics of the solder joints, it is possible to accurately distinguish normal solder joints from defective solder joints, especially for defects with obvious geometric changes such as weld-through defects. This can improve the accuracy of welding defect detection and monitor the quality of solder joints during the welding process in real time. Problems can be discovered and measures can be taken in a timely manner to effectively avoid chain reactions in subsequent processing and improve the overall quality and efficiency of the production line. The results of defect detection can be used as part of big data to analyze the causes of welding defects, guide the improvement of production lines, and realize data-driven production process improvements.

[0049] In an embodiment of the present invention, an image of a weld to be inspected is first acquired. Next, edge detection is performed on the image to generate a weld edge image. The weld edge image represents the contour features of the weld in image space. Parameters are then extracted from the weld edge image to obtain weld shape information. The weld shape information describes the shape features of the weld in parameter space. Finally, weld defect detection is performed based on the weld shape information to obtain defect detection results to determine whether the weld has welding defects. It is easy to notice that this application uses image processing technology to perform edge detection on the image to be detected to obtain a weld edge image, and then extracts the weld shape information of the weld from the weld edge image to perform weld defect detection. Through edge detection, the contour features of the weld edge can be highlighted, making the weld more obvious in the image. By extracting parameter contours from the weld edge image, the geometric features of the weld can be accurately quantified, providing accurate data support for the identification of welding defects. This application can realize defect judgment of welding welds by analyzing the weld shape and utilizing geometric rules, which can avoid the strong demand of deep learning for a large amount of labeled data, reduce the labor cost of data acquisition and labeling, and thus solve the technical problem of low efficiency in detecting weld defects in related technologies.

[0050] In an embodiment of the present invention, edge detection is performed on an image to be detected to obtain a weld edge image of a weld to be detected, including: grayscale processing the image to be detected to obtain a grayscale image; determining gradient parameters of a plurality of pixel points in the grayscale image, wherein the gradient parameters are used to describe changes in grayscale values ​​at corresponding pixel points; screening the plurality of pixel points based on the gradient parameters to obtain a plurality of edge pixel points; and generating a weld edge image based on the plurality of edge pixel points.

[0051] The aforementioned multiple pixel points may be all pixel points in the grayscale image, or may be pixel points in a user-specified area in the grayscale image. The pixel points may be determined based on actual needs and are not limited here.

[0052] The above-mentioned gradient parameters may be parameters such as the gradient intensity and gradient direction of each pixel among the multiple pixels, which may be determined according to actual needs and are not limited here.

[0053] In an optional embodiment, the image to be inspected can be grayscaled to convert a color image into a grayscale image. This can be achieved by calculating the weighted average of the red, green, and blue color components of each pixel. Grayscale processing can simplify color information, making subsequent gradient calculation and edge detection more efficient. Next, gradient analysis can be performed on each pixel in the grayscale image to calculate gradient parameters for each pixel, such as gradient strength and gradient direction. The gradient strength reflects the rate of change of the grayscale value at that pixel, while the gradient direction indicates the direction of the fastest grayscale change. Based on the gradient parameters, an edge detection algorithm can be applied to filter out edge pixels, which can help identify regions of sudden change in the grayscale image, namely the edges of the weld. The filtered edge pixels can then be connected to form an image containing the weld outline, namely the weld edge image. This allows for visualization of edge features in the two-dimensional image space, facilitating subsequent shape analysis and defect detection.

[0054] In the above process, grayscale and edge detection can accurately capture the geometric boundaries of the solder joints, provide precise information for subsequent solder joint shape analysis and defect detection, and significantly improve the accuracy of detection. Grayscale processing can reduce the color dimension, and edge detection focuses on contour features. The combination of grayscale and edge detection can simplify the amount of data for subsequent processing and speed up the entire detection process.

[0055] In an embodiment of the present invention, the gradient parameters include at least a gradient strength; screening a plurality of pixel points based on the gradient parameters to obtain a plurality of edge pixel points includes: obtaining a plurality of first pixel points having a gradient strength greater than a first preset threshold value from the plurality of pixel points; obtaining a plurality of third pixel points having a gradient strength greater than a second preset threshold value from the plurality of second pixel points, wherein the plurality of second pixel points are used to represent pixel points adjacent to the plurality of first pixel points from the plurality of pixel points, and the second preset threshold value is less than the first preset threshold value; and obtaining a plurality of edge pixel points based on the plurality of first pixel points and the plurality of third pixel points.

[0056] In an optional embodiment, the gradient intensity of each pixel in the grayscale image can be calculated, which can be achieved by applying a gradient operator. Then, a higher threshold, i.e., a first preset threshold, can be set to screen out pixel points with a gradient intensity greater than the first preset threshold from multiple pixel points in the grayscale image. The obtained pixel points constitute a preliminary set of edge candidate points, i.e., multiple first pixel points. The selection of a high threshold is conducive to reducing false positive edge points and ensuring that the true edge is clearly visible. Then, multiple second pixel points adjacent to each first pixel point can be scanned to determine pixel points with a gradient intensity greater than the second preset threshold, and obtain multiple third pixel points. This part of the pixel points contains detailed information of the edge, but due to noise or illumination, the gradient intensity is slightly low. And based on the obtained multiple first pixel points and multiple third pixel points, multiple edge pixel points can be determined.

[0057] In the above process, through the screening of high and low thresholds, the problem of excessive or insufficient detection caused by a single threshold can be avoided. It can not only remove a large amount of noise, but also retain appropriate edge details, significantly improving the accuracy of edge detection. The precise edge pixel points obtained provide accurate data basis for subsequent weld shape analysis and defect detection, which can simplify subsequent calculations and speed up the efficiency of the entire welding defect detection.

[0058] In an embodiment of the present invention, a plurality of edge pixel points are obtained based on a plurality of first pixel points and a plurality of third pixel points, including: obtaining position information of the plurality of first pixel points and the plurality of third pixel points in a grayscale image; based on the position information, determining pixel points with adjacent positional relationships among the plurality of first pixel points and the plurality of third pixel points to obtain a plurality of edge pixel points.

[0059] In an optional embodiment, the precise coordinates of the plurality of first pixels and the plurality of third pixels in the grayscale image can be obtained, i.e., position information can be obtained, which serves as the data basis for subsequently determining adjacent pixels. Then, based on the position information, the relative positional relationship between the plurality of first pixels and the plurality of third pixels can be analyzed, and pixels with adjacent positional relationships among the plurality of first pixels and the plurality of third pixels, i.e., pixels with isolated positional relationships among the plurality of first pixels and the plurality of third pixels, can be deleted, thereby obtaining a plurality of edge pixels.

[0060] In the above process, the analysis of position information and the screening process of adjacent pixels help to eliminate isolated points and noise, ensure that each edge point is part of the real weld contour, improve the accuracy of edge detection, and obtain a continuous and complete set of edge pixel points, which can provide more accurate data basis for defect detection.

[0061] In an embodiment of the present invention, parameter extraction is performed on a weld edge image to obtain weld shape information of a weld to be detected, including: constructing an initial three-dimensional space, wherein a first dimension of the initial three-dimensional space represents the abscissa of a circle center position, a second dimension of the initial three-dimensional space represents the ordinate of the circle center position, and a third dimension of the initial three-dimensional space represents the radius of the circle; in the initial three-dimensional space, based on the position coordinates of a plurality of edge pixels in the weld edge image and a preset radius range, determining at least one weld circle; and generating weld shape information based on the at least one weld circle.

[0062] In an optional embodiment, an initial three-dimensional space can be created, such as a Hough accumulator space, in which the first and second dimensions can represent the horizontal and vertical coordinates of possible circle center positions, respectively; and the third dimension can correspond to possible circle radii. Next, each edge pixel in the weld edge image can be mapped onto the Hough accumulator in the three-dimensional space. For each edge pixel, all possible combinations of circle center and radius are calculated and determined based on the position coordinates of each edge pixel and a preset radius range to determine the final weld circle and obtain weld shape information.

[0063] In the above process, by constructing possible combinations of detection circle centers and radii in the constructed initial three-dimensional space, the circular features of the solder joints can be identified more accurately, even in the presence of noise or irregular shapes, thereby improving the adaptability of the detection method to solder joint variations. The construction of three-dimensional space and the multi-circle detection strategy can be applied to the analysis of complex solder joint patterns, thereby improving the efficiency and scope of detection.

[0064] In an embodiment of the present invention, in an initial three-dimensional space, at least one welding circle is determined based on the position coordinates and a preset radius range of multiple edge pixel points in a weld edge image, including: determining multiple first candidate circles based on the position coordinates and the preset radius range of the multiple edge pixel points; performing an accumulation operation on overlapping circles in the multiple first candidate circles to obtain multiple second candidate circles and accumulated values ​​corresponding to the multiple second candidate circles, wherein the accumulated value is used to represent the number of first candidate circles contained in each second candidate circle; and obtaining at least one welding circle based on circles in the multiple second candidate circles whose accumulated values ​​are greater than the preset accumulated value.

[0065] The above-mentioned preset radius range can be determined according to the size of the specific solder joint to be detected, etc., and is not limited here.

[0066] The above-mentioned preset cumulative value may refer to a preset cumulative value threshold for screening and obtaining welding circles, which may be determined according to actual needs and is not limited here.

[0067] In an optional embodiment, for each edge pixel in the weld edge image, possible circle center locations can be plotted in an initial three-dimensional space, such as a Hough cumulative space, based on the position coordinates of each edge pixel and a preset radius range. Each edge pixel has a unit value added to its possible center location. In the initial three-dimensional space, first candidate circles can be determined by detecting local high points. These high points can represent the circle center locations voted for by multiple edge pixels. Each local high point can correspond to a set of potential center and radius combinations. Next, a cumulative operation can be performed on the first candidate circles to merge overlapping or adjacent circles to reduce duplicate detection. For each first candidate circle center location, a nearby location in Hough space is searched. These merged circles form multiple second candidate circles. The cumulative value of each second candidate circle can reflect the degree of support for it by the edge pixels. Next, the multiple second candidate circles can be screened based on the preset cumulative value and the cumulative values ​​of each second candidate circle. Second candidate circles with cumulative values ​​greater than the preset cumulative value are retained. These screened circles have high edge pixel support and can be used as the final weld circle.

[0068] In the above process, the accumulation operation of multiple edge pixels can be used to effectively identify the true center and radius of the weld, thereby improving the accuracy and reliability of detection. The accumulation operation can suppress the influence of random noise. Even if there are some noise points in the edge detection process, the true weld circle can be located through the correct voting of the majority of pixels, which can improve the accuracy of weld circle detection and enhance the robustness and computational efficiency of the detection method.

[0069] In an embodiment of the present invention, the defect detection result is used to characterize whether there is a weld-through defect in the weld to be detected; weld defect detection is performed on the weld to be detected based on the weld shape information to obtain a defect detection result, including: when the number of welding circles in the weld shape information is less than a preset threshold, determining that the defect detection result is that there is no weld-through defect in the weld to be detected; when the number of welding circles in the weld shape information is greater than or equal to the preset threshold, determining the defect detection result based on the positional relationship of the welding circles.

[0070] The above-mentioned preset threshold value may be a threshold value preset when performing weld defect detection. For example, in weld penetration defect detection, the preset threshold value may be 2. The preset threshold value may also be determined according to actual needs and is not limited here.

[0071] In an optional embodiment, after determining the weld circles, the number of weld circles detected in the weld spot shape information can be counted. If the number of weld circles is less than a preset threshold, it can be determined that the weld to be inspected does not have a weld-through defect. When the number of weld circles in the weld spot shape information is greater than or equal to the preset threshold, the defect detection result can be further determined based on the positional relationship of the weld circles. For example, it can be determined whether a smaller circle is located within a larger circle. This inclusion relationship can serve as a more obvious characteristic of a weld-through defect.

[0072] In the above process, based on the number and position relationship of the welding circles, it is possible to effectively determine whether the solder joint is affected by the weld penetration, avoid misjudgment caused by single feature detection, and quickly screen the solder joint status by presetting the threshold, which simplifies the detection process and speeds up the detection speed. It is especially suitable for the real-time detection needs on high-speed production lines.

[0073] In an embodiment of the present invention, based on the positional relationship of the welding circles, the defect detection result is determined, including: obtaining a target welding circle and other welding circles in the welding circle, wherein the target welding circle is used to represent the circle with the largest radius in the welding circle, and the other welding circles are used to represent other circles in the welding circle except the target welding circle; based on the positional relationship between the target welding circle and the other welding circles, determining whether there is an inclusion relationship between the target welding circle and the other welding circles; in response to the absence of an inclusion relationship between the target welding circle and the other welding circles, determining that the defect detection result is that there is no weld-through defect in the weld to be detected; in response to the presence of an inclusion relationship between the target welding circle and the other welding circles, determining that the defect detection result is that there is a weld-through defect in the weld to be detected.

[0074] In an optional embodiment, among the detected welding circles, the circle with the largest radius can be identified as the target welding circle, which can represent the main structure of the weld. Next, the positional relationship between the target welding circle and the other welding circles can be analyzed to determine whether there is a containment relationship. For example, for each other welding circle, the distance from its center to the center of the target welding circle and the radius difference between the two circles can be calculated. If the center distance is less than the radius difference, it can be considered that there is a containment relationship, which can be used as a sign of a weld-through defect. That is, if there is a containment relationship between at least one other welding circle and the target welding circle, the defect detection result can be marked as the presence of a weld-through defect; if there is no containment relationship between all detected circles, a defect detection result indicating the absence of a weld-through defect can be given.

[0075] In the above process, by identifying and analyzing the inclusion relationship between the target welding circle and other welding circles, the accuracy of weld penetration defect identification can be significantly improved, and the occurrence of misjudgment results can be avoided. The analysis logic based on circular information is relatively simple and efficient, easy to implement and maintain, and can provide intuitive defect detection results.

[0076] The technical solution proposed in this application is described below in conjunction with an optional embodiment. This application proposes a machine vision-based method for detecting weld-through defects in vehicle body welds. The method may include the following steps: acquiring an image to be inspected using an image acquisition device and grayscale processing the image to be inspected. Next, edge extraction may be performed on the grayscale image to identify and describe the contours of the welds in the grayscale image, thereby obtaining a relatively complete and accurate weld edge image. Next, a Hough circle transform may be performed on the weld edge image to obtain weld shape information, including the center position, radius, and circularity confidence. Finally, based on the weld shape information, circles with a circularity confidence greater than a preset cumulative value may be counted to obtain at least one weld circle. If the number of the at least one weld circle obtained is greater than or equal to a preset threshold (e.g., 2), and there is a containment relationship between the weld circles, a weld-through defect is present. If the number of the at least one weld circle obtained is less than the preset threshold, or there is no containment relationship between the weld circles, a weld-through defect is determined to be absent.

[0077] Optionally, extracting edges from the grayscale image after grayscale processing, identifying and describing the contours of the solder joints in the grayscale image, and obtaining a relatively complete and accurate solder joint edge image can include: using a Gaussian filter to smooth the grayscale image and filter out noise; then, calculating the gradient intensity and gradient direction of each pixel point in the grayscale image, that is, obtaining gradient parameters; and applying non-maximum suppression to eliminate stray responses caused by edge detection; then, applying dual threshold detection to determine real edges and potential edges, that is, determining multiple first pixel points and multiple third pixel points; and finally completing edge detection by suppressing isolated weak edges to obtain a solder joint edge image.

[0078] In the above process, to prevent noise from interfering with subsequent edge detection and to make the image relatively smooth, a Gaussian filter can be used to achieve image denoising and smoothing by weighted summing the values ​​within the pixel neighborhood of the grayscale image. Next, an edge detection (Sobel) operator can be used to calculate the gradient strength and gradient direction of each pixel in the Gaussian-processed grayscale image. The gradient strength reflects the severity of the grayscale change at the pixel, while the gradient direction indicates the direction of the fastest grayscale change. To prevent redundant edge responses from adjacent pixels, the edge detection algorithm can employ non-maximum suppression to retain the stronger response. Specifically, the gradient magnitude of the current pixel can be compared with the gradient magnitudes of adjacent pixels in the positive and negative gradient directions. If the gradient magnitude of the current pixel is the maximum, it is retained as an edge point; if it is not the maximum, it is suppressed and not considered an edge point. Next, dual-threshold detection can be performed, with two thresholds set: a high threshold and a low threshold, namely a first preset threshold and a second preset threshold. For pixel points whose gradient strength is greater than the high threshold, that is, the multiple first pixel points obtained, they can be directly determined as edge points; for pixel points whose gradient strength is less than the low threshold, they are directly excluded; and for pixel points whose gradient strength is between the first preset threshold and the second preset threshold, if they are adjacent to the determined edge points, they are also determined as edge points, that is, the multiple third pixel points obtained. In other words, multiple edge pixel points can be obtained based on the multiple first pixel points and multiple third pixel points obtained by dual threshold judgment, and then a weld edge image is obtained.

[0079] Optionally, performing a Hough circle transform on the weld edge image to obtain weld shape information, including its center position, radius, and circular confidence, from the weld edge image can include: constructing a Hough cumulative space (i.e., an initial three-dimensional space) based on the aforementioned edge detection results using the gradient direction and gradient intensity information of each pixel in the weld edge image; determining the corresponding center position of each pixel in the weld edge image based on its gradient direction and gradient intensity; performing an accumulation operation in the Hough cumulative space for each combination of center position and radius, recording all possible circles passing through that center position and radius; and representing the more likely center and radius combination at positions with higher accumulated values ​​in the Hough cumulative space; verifying the existence of the detected circle by further confirming information such as the accumulated value on the circumference; and displaying the circle detected using the Hough gradient method on the image. Through edge detection and Hough circle transform, weld shape information, including its center position and radius, can be obtained from the weld edge image. The accumulated value in the normalized Hough cumulative space can be considered as the confidence level of the weld circle shape, used to describe the circularity of the weld.

[0080] Optionally, the defect detection result is determined based on the weld shape information, which may include: Bayesian improvement may be used to determine a confidence threshold that can judge a circle and ensure the accuracy of weld penetration detection. According to the weld shape information, the circles whose circular confidence is greater than the preset cumulative value can be counted to obtain at least one weld circle. If the number of at least one weld circle obtained is greater than or equal to the preset threshold, the preset threshold can be 2, etc., and there is an inclusion relationship between the weld circles, then there is a weld penetration defect; and if the number of at least one weld circle is less than the preset threshold, or there is no inclusion relationship between the weld circles, it can be determined that there is no weld penetration defect. When the number of weld circles is greater than the preset threshold, the circle with the largest radius in at least one weld circle can be compared with the other circles in turn for the center distance and radius difference. When the center distance of each circle is less than the radius difference, it can be determined that there is a weld penetration defect. Specifically, the circle with the largest radius can be selected, and the center distances of the other circles and the circle with the largest radius can be calculated in turn to see if they are less than the difference between the two radii. If they are all less than, the inclusion relationship is satisfied. The specific formula is:

[0081] (XX max ) 2 +(YY max ) 2 <(RR max ) 2 ;

[0082] Among them, the above X max It can represent the circle with the largest radius in the welding circle, that is, the horizontal coordinate of the center of the target welding circle; Y max It can represent the vertical coordinate of the center of the target welding circle; R max can represent the radius of the target welding circle; X can represent the horizontal coordinate of the center of other welding circles; Y can represent the vertical coordinate of the center of other welding circles; R can represent the radius of other welding circles; in practical applications, if the above formula is true, it can be determined that there is an inclusion relationship between the target welding circle and other welding circles, and then the defect detection result can be determined as a weld-through defect in the weld to be detected.

[0083] Figure 2 is a schematic diagram of an optional detection process of a weld penetration defect according to an embodiment of the present invention, such as Figure 2 As shown, first, an image of the weld to be detected can be obtained; then, edge detection can be performed on the image to be detected to obtain a weld edge image of the weld to be detected; then, parameter extraction can be performed on the weld edge image to obtain weld shape information of the weld to be detected; then, weld defect detection can be performed on the weld to be detected based on the weld shape information to obtain a defect detection result; it can be determined whether the number of welding circles in the weld shape information is greater than or equal to a preset threshold, and whether an inclusion relationship exists between the target welding circle and other welding circles. If not, it can be determined that there is no through-weld defect in the weld to be detected; if so, it can be determined that there is a through-weld defect in the weld to be detected.

[0084] The present application proposes to obtain the appearance features of the welds based on edge detection, i.e., the edge images of the welds, and use the Hough circle transform to extract the circular features of the welds, i.e., the shape information of the welds. The circular features are used to judge the weld penetration defects of the welds, thereby improving the efficiency and accuracy of the weld penetration defect detection of the welds on the vehicle body, and the detection method is simple and easy.

[0085] According to another aspect of an embodiment of the present invention, a device for detecting solder joint defects is also provided. The device can execute the method for detecting solder joint defects of the above embodiment. The specific implementation method and preferred application scenario are the same as those of the above embodiment and will not be repeated here.

[0086] Figure 3 is a schematic diagram of a device for detecting solder joint defects according to an embodiment of the present application, such as Figure 3 As shown, the apparatus includes the following: an acquisition module 302 , an edge detection module 304 , a parameter extraction module 306 and a defect detection module 308 .

[0087] Among them, the acquisition module 302 is used to obtain the image to be detected of the weld to be detected; the edge detection module 304 is used to perform edge detection on the image to be detected to obtain the weld edge image of the weld to be detected, wherein the weld edge image is used to characterize the contour features of the weld to be detected in the image space; the parameter extraction module 306 is used to extract parameters from the weld edge image to obtain weld shape information of the weld to be detected, wherein the weld shape information is used to characterize the shape features of the weld to be detected in the parameter space; the defect detection module 308 is used to perform weld defect detection on the weld to be detected based on the weld shape information to obtain a defect detection result, wherein the defect detection result is used to characterize whether there is a welding defect in the weld to be detected.

[0088] Among them, the edge detection module is also used to grayscale the image to be detected to obtain a grayscale image; determine the gradient parameters of multiple pixel points in the grayscale image, wherein the gradient parameters are used to describe the change in the grayscale value at the corresponding pixel points; based on the gradient parameters, the multiple pixel points are screened to obtain multiple edge pixel points; based on the multiple edge pixel points, a weld edge image is generated.

[0089] Among them, the gradient parameters include at least gradient strength; the edge detection module is also used to obtain multiple first pixel points whose gradient strength is greater than a first preset threshold among multiple pixel points; obtain multiple third pixel points whose gradient strength is greater than a second preset threshold among multiple second pixel points, wherein the multiple second pixel points are used to represent pixel points adjacent to the multiple first pixel points among the multiple pixel points, and the second preset threshold is less than the first preset threshold; based on the multiple first pixel points and the multiple third pixel points, multiple edge pixel points are obtained.

[0090] Among them, the edge detection module is also used to obtain the position information of multiple first pixel points and multiple third pixel points in the grayscale image; based on the position information, determine the pixel points with adjacent positional relationships among the multiple first pixel points and the multiple third pixel points to obtain multiple edge pixel points.

[0091] Among them, the parameter extraction module is also used to construct an initial three-dimensional space, wherein the first dimension of the initial three-dimensional space represents the horizontal coordinate of the center position of the circle, the second dimension of the initial three-dimensional space represents the vertical coordinate of the center position of the circle, and the third dimension of the initial three-dimensional space represents the radius of the circle; in the initial three-dimensional space, based on the position coordinates of multiple edge pixel points in the weld edge image and a preset radius range, at least one welding circle is determined; based on the at least one welding circle, weld shape information is generated.

[0092] Among them, the parameter extraction module is also used to determine multiple first candidate circles based on the position coordinates of multiple edge pixel points and a preset radius range; perform an accumulation operation on the overlapping circles in the multiple first candidate circles to obtain multiple second candidate circles and the accumulated values ​​corresponding to the multiple second candidate circles, wherein the accumulated value is used to represent the number of first candidate circles contained in each second candidate circle; and obtain at least one welding circle based on the circles in the multiple second candidate circles whose accumulated values ​​are greater than the preset accumulated value.

[0093] Among them, the defect detection result is used to characterize whether there is a weld-through defect in the weld to be detected; the defect detection module is also used to determine that the defect detection result is that there is no weld-through defect in the weld to be detected when the number of welding circles in the weld shape information is less than a preset threshold; when the number of welding circles in the weld shape information is greater than or equal to the preset threshold, the defect detection result is determined based on the positional relationship of the welding circles.

[0094] Among them, the defect detection module is also used to obtain the target welding circle and other welding circles in the welding circle, wherein the target welding circle is used to represent the circle with the largest radius in the welding circle, and the other welding circles are used to represent other circles in the welding circle except the target welding circle; based on the positional relationship between the target welding circle and the other welding circles, determine whether there is an inclusion relationship between the target welding circle and the other welding circles; in response to the absence of an inclusion relationship between the target welding circle and the other welding circles, determine that the defect detection result is that there is no weld-through defect in the weld to be detected; in response to the presence of an inclusion relationship between the target welding circle and the other welding circles, determine that the defect detection result is that there is a weld-through defect in the weld to be detected.

[0095] An embodiment of the present application further provides an electronic device, comprising: a memory storing an executable program; and a processor for running the program, wherein the program executes the methods of various embodiments of the present invention when running.

[0096] The above-mentioned memory may refer to a device inside a computer for storing data and programs, and may include memory, hard disk, etc., wherein the memory may be used to temporarily store running programs and data, the hard disk may be used to store programs and data for a long time, and the memory may be used to enable the computer to read and write data, as well as execute programs; the above-mentioned processor may be responsible for executing instructions in computer programs and performing data processing, and may be responsible for controlling and executing various operations, including arithmetic operations, logical operations, data transmission, etc.

[0097] An embodiment of the present application further provides a computer-readable storage medium, which includes a stored executable program, wherein when the executable program is running, the device where the computer-readable storage medium is located is controlled to execute the methods in various embodiments of the present invention.

[0098] The above-mentioned computer storage medium may refer to a medium in a computer memory used to store certain discontinuous physical quantities. Computer storage media mainly include semiconductors, magnetic cores, magnetic drums, magnetic tapes, laser disks, etc. The stored program included in the computer-readable storage medium may be a set of instructions that can be recognized and executed by a computer, running on an electronic computer, and serving as an information tool to meet certain needs of people.

[0099] An embodiment of the present application further provides a computer program product, including a computer program, which implements the methods in various embodiments of the present invention when executed by a processor.

[0100] The above-mentioned computer program product may refer to a software program that has been written, tested and released, which can be run on a computer or other device. The computer program product may include an application, an operating system, tool software, etc., which is used to implement specific functions or solve specific problems.

[0101] An embodiment of the present application further provides a computer program product, including a non-volatile computer-readable storage medium, wherein the non-volatile computer-readable storage medium is used to store a computer program, and when the computer program is executed by a processor, the method in each embodiment of the present invention is implemented.

[0102] The above-mentioned non-volatile computer-readable storage medium may refer to a medium for storing data. The non-volatile computer-readable storage medium can keep the data from being lost when the power is off, and can be used to store long-term data, such as operating systems, applications and user files. The non-volatile storage medium may include hard disk drives, solid-state drives, optical disks and flash memory storage devices, etc.

[0103] The embodiments of the present application further provide a computer program, which implements the methods in the above-mentioned embodiments of the present invention when executed by a processor.

[0104] The above-mentioned computer program may refer to a collection of instructions used to tell a computer to perform a specific task or operation. A computer program may be written by a programmer using a specific programming language and may include algorithms, data structures, logic, and control flows. Computer programs may be used for a variety of purposes, including application software, operating systems, and the like.

[0105] In the above embodiments of the present invention, the description of each embodiment has its own focus. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0106] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. Among them, the device embodiments described above are only exemplary. For example, the division of the units can be a logical function division. In actual implementation, there may be other division methods, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of units or modules, which can be electrical or other forms.

[0107] The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple units. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.

[0108] In addition, the functional units in the various embodiments of the present invention may be integrated into a single processing unit, each unit may exist physically separately, or two or more units may be integrated into a single unit. The aforementioned integrated units may be implemented in the form of hardware or software functional units.

[0109] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions for enabling a computer device (which can be a personal computer, server or network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, magnetic disk or optical disk, etc. Various media that can store program codes.

[0110] The above is only a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present invention. These improvements and modifications should also be regarded as within the scope of protection of the present invention.

Claims

1. A method for detecting solder joint defects, characterized in that: include: Acquire an image of a solder joint to be inspected; Performing edge detection on the image to be detected to obtain a solder joint edge image of the solder joint to be detected, wherein the solder joint edge image is used to characterize the contour features of the solder joint to be detected in the image space; Performing parameter extraction on the solder joint edge image to obtain solder joint shape information of the solder joint to be detected, wherein the solder joint shape information is used to characterize shape features of the solder joint to be detected in a parameter space; Performing weld defect detection on the weld to be detected based on the weld shape information to obtain a defect detection result, wherein the defect detection result is used to indicate whether the weld to be detected has a welding defect.

2. The method for detecting solder joint defects according to claim 1, wherein: Performing edge detection on the image to be detected to obtain a weld edge image of the weld to be detected, comprising: Performing grayscale processing on the image to be detected to obtain a grayscale image; Determining gradient parameters of a plurality of pixel points in the grayscale image, wherein the gradient parameters are used to describe changes in grayscale values ​​at corresponding pixel points; Filtering the plurality of pixel points based on the gradient parameter to obtain a plurality of edge pixel points; The weld edge image is generated based on the plurality of edge pixels.

3. The method for detecting solder joint defects according to claim 2, wherein: The gradient parameters include at least a gradient strength; the plurality of pixel points are screened based on the gradient parameters to obtain a plurality of edge pixel points, including: Acquire a plurality of first pixel points whose gradient strength is greater than a first preset threshold value from the plurality of pixel points; Obtaining a plurality of third pixel points, from among the plurality of second pixel points, whose gradient strength is greater than a second preset threshold, wherein the plurality of second pixel points are used to represent pixel points, from among the plurality of pixel points, that are adjacent to the plurality of first pixel points, and the second preset threshold is less than the first preset threshold; The plurality of edge pixel points are obtained based on the plurality of first pixel points and the plurality of third pixel points.

4. The method for detecting solder joint defects according to claim 3, wherein: Obtaining the plurality of edge pixel points based on the plurality of first pixel points and the plurality of third pixel points includes: Obtaining position information of the plurality of first pixel points and the plurality of third pixel points in the grayscale image; Based on the position information, pixel points with adjacent positional relationships among the plurality of first pixel points and the plurality of third pixel points are determined to obtain the plurality of edge pixel points.

5. The method for detecting solder joint defects according to any one of claims 1 to 4, characterized in that: Extracting parameters from the weld edge image to obtain weld shape information of the weld to be detected includes: Constructing an initial three-dimensional space, wherein a first dimension of the initial three-dimensional space represents the abscissa of the center position of the circle, a second dimension of the initial three-dimensional space represents the ordinate of the center position of the circle, and a third dimension of the initial three-dimensional space represents the radius of the circle; In the initial three-dimensional space, determining at least one welding circle based on the position coordinates of a plurality of edge pixel points in the weld edge image and a preset radius range; The weld point shape information is generated based on the at least one weld circle.

6. The method for detecting solder joint defects according to claim 5, wherein: In the initial three-dimensional space, determining at least one welding circle based on the position coordinates of a plurality of edge pixel points in the weld edge image and a preset radius range includes: Determining a plurality of first candidate circles based on the position coordinates of the plurality of edge pixel points and the preset radius range; performing an accumulation operation on overlapping circles in the plurality of first candidate circles to obtain a plurality of second candidate circles and accumulated values ​​corresponding to the plurality of second candidate circles, wherein the accumulated value is used to represent the number of first candidate circles contained in each second candidate circle; The at least one welding circle is obtained based on the circles in the plurality of second candidate circles whose accumulated values ​​are greater than a preset accumulated value.

7. The method for detecting solder joint defects according to any one of claims 1 to 4, characterized in that: The defect detection result is used to indicate whether the weld to be detected has a weld-through defect; Performing solder joint defect detection on the solder joint to be detected based on the solder joint shape information to obtain a defect detection result includes: When the number of welding circles in the weld shape information is less than a preset threshold, determining that the defect detection result is that the weld to be detected does not have the weld-through defect; When the number of welding circles in the welding spot shape information is greater than or equal to the preset threshold, the defect detection result is determined based on the positional relationship of the welding circles.

8. The method for detecting solder joint defects according to claim 7, wherein: Determining the defect detection result based on the positional relationship of the welding circles includes: Acquire a target welding circle and other welding circles in the welding circles, wherein the target welding circle is used to represent a circle with the largest radius in the welding circles, and the other welding circles are used to represent other circles in the welding circles except the target welding circle; determining whether there is a containment relationship between the target welding circle and the other welding circles based on a positional relationship between the target welding circle and the other welding circles; In response to the absence of an inclusion relationship between the target welding circle and the other welding circles, determining that the defect detection result is that the weld point to be detected does not have the weld-through defect; In response to the existence of an inclusion relationship between the target welding circle and the other welding circles, it is determined that the defect detection result is that the weld penetration defect exists in the weld to be detected.

9. An electronic device, characterized in that: include: a memory storing an executable program; A processor is used to run the program, wherein the program, when running, executes the method for detecting solder joint defects according to any one of claims 1 to 8.

10. A computer-readable storage medium, characterized in that The computer-readable storage medium includes a stored executable program, wherein when the executable program is run, the device where the storage medium is located is controlled to execute the solder joint defect detection method according to any one of claims 1 to 8.

Citation Information

Cited By

  • Detection method for changing welding spots and gold threads in chip detection and computer readable medium

    CN121053142A

  • Visual monitoring and early warning method and system for looseness of high-strength bolts of steel truss bridge

    CN121640371A

  • A steel truss bridge high-strength bolt loosening visual monitoring and early warning method and system

    CN121640371B

  • A pillar outer plate assembly adaptive glue coating process control method and system

    CN122386769A