Burr detection method, system and computer readable storage medium

Through rectangular fitting and free surface fitting technology of grayscale images and height images, the problem of inaccurate burr detection in the electrode welding area of ​​new energy batteries is solved, and high-precision, stability and compatibility burr detection is achieved.

CN114862816BActive Publication Date: 2024-11-26SHENZHEN HUAHAN WEIYE TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202210563954.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-05-23
Publication Date
2024-11-26
Estimated Expiration
2042-05-23

AI Technical Summary

Technical Problem

When the existing burr detection methods detect the height of the burr in the electrode welding area of ​​the new energy battery, there is a problem of inaccurate detection, especially the small burrs are easily extruded and deformed, resulting in errors in the detection result and are affected by environmental vibration and light.

Method used

Rectangular fitting and free surface fitting technology based on grayscale images and height images are used to obtain the reference surfaces of the solder printing area and the burr area, and non-contact detection is achieved through the image processing system to reduce the impact of noise and improve detection accuracy.

Benefits of technology

It improves the accuracy and stability of burr detection, realizes high-precision detection of the front and back sides of the electrode soldering area, reduces human factors and environmental interference, and enhances the compatibility and authenticity of the detection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114862816B_ABST
    Figure CN114862816B_ABST
Patent Text Reader

Abstract

A burr detection method, system and computer-readable storage medium are provided. According to the grayscale image of the product to be detected, the weld mark area of ​​the product to be detected and the burr area in the weld mark area are obtained based on the rectangular fitting method. The weld mark area of ​​the height image is subjected to free surface fitting processing. According to the burr area after the free surface fitting in the height image, the reference plane of the burr area of ​​the height image is obtained. The free surface fitting processing can repair the noise points so that the reference plane of the burr area is accurate. The reference plane of the burr area obtained is the actual surface of the product to be detected. With the reference plane of the burr area as the reference, the maximum height value of all pixel points contained in the burr area after the free surface fitting in the height image relative to the reference plane of the burr area is obtained, and the burr height value corresponding to the burr area is obtained, thereby improving the stability, compatibility, authenticity and accuracy of burr detection.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of image recognition technology, and in particular to a burr detection method, system and computer-readable storage medium. Background Art

[0002] In the field of product processing, it is often necessary to detect burrs on the product surface, for example, to detect burrs produced by the welding marks of the lugs of new energy batteries.

[0003] The connection between the tab and the pole piece of new energy batteries is usually made by ultrasonic welding or laser welding. Burrs may appear in the welding area after the tab is welded. If the burrs are too high, they will pierce the thinner green glue and isolation film, causing abnormal quality of the battery cell such as short circuit between the cathode and anode, and in severe cases, it will cause the battery to catch fire and explode. Therefore, it is necessary to detect the height of the burrs in the welding area of ​​the tab.

[0004] At present, height gauges or micrometers are often used to detect the height of burrs. However, burrs are usually very small. During the detection process, small burrs are easily squeezed and deformed, which makes the detected burr height inaccurate. Summary of the invention

[0005] The main technical problem solved by the present application is the problem of inaccurate burr height detected.

[0006] According to the first aspect, an embodiment provides a burr detection method, including:

[0007] Obtaining grayscale image and height image of the product to be inspected;

[0008] According to the grayscale image of the product to be inspected, based on a rectangular fitting method, a weld mark area of ​​the product to be inspected and a burr area within the weld mark area are obtained;

[0009] Performing free-form surface fitting processing on the weld imprint area of ​​the height image;

[0010] According to the burr area after free-form surface fitting in the height image, a reference plane of the burr area in the height image is obtained;

[0011] The maximum height values ​​of all pixel points contained in the burr area after free surface fitting in the height image relative to the reference plane of the burr area are obtained to obtain the burr height value corresponding to the burr area.

[0012] According to the second aspect, an embodiment provides a burr detection system, including:

[0013] The burr detection device is used to photograph the product to be detected to obtain a grayscale image and a height image of the product to be detected;

[0014] The image processing device is used to obtain the grayscale image and height image of the product to be detected through the burr detection device; according to the grayscale image of the product to be detected, based on the rectangular fitting method, obtain the weld mark area of ​​the product to be detected and the burr area in the weld mark area; perform free surface fitting processing on the weld mark area of ​​the height image; according to the burr area after free surface fitting in the height image, obtain the reference plane of the burr area of ​​the height image; obtain the maximum height value of all pixel points contained in the burr area after free surface fitting in the height image relative to the reference plane of the burr area, and obtain the burr height value corresponding to the burr area.

[0015] According to the third aspect, an embodiment provides a computer-readable storage medium, on which a program is stored, and the program can be executed by a processor to implement the method as described in the first aspect above.

[0016] According to the burr detection method, system and computer-readable storage medium of the above-mentioned embodiment, since the height image obtained by laser scanning is easily affected by factors such as surface reflection and forms noise, etc., based on the grayscale image of the product to be detected, the weld mark area of ​​the product to be detected and the burr area in the weld mark area are obtained based on the rectangular fitting method, and the weld mark area of ​​the product to be detected and the burr area in the weld mark area are obtained more accurately. The weld mark area of ​​the height image is subjected to free surface fitting processing, and the reference plane of the burr area of ​​the height image is obtained according to the burr area after the free surface fitting in the height image. The free surface fitting processing can repair the noise points, so that the reference plane of the burr area is accurate, and the reference plane of the burr area obtained is the actual surface of the product to be detected. Taking the reference plane of the burr area as the reference, the maximum height value of all pixels contained in the burr area after the free surface fitting in the height image relative to the reference plane of the burr area is obtained, and the burr height value corresponding to the burr area is obtained. The obtained burr height value has high precision and fast detection speed. In addition, the height value of the product to be detected is obtained by the image processing method of this embodiment, and the surface of the product to be detected does not need to be contacted during the detection process, and the detection result is more accurate. Furthermore, the burr height of the front and back sides of the product to be inspected can be detected based on the acquired height images of the front and back sides of the product to be inspected, that is, high-precision and stable detection of the front and back sides of the positive and negative tabs can be achieved. The entire detection process is not affected by the vibration of the production environment, ambient light, etc., as well as human subjective factors, which improves the stability of burr detection. This improves the stability, compatibility, authenticity and accuracy of burr detection. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] Figure 1A A positive electrode aluminum foil welding area of ​​a tab provided in an embodiment of the present application;

[0018] Figure 1B A schematic diagram of a front welding area of ​​a positive electrode tab provided in an embodiment of the present application;

[0019] Figure 1C A schematic diagram of a reverse welding area of ​​a positive electrode of a tab provided in an embodiment of the present application;

[0020] Figure 1D A tab negative electrode aluminum foil welding area provided in an embodiment of the present application;

[0021] Figure 1E A schematic diagram of a front welding area of ​​a tab negative electrode provided in an embodiment of the present application;

[0022] Figure 1F A schematic diagram of a reverse welding area of ​​a tab negative electrode provided in an embodiment of the present application;

[0023] Figure 2 A schematic diagram of the structure of a burr detection system provided in an embodiment of the present application;

[0024] Figure 3 A schematic diagram of a flow chart of a burr detection method provided in an embodiment of the present application;

[0025] Figure 4 A schematic diagram of a welding mark area and a burr area of ​​a tab to be detected provided in an embodiment of the present application;

[0026] Figure 5A A schematic diagram of one-dimensional boundary extraction provided in an embodiment of the present application;

[0027] Figure 5B A schematic diagram of a one-dimensional gray value profile provided in an embodiment of the present application;

[0028] Figure 5C A schematic diagram of a first-order derivative value of a gray value profile provided in an embodiment of the present application;

[0029] Figure 6 A schematic diagram of a rectangular fitting provided in an embodiment of the present application;

[0030] Figure 7 A schematic diagram of the structure of a burr area detection model provided in an embodiment of the present application;

[0031] Figure 8 A schematic diagram of a free-form surface fitting processing direction of a welding area provided in an embodiment of the present application;

[0032] Fig. 9 A schematic diagram of free-form surface fitting in a welding area provided in an embodiment of the present application;

[0033] Fig.10A schematic diagram of a reference plane calibration provided in an embodiment of the present application;

[0034] Fig.11 A schematic diagram of burr height and position provided in an embodiment of the present application. DETAILED DESCRIPTION

[0035] The present application is further described in detail below by specific embodiments in conjunction with the accompanying drawings. Wherein similar elements in different embodiments adopt associated similar element numbers. In the following embodiments, many detailed descriptions are intended to enable the present application to be better understood. However, those skilled in the art can easily recognize that some of the features can be omitted in different situations, or can be replaced by other elements, materials, and methods. In some cases, some operations related to the present application are not shown or described in the specification, in order to avoid the core part of the present application being overwhelmed by too much description, and for those skilled in the art, it is not necessary to describe these related operations in detail, and they can fully understand the related operations based on the description in the specification and the general technical knowledge in the art.

[0036] In addition, the features, operations or characteristics described in the specification can be combined in any appropriate manner to form various implementations. At the same time, the steps or actions in the method description can also be interchanged or adjusted in a manner that is obvious to those skilled in the art. Therefore, the various sequences in the specification and the drawings are only for the purpose of clearly describing a certain embodiment and are not meant to be a required sequence, unless otherwise specified that a certain sequence must be followed.

[0037] The serial numbers of the components in this document, such as "first", "second", etc., are only used to distinguish the objects described and do not have any order or technical meaning. The "connection" and "coupling" mentioned in this application, unless otherwise specified, include direct and indirect connections (couplings).

[0038] The present application can be applied to the inspection of burrs on the surfaces of various objects, for example, the inspection of burrs generated on metal workpieces due to some reasons, or the inspection of burrs generated on the surface of the pole ear after the pole ear and the pole piece are welded, etc. The burr detection method provided by the present application is described below by taking the inspection of burrs in the welding area of ​​the pole ear as an example.

[0039] In the field of new energy lithium battery manufacturing technology, the welding of lithium battery pole pieces and pole ears is generally carried out by ultrasonic welding or laser welding. After welding, there will be protruding burrs in the weld mark area. The burrs in this application refer to thorn-like objects with a larger height value than other areas. Figure 1A-1F The schematic diagram of the terminal ear is shown for explanation.

[0040] See also Figure 1A-Figure 1C , Figure 1A A tab positive electrode aluminum foil welding mark area is provided in an embodiment of the present application, wherein area 101 is three welding mark areas of the tab positive electrode. Figure 1B A schematic diagram of a positive welding area of ​​a tab positive electrode provided in an embodiment of the present application, Figure 1C A schematic diagram of the reverse side weld printing area of ​​a positive electrode tab provided in an embodiment of the present application.

[0041] See also Figure 1D-1F , Figure 1D A tab negative electrode aluminum foil welding mark area is provided in an embodiment of the present application, wherein area 102 is three welding mark areas of the tab negative electrode. Figure 1E A schematic diagram of a positive welding area of ​​a tab negative electrode provided in an embodiment of the present application, Figure 1F A schematic diagram of the reverse welding area of ​​a negative electrode tab provided in an embodiment of the present application.

[0042] It can be seen that there will be burrs in the weld mark area. Due to the instability of the laser welding power or the wear of the ultrasonic mold, the burr height in the weld mark area sometimes exceeds the specified specifications. Therefore, it is necessary to detect the burr height in the lug weld mark area on the battery electrode to determine the height of the burr and other information. For lugs whose burr height exceeds the preset height threshold, they can be considered as defective products to avoid the flow of defective products to the next process, resulting in the puncture of the diaphragm, causing batch defects, and causing further dangers. In addition, the weld mark area with burrs exceeding the preset height threshold can be marked with a red position and an alarm can be sounded, which is also instructive for the improvement of the welding process. Furthermore, the yield of the lug welding can be determined when the production line production equipment is started for mass production. At present, the rapid development of the new energy industry has put forward higher requirements for the burr height detection technology in the lug weld mark area.

[0043] Since the height of the burr is usually in the micron level and relatively small, burr detection is a high-precision test. Traditionally, micrometers or height gauges are used to measure the height of the burr. Contact detection will cause the burr to deform during the detection process and cannot accurately detect the actual height of the burr. The accuracy and stability of the detection process are affected by the subjective factors of the inspector, resulting in errors in the detection results. The reverse side of the weld mark area after welding will be concave and deformed. This contact detection cannot accurately confirm the detection benchmark, so it is only suitable for burr height detection on the front side of the tab weld mark.

[0044] Without solving the above problems, the present application provides a burr detection method and system. Figure 2 A burr detection system provided in this embodiment is introduced.

[0045] See also Figure 2 , Figure 2This is a schematic diagram of the structure of a burr detection system provided in an embodiment of the present application. The burr detection system provided in this embodiment may include: a burr detection device 21 and an electronic device 22. The burr detection device 21 and the electronic device 22 are in communication connection.

[0046] The burr detection device 21 can obtain the grayscale image and the height image of the pole ear to be detected, and send the grayscale image and the height image of the pole ear to be detected to the electronic device 22 .

[0047] The electronic device 22 obtains the weld mark area of ​​the product to be inspected and the burr area in the weld mark area through the grayscale image of the tab to be inspected, performs free surface fitting processing on the weld mark area in the height image according to the height image, obtains the reference plane of the burr area in the height image according to the burr area after the free surface fitting in the height image, and obtains the burr height value corresponding to the burr area according to the height values ​​of all pixel points contained in the burr area after the free surface fitting in the height image with the reference plane of the burr area as the reference, thereby determining the deburring height value.

[0048] Furthermore, the position information of the burr can also be determined.

[0049] Furthermore, the electronic device 22 may also send the obtained burr height value and / or burr position information to the burr detection device 21 for display.

[0050] The detection of burrs on the surface of the product is realized by non-contact detection. The grayscale image of the pole ear to be detected is used to determine the weld mark area and the burr area. The free surface fitting is performed on the weld mark area through the height image. According to the burr area after the free surface fitting in the height image, the reference plane of the burr area in the height image is obtained. The free surface fitting process can repair the noise points, so that the reference plane of the burr area is accurate, and the reference plane of the burr area obtained is the actual surface of the product to be detected. The reference plane of the burr area is used as a reference to obtain the maximum height value of all pixels contained in the burr area after the free surface fitting in the height image relative to the reference plane of the burr area, and the burr height value corresponding to the burr area is obtained. The obtained burr height value has high accuracy and fast detection speed. In addition, the height value of the product to be detected is obtained by the image processing method of this embodiment, and there is no need to contact the surface of the product to be detected during the detection process, and the detection result is more accurate. In addition, according to the height image of the front and back sides of the product to be detected, the burr height of the front and back sides of the product to be detected can be detected, that is, high-precision and stable detection of the front and back sides of the positive and negative pole ears can be achieved. The entire detection process is not affected by the vibration of the production environment, ambient lighting, and human subjective factors, which improves the stability of burr detection. Thereby improving the stability, compatibility, authenticity and accuracy of burr detection.

[0051] The electronic device 22 is a device with image processing capability, which can be a computer or a server, etc. The electronic device 22 can also be a host computer.

[0052] The burr detection method provided by the present application is introduced below with reference to a specific embodiment.

[0053] See also Figure 3 , Figure 3 A flow chart of a burr detection method provided in an embodiment of the present application is provided. The method of this embodiment is performed by an electronic device, which may be a burr detection device that directly obtains a grayscale image and a height image of a product to be detected, or an electronic device connected to the burr detection device, for example, Figure 2 The electronic device 22 shown in the present embodiment is as follows Figure 2 The electronic device 22 shown in the figure is used as an example for description. The method provided in this embodiment may include the following steps:

[0054] Step 31: Obtain a grayscale image and a height image of the product to be inspected.

[0055] Among them, the pixel value of the image in the grayscale image is the grayscale value, which represents the brightness of the position after imaging.

[0056] The pixel value of the image in the height image is a height value, which indicates the height of the position relative to the reference plane of the camera that takes the height image.

[0057] The grayscale image and the height image are obtained in the process of photographing the product to be inspected. The size of the grayscale image is the same as that of the height image. Each pixel of the grayscale image and the corresponding pixel in the height image are at the same position of the photographed product to be inspected. For example, the grayscale image and the height image of the product to be inspected can be obtained by the burr detection device in one imaging of the product to be inspected. The burr detection device can include a three-dimensional line laser profiler, that is, a three-dimensional camera, and the grayscale image and the height image are obtained by the three-dimensional camera.

[0058] Step 32: According to the grayscale image of the product to be inspected, based on a rectangular fitting method, the weld mark area of ​​the product to be inspected and the burr area within the weld mark area are obtained.

[0059] After the pole piece and the pole piece are welded, the position of the burrs in the welding area and the weld mark area is not fixed, whether it is the front or back of the pole piece. In order to detect the height of all burrs in the weld mark area, it is necessary to accurately locate the position of the burr area of ​​the product to be inspected. Because there is laser refraction when the three-dimensional camera of the burr detection equipment performs laser scanning, the laser refraction will affect the imaging of the obtained height image and form noise in the non-burr area of ​​the height image. Therefore, the adaptive search of the burr area is to process the grayscale image. The weld mark area of ​​the product to be inspected and the burr area in the weld mark area can be obtained by recognizing the grayscale image based on the rectangular fitting method.

[0060] The weld mark area refers to the area of ​​the product to be tested that may contain burrs, for example, the weld mark area refers to the part where the pole ear and the pole piece are welded. It can be understood that the weld mark area can be one or more areas, for example Figure 1A-1F There are 3 welding areas in the figure.

[0061] The burr area refers to the area where the burr is located. It can be understood that the burr area can be one or more areas, and the number of burr areas depends on the situation of the product to be detected.

[0062] Step 33: Perform free-form surface fitting processing on the weld area of ​​the height image.

[0063] Free-form surface fitting is the processing of the height map collected by the 3D camera. After the pole ear and pole piece are welded, the surface of the weld area usually presents an irregular ups and downs and uneven surface. Due to the presence of burrs and noise interference during imaging, the burr area and noise should not be calculated when extracting the surface. Therefore, it is necessary to perform free-form surface fitting on the weld area to obtain a height image after free-form surface fitting.

[0064] See also Figure 4 , Figure 4 A schematic diagram of identifying a weld mark area and a burr area of ​​a tab to be detected provided in an embodiment of the present application. The figure shows two weld mark areas, namely a first weld mark area 42 and a second weld mark area 43. The grayscale image of the tab 41 is identified to obtain the first weld mark area 42 and the second weld mark area 43, wherein the boundary of the weld mark area is an edge 421, and the star-shaped areas in the second weld mark area 43 are all burr areas 431.

[0065] Step 34: According to the burr area after the free-form surface is fitted in the height image, a reference surface of the burr area in the height image is obtained.

[0066] Usually, the reference for detecting the burr height in the weld mark area of ​​the tab is in the non-weld mark area of ​​the tab, so that the detected burr height value is not the actual height of the burr. After the tab is welded, a layer of green glue will be attached to the front and back of the tab, and this layer of green glue will be close to the weld mark area. Therefore, the burr height detection should take its bottom as the reference. In order to truly detect the burr height in the weld mark area of ​​the product to be inspected, it is necessary to use the surface near the bottom of the burr to be detected as the reference for detection. Since some noise is filtered out in the height image after free surface fitting, and the discontinuous areas in the height image are repaired, the above steps have performed free surface fitting on the height image. Therefore, based on the burr area after free surface fitting in the height image, the reference surface of the burr area of ​​the height image is obtained.

[0067] The reference plane refers to the reference for calculating the burr height, that is, the height value of the reference plane is 0, and the reference plane can also be called the height reference plane.

[0068] It should be noted that if there are multiple burr regions, each burr region corresponds to a reference plane, and the reference plane corresponding to each burr region can be determined respectively.

[0069] Step 35: Obtain the maximum height value of all pixel points contained in the burr area after free surface fitting in the height image relative to the reference plane of the burr area, and obtain the burr height value corresponding to the burr area.

[0070] Taking the reference plane of the burr area as a reference, the height difference of each pixel point in the burr area relative to the reference plane can be obtained, and the maximum height value is the burr height value corresponding to the burr area.

[0071] The burr height value is the maximum height value of the burr, that is, the maximum height value among the height differences of all pixels included in the burr area.

[0072] In this embodiment, by obtaining the grayscale image and height image of the product to be detected, since the height image obtained by laser scanning is easily affected by factors such as surface reflection and forms noise, etc., the weld mark area of ​​the product to be detected and the burr area in the weld mark area are obtained according to the grayscale image of the product to be detected, and the weld mark area of ​​the product to be detected and the burr area in the weld mark area are obtained more accurately. The weld mark area of ​​the height image is subjected to free surface fitting processing, and the reference plane of the burr area of ​​the height image is obtained according to the burr area after the free surface fitting in the height image. The free surface fitting processing can repair the noise points, so that the reference plane of the burr area is accurate, and the reference plane of the burr area obtained is the actual surface of the product to be detected. With the reference plane of the burr area as the reference, the maximum height value of all pixels contained in the burr area after the free surface fitting in the height image relative to the reference plane of the burr area is obtained, and the burr height value corresponding to the burr area is obtained. The obtained burr height value has high precision and fast detection speed. In addition, the height value of the product to be detected is obtained by the image processing method of this embodiment, and the surface of the product to be detected does not need to be contacted during the detection process, and the detection result is more accurate. Furthermore, the burr height of the front and back sides of the product to be inspected can be detected based on the acquired height images of the front and back sides of the product to be inspected, that is, high-precision and stable detection of the front and back sides of the positive and negative tabs can be achieved. The entire detection process is not affected by the vibration of the production environment, ambient light, etc., as well as human subjective factors, which improves the stability of burr detection. This improves the stability, compatibility, authenticity and accuracy of burr detection.

[0073] In some embodiments, there are multiple weld mark areas on the front or back of the same tab after welding, so in step 32, the entire weld mark area can be matched first, and then the burr area in the weld mark area can be matched, so as to accurately find the burr area and reduce the processing time. The following is a detailed description with specific embodiments.

[0074] On the basis of the above embodiment, step 32 may further include the following steps 321-322:

[0075] Step 321: Determine the welding mark area of ​​the product to be inspected based on the grayscale image of the product to be inspected and based on a rectangular fitting method.

[0076] The weld mark area in the grayscale image of the product to be inspected is usually a regular rectangle, and the grayscale value of the weld mark area is larger than that of the non-weld mark area. Therefore, the weld mark area can be extracted based on the rectangle fitting method according to the difference between the grayscale values ​​of the pixels of the grayscale image.

[0077] Optionally, step 321 may be performed through the following steps 3211 and 3212:

[0078] Step 3211: perform one-dimensional boundary extraction on the grayscale image of the product to be inspected to obtain boundary points of the welding area of ​​the product to be inspected.

[0079] See also Figure 5A , Figure 5A A schematic diagram of one-dimensional boundary extraction is provided for an embodiment of the present application. FIG5 exemplarily shows a weld mark area 52 obtained in a tab 51. The weld mark area 52 in the grayscale image is a regular rectangle, and the grayscale value of the weld mark area 52 is larger than the grayscale value of the non-weld mark area. Then, discrete derivative calculations can be performed along the X direction and the Y direction of the grayscale image to obtain the weld mark area of ​​the product to be inspected, wherein the image is defined in the X direction and the Y direction in the present application, the X direction can also be referred to as the X direction, and the Y direction can also be referred to as the Y direction. A specific implementation method is as follows:

[0080] Boundaries are set on the four sides of the weld area 52 to extract the region of interest (RoI), and similar processing is performed on each region of interest. Figure 5A The boundary extraction region of interest 53 of the right boundary of the weld mark area 52 is exemplarily shown in the figure. The boundary extraction region of interest 53 set at the right boundary of the weld mark area 52 is described below. The boundary extraction region of interest 53 includes multiple pixels. Each row of pixels in the boundary extraction direction 55 is a boundary point extraction segment 54.

[0081] Set the width w of the boundary point extraction segment, calculate the grayscale average along the boundary extraction direction 55, and obtain a one-dimensional grayscale value profile, such as Figure 5B As shown, the vertical axis in the figure is the grayscale average value.

[0082] calculate Figure 5B The derivative of the center point of the parabola fitted by every three consecutive grayscale average points in . The derivative of each grayscale average point can be obtained by the following formula (1):

[0083]

[0084] Among them, f i ' is the derivative of the i-th grayscale mean point, f i+1 and f i-1 are the grayscale averages adjacent to the i-th grayscale average.

[0085] The derivatives of the grayscale values ​​of all points in the boundary point extraction section 54 can be obtained by Figure 5C Intuitively, Figure 5C A schematic diagram of a first-order derivative value of a gray value profile provided in an embodiment of the present application, showing the first-order derivative value of the gray value profile. Figure 5CIt can be seen that the derivative of the gray value decreases at the boundary, and the boundary position can be obtained based on this feature.

[0086] According to the preset boundary point, the threshold T is extracted and the absolute value of the first-order derivative is segmented by the threshold. That is, when |f i '|≥T and|f' i |>|f' i-1 | and |f' i |>|f' i+1 |, the i-th pixel point is the boundary point n of the boundary point extraction segment 54 i .

[0087] Calculate each boundary of the weld print area in turn to extract RoI and perform the above processing to extract n boundary points (x i ,y i ).

[0088] Step 3212: Perform rectangle fitting processing on the boundary points to obtain the welding area.

[0089] The weld mark area can be obtained according to the boundary points. Since the weld mark area is a rectangle, the weld mark area of ​​the product to be inspected can be subjected to rectangular fitting processing to generate an outer pattern of the weld mark area. Usually, the weld mark area is a rectangle, so the outer pattern can also be a rectangle, and the weld mark area is within the outer pattern. The center of gravity of the outer pattern coincides with that of the weld mark area.

[0090] See also Figure 6 , Figure 6 A rectangular fitting schematic diagram provided in an embodiment of the present application, wherein: Figure 6 An example of a weld mark area is shown. According to the boundary points 61 obtained above, the centroid 62 of the weld mark area can be obtained, and the grayscale image is subjected to rectangular fitting to obtain an outer rectangle 63. A method of obtaining the outer rectangle 63 is described in detail below.

[0091] The centroid of the weld area is obtained according to the following formula (2):

[0092]

[0093] Where n is the number of boundary points in the weld area, (x i ,y i ) are the coordinates of the boundary points of the welding area.

[0094] All boundary point sets are divided into four regions by the barycentric coordinates, such as the four regions shown in Figure 5. For each of the four regions, the boundary point with the largest distance from the barycentric in the region, that is, the boundary point farthest from the barycentric, is determined. Thus, a total of four boundary points are obtained, which can be called the initial values ​​of the vertices. The coordinates of the vertices are solved below, and the coordinates of the vertices can be represented by C1, C2, C3 and C4 respectively.

[0095] The boundary point set is divided into 4 groups with 4 vertices as boundaries. The number of pixel coordinate sets in these 4 groups are n1, n2, n3 and n4 respectively. Then the coordinate expression of each group of boundary points is: {P i |(x ij ,y ij )}, where P i represents the point set of the i-th group, and j represents the j-th boundary point in the i-th group.

[0096] By fitting a rectangle on the image, the straight lines where the four sides of the rectangle are located can be obtained through the parallel and perpendicular geometric features. The straight lines where the four sides of the rectangle are located can be obtained by the following formula (3):

[0097]

[0098] Where k1 and k2 are the coefficients to be estimated for the straight line equation; b1, b2, b3 and b4 are the intercepts to be estimated for the straight line equation. Substituting the coordinates of the boundary points into the above formula (3), we can obtain the constrained least squares equation of the following formula (4):

[0099]

[0100] Among them, r ij Represents the distance from the jth point to the i-th straight line in the set of points in the i-th group.

[0101] After sorting, it can be expressed as: Ax = b, where x = [b1, b2, b3, b4, k1, k2] T , b=[r1,r2,r3,r4] T , where [r1, r2, r3, r4] is a 0 vector whose dimension is the same as the number of pixels in each group. The matrix A can be expressed as:

[0102] in,

[0103]

[0104] Solve the above formula (4) by least squares to obtain the parameters (b1, b2, b3, b4, k1, k2) TSubstitute the value of into formula (3) to calculate the coordinates of the four vertices (C1, C2, C3, C4) after the rectangular fitting. Then the center coordinates of the weld print area can be obtained by the following formula (5):

[0105]

[0106] Among them, (x0, y0) is the center coordinate of the weld print area, are vertex coordinates respectively. Thus, the four vertices are the four vertices of the rectangle where the weld mark area is located. Thus, the weld mark area is obtained.

[0107] Step 322: According to the weld mark area, a burr area in the weld mark area is obtained.

[0108] In one possible implementation, the burr area within the weld mark area may be identified using a traditional machine learning method.

[0109] In another possible implementation, the grayscale image marked with the position of the weld mark area can also be input into the burr area detection model to obtain the burr area in the weld mark area. The burr area detection model is a pre-trained deep learning segmentation model based on deep learning, which is used to detect the image input into the burr area detection model to obtain the burr area of ​​the image.

[0110] See below Figure 7 , Figure 7 A structural schematic diagram of a burr area detection model provided in an embodiment of the present application, the burr area detection model includes a feature encoder and a feature decoder. A grayscale image marked with the position of the weld mark area is input into the burr area detection model, and the grayscale image marked with the position of the weld mark area is subjected to feature extraction through the multi-layer feature extraction layer of the feature encoder to obtain a feature map, the feature map is segmented, and then the feature map is restored through the feature decoder to obtain the burr area.

[0111] Optionally, when pre-training the burr region detection model, the burr region may be pre-marked in the training sample image as label data of the training sample image.

[0112] In this embodiment, the burr area is adaptively searched, and the location of the burr area of ​​the product to be inspected can be effectively, stably and accurately found.

[0113] In some embodiments, the identification of the weld mark area may not be accurate enough, that is, some burrs may be in the area outside the edge of the weld mark area, so the weld mark area can be enlarged before subsequent identification.

[0114] On the basis of the above embodiment, further, the following step 3220 may be included before step 322, and correspondingly, step 322 may be implemented by the following step 3221.

[0115] Step 3220: Generate an outsourcing graphic based on the weld print area of ​​the product to be inspected.

[0116] The weld print area is within the outer package image, and the center of gravity of the outer package image coincides with the center of gravity of the weld print area of ​​the product to be inspected.

[0117] Usually the weld print area is a rectangle, therefore, the outer package image can be a rectangle and a rectangular fitting process can be performed on the weld print area of ​​the product to be inspected to generate an outer package image of the weld print area.

[0118] Set the height of the outer rectangle of the weld area to H and the width to W, so that the values ​​of height H and width W are larger than the size of the weld area, and the outer rectangle area R is calculated with the center of gravity of the weld area. s Generation of.

[0119] Step 3221: Input the grayscale image of the marked outsourcing graphic into the burr area detection model to obtain the burr area within the weld mark area.

[0120] By identifying the burr area in the outer graphics of the weld print area, the identified burr area is more comprehensive, thereby increasing the detection accuracy.

[0121] In this embodiment, since the height image is affected by many factors and may produce noise and other effects, the grayscale image is used to identify the weld mark area and the burr area, so that the identified weld mark area and the burr area are more accurate, and the subsequent inspection results are more accurate. In addition, since there are multiple weld mark areas on the front or back side of the same tab after welding, the entire weld mark area is matched first, and then the burr area within the weld mark area is matched, so as to achieve accurate search of the burr area and reduce processing time.

[0122] In some embodiments, in step 33, the height image may be subjected to free-form surface fitting processing along the X direction and the Y direction, and then the processing results in the X direction and the Y direction are combined to obtain a height image after free-form surface fitting.

[0123] On the basis of the above embodiment, further, step 33 can be obtained through the following steps 331 to 333.

[0124] Step 331: Perform free-form surface fitting processing on each row of pixel points in the weld printing area of ​​the height image to obtain a height image after fitting along the X direction.

[0125] See also Figure 8 , Figure 8A schematic diagram of the free-form surface fitting processing direction of a weld print area provided in an embodiment of the present application. The weld print area 83 is included in the outer rectangular area 84 of the weld print area, and the hexagonal star area is the burr area 82 (a burr area is exemplarily marked in the figure). The weld print area in the height image is processed in the X direction, and a row of pixels 81 is obtained each time until all rows of the weld print area in the X direction are obtained and processed, so that all pixel points of the weld print area are processed in the X direction, and the height value of each pixel point in the weld print area after fitting along the X direction is obtained, thereby obtaining a height image after fitting along the X direction.

[0126] Step 332: Perform free-form surface fitting processing on each column of pixel points in the weld printing area of ​​the height image to obtain a height image after fitting along the Y direction.

[0127] The weld area in the height image is processed one column of pixel points 85 each time along the Y direction until all columns of the weld area along the Y direction are acquired and processed, thereby processing all pixel points in the weld area along the Y direction, and obtaining the height value of each pixel point in the weld area after fitting along the Y direction, thereby obtaining a height image after fitting along the Y direction.

[0128] Step 333: Obtain a height image after fitting of the free-form surface according to the height image after fitting along the X direction and the height image after fitting along the Y direction.

[0129] Optionally, the target height value of each pixel in the height image after the free-form surface is fitted is an average value of the height value after fitting along the X direction and the height value after fitting along the Y direction.

[0130] The target height value of each pixel in the height image after free surface fitting can be obtained according to the following formula (6):

[0131]

[0132] Among them, y i is the target height value of the i-th pixel, is the height value of the i-th pixel after fitting along the X direction, is the height value of the i-th pixel after fitting along the Y direction.

[0133] In this embodiment, the height data of the weld print area is subjected to free surface fitting processing in the X direction and the Y direction respectively, and the results of the free surface fitting processing in the X direction and the Y direction are combined to obtain a height image after the free surface fitting. Since the surface of the product to be detected is continuous, the free surface fitting processing can be performed in any direction. In this embodiment, the free surface fitting processing is performed in two directions, the X direction and the Y direction, and the fitting process is fast and accurate. In addition, the influence of the height fluctuation, burr height and height noise of the weld print area itself can be eliminated, and the height detection reference surface corresponding to each burr area can be stably and accurately calculated.

[0134] In some embodiments, step 331 may be implemented in a variety of ways. The following is a specific example to illustrate one implementation of step 331 of the present application.

[0135] On the basis of the above embodiment, further, step 331 can be implemented through the following steps 3311 and 3312.

[0136] Step 3311: Perform the following processing steps a to c for each row of the weld printing area of ​​the height image.

[0137] Step a: Acquire a first pixel point from the weld area of ​​the height image.

[0138] The first pixel point is all the pixel points of the target row of the weld area in the height image. In this application, the row acquired each time is referred to as the target row.

[0139] Step b: performing interpolation processing on the first pixel point to be corrected to obtain a height value of the first pixel point to be corrected after the interpolation processing.

[0140] The first pixel to be corrected is the first pixel located in the burr area or invalid area. Since there are often some invalid pixels in the height image, the height value of the invalid pixel is invalid. For example, the pixel whose height value exceeds the hardware field of view is an invalid pixel. The invalid area is the area where some invalid points in the height image are located.

[0141] Among them, the interpolation processing can adopt interpolation processing methods such as nearest neighbor interpolation method or bilinear interpolation method, and this application does not limit this.

[0142] Interpolation processing is performed on the first pixel point to be corrected that is located in the burr area and the invalid area among all the pixel points in the target row, so as to correct the pixel points in the burr area and the invalid area. After the above interpolation processing, the height values ​​of all the first pixel points can be called the height values ​​after interpolation processing. That is, if the first pixel point is the first pixel point to be corrected, the height value of the first pixel point after interpolation processing is the height value of the first pixel point after interpolation processing, and if the first pixel point is the first pixel point other than the first pixel point to be corrected, the height value of the first pixel point after interpolation processing is the height value of the first pixel point.

[0143] Furthermore, after step b, the following step b1 may be included.

[0144] Step b1: interpolate the first pixel points at both ends of the target line according to the parabola fitting length.

[0145] The parabola fitting length may be preset, and may also be referred to as a segment size of the parabola fitting. The preset parabola fitting length may be an odd number.

[0146] According to the preset parabola fitting length n, the first pixel points at both ends of the contour data are interpolated, and the number of interpolations can be (n-1) / 2.

[0147] Optionally, in step b1, an interpolation processing method such as a mirror interpolation method or a linear interpolation method may be used.

[0148] Step c: Based on parabola fitting, iteratively process the interpolated height value of the first pixel point to obtain the fitted height value of the first pixel point along the X direction.

[0149] The interpolated height value of the first pixel includes the interpolated height value of the first pixel to be corrected and the height values ​​of the first pixel except the first pixel to be corrected.

[0150] Based on the parabola fitting method, the first pixel point is iteratively processed in an iterative manner to make the height value after fitting closer to the parabola fitting equation y=ax 2 +bx+c, where y is the height value of the first pixel, x is the coordinate value of the first pixel in the X direction, and a, b, and c are the parameters of the parabola fitting equation.

[0151] Optionally, in step c, the objective function shown in the following formula (7) can be used to solve the parameters a, b and c through iterative processing.

[0152]

[0153] Among them, yi is the height value of the first pixel after fitting, x i is the coordinate value of the ith first pixel in the X direction, N is the number of first pixels, and a, b, and c are the parameters of the parabola fitting equation respectively.

[0154] Optionally, step c can be obtained by the following steps c1 to c5:

[0155] Step c1: Obtain the initial parameters of the parabola fitting equation according to the following formula (8):

[0156]

[0157] Among them, a, b, c are the initial parameters to be solved for the parabola fitting equation, x i is the coordinate of the first pixel of the i-th pixel, y i is the height value of the i-th first pixel after interpolation processing, and n is the number of first pixels.

[0158] Step c2: Obtain the fitting value of each first pixel point according to the parabola fitting equation obtained from the initial parameters of the parabola fitting equation and the X-direction coordinate of each first pixel point.

[0159] The fitting value of the first pixel is the height value of the first pixel after fitting.

[0160] Optionally, the fitting value of each first pixel point can be obtained according to the following formula (9):

[0161]

[0162] Among them, y′ i is the fitting value of the first pixel of the i-th point, x i is the X-direction coordinate of the i-th first pixel point, and a, b, c are the parameters of the parabola fitting equation.

[0163] Step c3: Obtain a weight coefficient for each first pixel point according to the residual between the fitting value of each first pixel point and the height value after interpolation processing and the standard deviation of the residual.

[0164] The weight coefficient of the first pixel point may be expressed in a Huber or Tukey weight coefficient manner.

[0165] Exemplarily, the weight coefficient of each first pixel can be obtained according to the following formula (10):

[0166]

[0167] Among them, ω iis the weight coefficient of the first pixel of the ith pixel, d i is the residual between the fitted value of the i-th first pixel and the height value after interpolation, σ is the standard deviation of the residual, and ρ is the parameter for adjusting the weight coefficient.

[0168] Among them, ω i The initial value can be set to 1.

[0169] Step c4: Obtain the adjustment parameters of the parabola fitting equation according to the following formula (11):

[0170]

[0171] Among them, a, b, c are the adjustment parameters of the parabola fitting equation, ω i is the weight coefficient of the first pixel of the ith pixel, x i is the coordinate of the first pixel of the i-th pixel, y i is the height value of the i-th first pixel after interpolation processing, and n is the number of first pixels.

[0172] Substitute the residual into the parabola fitting for the height data of the rectangular area outside the weld mark.

[0173] Step c5: Update the initial parameters of the parabola fitting equation to the adjustment parameters of the parabola fitting equation, return to execute the parabola fitting equation obtained according to the initial parameters of the parabola fitting equation and the X-direction coordinates of each first pixel point, obtain the fitting value of each first pixel point, until the iteration stop condition is met, and determine that the height value of the first pixel point after fitting along the X-direction is the fitting value of the first pixel point.

[0174] The iteration stopping condition may be: the difference between the cumulative errors obtained from two iterations is less than a preset threshold, or the number of iterations reaches a preset number.

[0175] After the iteration stops, the calculated y′ i That is the free surface fitting height data in the X direction, which can be used express.

[0176] Step 3312: Obtain a height image fitted along the X direction according to the height values ​​of the first pixel points of all target rows after fitting along the X direction.

[0177] In this embodiment, free-form surface fitting processing is performed on the weld mark area, which can eliminate the influence of height fluctuation, burr height and height noise of the weld mark area itself, and stably and accurately calculate the height detection reference surface corresponding to each burr area.

[0178] Optionally, step 332 may be implemented through the following steps 3321 and 3322.

[0179] Step 3321: For each column of the weld print area in the height image, perform the following processing:

[0180] The second pixel points are acquired from the weld print area in the height image, and the second pixel points are all the pixel points of the target column of the weld print area in the height image.

[0181] An interpolation process is performed on the second pixel point to be corrected to obtain a height value of the second pixel point to be corrected after the interpolation process. The second pixel point to be corrected is a second pixel point located in a burr area or an invalid pixel point.

[0182] Based on parabola fitting, the interpolated height value of the second pixel point is iteratively processed to obtain the fitted height value of the second pixel point along the Y direction. The interpolated height value of the second pixel point includes the interpolated height value of the second pixel point to be corrected and the height values ​​of the second pixel points other than the second pixel point to be corrected.

[0183] Step 3322: Obtain a height image fitted along the Y direction according to the height values ​​of the second pixel points of all target columns after fitting along the Y direction.

[0184] It should be noted that since the implementation method of step 3321 is similar to that of step 3311, and the implementation method of step 3322 is similar to that of step 3312, they will not be repeated here.

[0185] Combine the following Fig. 9 The method of the above-mentioned embodiment is described.

[0186] See also Fig. 9 , Fig. 9 A schematic diagram of free-form surface fitting of a weld mark area provided in an embodiment of the present application can be used to interpolate the first pixel to be corrected in the burr area 906 through the above step b to obtain interpolated data. The weld mark area header interpolation data 910 and the weld mark area tail interpolation data 5 can be obtained through the above step b1. Fig. 9 The dots in the figure are all height values. The outer rectangular area 901 of the weld print area is fitted along the direction 909. For the fitted segment 907, a parabola 902 of height data fitting is formed according to the fitted pixel point 904 in the fitted segment 907 and the fitted target height value 908 obtained after the parabola fitting of the target pixel point 903.

[0187] In some embodiments, the product to be inspected may be scanned and imaged multiple times. After the free surface fitting of step 33 is completed for the weld print area, the target height value obtained still fluctuates in the burr area and the noise area. In order to make the reference object value during height detection more stable, improve the stability of burr height detection, and meet the static and dynamic repeatability detection accuracy during equipment detection, the height reference surface needs to be calibrated. A process of reference surface calibration is described in detail below with a specific embodiment.

[0188] On the basis of the above embodiment, further, step 34 may include the following steps 341 and 342 .

[0189] Step 341: For each pixel point in the burr area after free surface fitting in the height image, in the height image after surface fitting, a corrected height value of the pixel point is obtained according to the height values ​​of the pixel points in the neighborhood of the pixel point.

[0190] The height values ​​of the pixels in the burr area may be averaged in four or eight neighborhoods to obtain the corrected height values ​​of the pixels.

[0191] The mean of the above four neighborhoods can be obtained by the following formula (12):

[0192]

[0193] in, is the corrected height value of the i-th pixel, y i is the height value of the pixels in the four neighborhoods of the i-th pixel.

[0194] The mean of the above eight neighborhoods can be obtained by the following formula (13):

[0195]

[0196] in, is the corrected height value of the i-th pixel, y i is the height value of the pixel in the eight-neighborhood of the i-th pixel.

[0197] See also Fig.10 , Fig.10 A schematic diagram of reference surface calibration provided in an embodiment of the present application, wherein the four neighborhoods of the pixel points of the burr area in the weld area 102 contained in the weld outer rectangular area 101 are the gray areas 103 marked in the figure, and the eight neighborhoods of the pixel points of the burr area are the gray areas 104 marked in the figure.

[0198] Step 342: performing plane fitting on the burr regions after the surface fitting in the height image to obtain a reference plane of the burr region.

[0199] A plane fitting is performed on the height data in each burr area to obtain a stable height detection reference plane corresponding to each burr area.

[0200] In this embodiment, the static and dynamic repeatability detection accuracy during equipment detection can be effectively met by calibrating the height reference surface.

[0201] In some embodiments, step 35 may be implemented by:

[0202] Step 351: Calculate each burr area R i All pixels (x i ,y i ) to the corresponding reference surface P i The distance D i .

[0203] Step 352: Obtain the maximum distance max(D i ) to obtain the burr height value of the burr area.

[0204] See also Fig.11 , Fig.11 A schematic diagram of burr height and position provided in an embodiment of the present application. A burr area 112 is exemplarily shown in the weld mark area 111, and the height of each burr area is detected on the reference plane P i As a benchmark, calculate the burr area R i The pixel point 113 with the maximum height value within is the burr height value.

[0205] Further, step 352 may include the following steps 3521-3522.

[0206] Step 3521: Obtain the maximum distance max(D i ) corresponds to the coordinate (x Mi ,y Mi ).

[0207] Step 3522: Correct the maximum distance to obtain the burr height value.

[0208] Optionally, you can use a point (x Mi ,y Mi ) as the center, calculate the distance mean in the 3×3 area 114, that is, It is the burr height value of the burr area.

[0209] In this embodiment, the pixel point with the maximum height value in the burr area is corrected so that the burr height value is more accurate.

[0210] In some scenarios, the burr position needs to be detected so that the exact position of the burr can be used to provide targeted guidance for the production equipment or process of the product to be tested. In addition to obtaining the burr height value, the position of the center of gravity of the burr can be obtained as the burr position.

[0211] Furthermore, the acquisition of the burr position may be performed by an electronic device, and after the electronic device acquires the burr position and the burr height value, the burr position and the burr height value may be sent to the burr detection device.

[0212] On the basis of the above embodiment, further, after step 35, the following steps 36 and 37 may be included.

[0213] Step 36: Determine the test result.

[0214] The detection result includes: the burr height value of the burr area and the position information of the center of gravity of the burr.

[0215] The position information of the center of gravity of the burr can be the coordinates (x Mi ,y Mi ).

[0216] Step 37: Send the detection result to the burr detection device.

[0217] Furthermore, the detection results can be sent to the host computer, and the host computer software displays the processing results on a display connected to the host computer, and stores the detection data in a fixed format data table for easy reference by relevant personnel. The host computer performs subsequent recording and alarm processing to complete the entire process of burr height detection in the lug welding mark area.

[0218] In this embodiment, in addition to obtaining the burr height value, the burr position can also be obtained, which has good guidance for process analysis and improvement. The method can detect the height of all burrs in the weld mark area, and mark all burr positions on the image, and specially mark the highest burr, which is convenient for quality personnel and process personnel to analyze and improve distraction problems.

[0219] In some scenarios, it is necessary to perform burr detection on the product to be inspected to determine whether the product to be inspected is qualified. The following is a detailed description with specific embodiments.

[0220] On the basis of the above embodiment, further, the following step 38 may be included after step 35.

[0221] Step 38: Determine whether all burr height values ​​are respectively less than or equal to a height threshold.

[0222] If yes, it is determined that the product to be tested is qualified. If no, it is determined that the product to be tested is unqualified.

[0223] In this embodiment, after obtaining the burr height values ​​corresponding to all burr areas of the product to be detected, the burr height detection threshold D of the tab weld mark area is set. T , a tolerance is determined for each burr height value calculated above, and the coordinate position is marked. According to the height threshold, it is determined whether all burr height values ​​are too high, so as to determine whether the product to be tested is qualified.

[0224] In some embodiments, the present application provides a computer-readable storage medium having a program stored thereon, and the program can be executed by a processor to implement the burr detection method of any of the above embodiments.

[0225] Those skilled in the art will appreciate that all or part of the functions of the various methods in the above-mentioned embodiments can be implemented by hardware or by computer programs. When all or part of the functions in the above-mentioned embodiments are implemented by computer programs, the program can be stored in a computer-readable storage medium, and the storage medium can include: read-only memory, random access memory, disk, optical disk, hard disk, etc., and the program is executed by a computer to implement the above-mentioned functions. For example, the program is stored in the memory of the device, and when the program in the memory is executed by the processor, all or part of the above-mentioned functions can be implemented. In addition, when all or part of the functions in the above-mentioned embodiments are implemented by computer programs, the program can also be stored in a storage medium such as a server, another computer, disk, optical disk, flash disk or mobile hard disk, and can be downloaded or copied and saved in the memory of the local device, or the system of the local device is updated, and when the program in the memory is executed by the processor, all or part of the functions in the above-mentioned embodiments can be implemented.

[0226] The above specific examples are used to illustrate the present application, which is only used to help understand the present application and is not intended to limit the present application. For technicians in the technical field to which the present application belongs, they can also make some simple deductions, deformations or substitutions based on the ideas of the present application.

Claims

1. A burr detection method, It is characterized in that include: Obtaining grayscale image and height image of the product to be inspected; According to the grayscale image of the product to be inspected, based on a rectangular fitting method, a weld mark area of ​​the product to be inspected and a burr area within the weld mark area are obtained; Performing free-form surface fitting processing on the weld imprint area of ​​the height image; According to the burr area after free-form surface fitting in the height image, a reference plane of the burr area in the height image is obtained; Obtaining the maximum height value of all pixel points contained in the burr area after free-form surface fitting in the height image relative to the reference plane of the burr area, and obtaining the burr height value corresponding to the burr area; The step of performing free-form surface fitting processing on the weld area of ​​the height image includes: For each row of the weld print area of ​​the height image, interpolation processing is performed on the pixel points located in the burr area or the invalid area, so as to correct the height values ​​of the pixel points located in the burr area or the invalid area, and based on parabola fitting, the height values ​​of the pixel points in the row are iteratively processed to obtain the height values ​​of the pixel points in the row after fitting along the X direction; according to the height values ​​of the pixel points in all rows after fitting along the X direction, a height image after fitting along the X direction is obtained; For each column of the weld print area of ​​the height image, interpolation processing is performed on the pixel points located in the burr area or the invalid area, so as to correct the height values ​​of the pixel points located in the burr area or the invalid area, and based on parabola fitting, the height values ​​of the pixel points in the column are iteratively processed to obtain the height values ​​of the pixel points in the column after fitting along the Y direction; according to the height values ​​of the pixel points in all columns after fitting along the Y direction, a height image after fitting along the Y direction is obtained; A height image after fitting of the free-form surface is obtained according to the height image after fitting along the X direction and the height image after fitting along the Y direction.

2. The method according to claim 1, It is characterized in that The iterative processing of the height values ​​of the pixels in the row based on parabola fitting to obtain the height values ​​of the pixels in the row after fitting along the X direction includes: The initial parameters of the parabola fitting equation are obtained according to the following formula: Among them, a, b, c are the initial parameters of the parabola fitting equation, x i is the coordinate of the i-th pixel in the row, y i is the height value of the i-th pixel in the row, and n is the number of pixels in the row; Obtaining a fitting value for each pixel based on a parabola fitting equation obtained from the initial parameters of the parabola fitting equation and the X-direction coordinate of each pixel; Obtaining a weight coefficient for each pixel point according to a residual between a fitting value of each pixel point and the height value and a standard deviation of the residual; The adjustment parameters of the parabola fitting equation are obtained according to the following formula: Among them, a, b, c are the adjustment parameters of the parabola fitting equation, ω i is the weight coefficient of the i-th pixel, x i is the coordinate of the i-th pixel, y i is the height value of the i-th pixel, and n is the number of pixels; The initial parameters of the parabola fitting equation are updated to the adjustment parameters of the parabola fitting equation, and the parabola fitting equation obtained according to the initial parameters of the parabola fitting equation and the X-direction coordinate of each pixel are returned to execute to obtain the fitting value of each pixel until the iteration stop condition is met, and it is determined that the height value of the pixel after fitting along the X-direction is the fitting value of the pixel.

3. The method according to any one of claims 1 to 2, It is characterized in that The step of obtaining a reference plane of the burr region of the height image according to the burr region after free-form surface fitting in the height image comprises: For each pixel point in the burr area after free surface fitting in the height image, in the height image after surface fitting, a corrected height value of the pixel point is obtained according to the height values ​​of the pixel points in the neighborhood of the pixel point; Plane fitting is performed on the burr areas after the surface fitting in the height image to obtain the reference surface of the burr area.

4. The method according to any one of claims 1 to 2, It is characterized in that The method of obtaining the weld mark area of ​​the product to be inspected and the burr area within the weld mark area according to the grayscale image of the product to be inspected based on a rectangular fitting method includes: According to the grayscale image of the product to be inspected, based on a rectangular fitting method, determining the welding mark area of ​​the product to be inspected; Generate an outer package pattern according to the weld print area of ​​the product to be detected, wherein the center of gravity of the outer package pattern coincides with the center of gravity of the weld print area of ​​the product to be detected; The grayscale image with the outer package pattern marked is input into a burr area detection model to obtain the burr area in the weld mark area.

5. The method according to claim 4, It is characterized in that The step of determining the welding area of ​​the product to be detected based on the grayscale image of the product to be detected and in a rectangular fitting manner includes: Performing one-dimensional boundary extraction on the grayscale image of the product to be inspected to obtain boundary points of the welding area of ​​the product to be inspected; Rectangular fitting is performed on the boundary points to obtain the welding mark area of ​​the product to be inspected.

6. The method according to any one of claims 1 to 2, It is characterized in that After obtaining the burr height value corresponding to the burr area, the method further includes: When all burr height values ​​are respectively less than or equal to the height threshold, determining that the product to be tested is qualified; In the case where the burr height value is greater than the height threshold, it is determined that the product to be inspected is unqualified.

7. The method according to any one of claims 1 to 2, It is characterized in that After obtaining the burr height value corresponding to the burr area, the method further includes: Determine a detection result, the detection result including: a burr height value of the burr area and position information of a center of gravity of the burr; The detection result is sent to a burr detection device.

8. A burr detection system, Features include: The burr detection device is used to photograph the product to be detected to obtain a grayscale image and a height image of the product to be detected; An image processing device is used to obtain a grayscale image and a height image of the product to be detected through the burr detection device; according to the grayscale image of the product to be detected, based on a rectangular fitting method, obtain a weld mark area of ​​the product to be detected and a burr area in the weld mark area; perform free surface fitting processing on the weld mark area of ​​the height image; according to the burr area after free surface fitting in the height image, obtain a reference plane of the burr area of ​​the height image; obtain the maximum height value of all pixel points contained in the burr area after free surface fitting in the height image relative to the reference plane of the burr area, and obtain a burr height value corresponding to the burr area; The step of performing free-form surface fitting processing on the weld area of ​​the height image includes: For each row of the weld print area of ​​the height image, interpolation processing is performed on the pixel points located in the burr area or the invalid area, so as to correct the height values ​​of the pixel points located in the burr area or the invalid area, and based on parabola fitting, the height values ​​of the pixel points in the row are iteratively processed to obtain the height values ​​of the pixel points in the row after fitting along the X direction; according to the height values ​​of the pixel points in all rows after fitting along the X direction, a height image after fitting along the X direction is obtained; For each column of the weld print area of ​​the height image, interpolation processing is performed on the pixel points located in the burr area or the invalid area, so as to correct the height values ​​of the pixel points located in the burr area or the invalid area, and based on parabola fitting, the height values ​​of the pixel points in the column are iteratively processed to obtain the height values ​​of the pixel points in the column after fitting along the Y direction; according to the height values ​​of the pixel points in all columns after fitting along the Y direction, a height image after fitting along the Y direction is obtained; A height image after fitting of the free-form surface is obtained according to the height image after fitting along the X direction and the height image after fitting along the Y direction.

9. A computer-readable storage medium, It is characterized in that The medium stores a program, which can be executed by a processor to implement the method according to any one of claims 1 to 7.