A method for identifying and detecting the length and width of welding marks based on image processing technology
Through the solder printing identification method based on image processing technology, the grayscale mean calculation and morphological processing of the high and low exposure maps of the solder printing are performed to separate the weld seams and welding areas, which solves the problem of measurement inaccurate caused by poor welding process, and improves the accuracy of the measurement of solder length and width and the stability of product evaluation.
Patent Information
- Application Number
- CN202111633133.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-29
- Publication Date
- 2025-08-01
- Estimated Expiration
- 2041-12-29
AI Technical Summary
When the existing welding printing detection technology is poor in the case of poor welding technology, when extracting the solder printing area separately to calculate the length and width of the solder printing, the measurement results are not accurate enough, resulting in poor stability and high leakage rate of product NG evaluation.
Using image processing technology, the high and low exposure maps are distinguished by the gray mean calculation of two pictures of the same welding print, and the approximate area of the weld is obtained. Combined with morphological processing and opening operations, the weld and welding printing areas are separated, and the weld width and welding printing length are calculated to avoid errors in information transmission by the upper computer and improve measurement accuracy.
In the case of poor welding process, the accuracy of welding length and width measurement is improved, and the instability and missed rate of product NG judgment is reduced.
Smart Images

Figure CN114549397B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of welding mark recognition and detection, and in particular to a method for recognizing and detecting the length and width of welding marks based on image processing technology. Background Art
[0002] Driven by both policies and the market, the new energy vehicle industry in China has developed rapidly. Currently, in the Chinese new energy vehicle market, Chinese companies such as Wuling, BYD, NIO, and XPeng, as well as Tesla in the United States, occupy most of the market, and the proportion of new energy vehicles in the market is also increasing. With the rise of the new energy market, issues related to power batteries have become the focus of attention, such as safety and battery life. Safety has always been a major concern for the public, and the problem of battery leakage is of particular importance. The sealing between the battery cell and the outer shell during the battery production process is a very important link. Commonly used laser welding is used to weld the outer shell and the cell top cover, and certain requirements are imposed on the length and width of the welding mark. However, there will be certain differences in the welding process. Uneven welding and deviation of the welding position will cause instability in the overall battery sealing in the later stage. Therefore, it is necessary to detect the welding mark area of the welding process, calculate the length and width of the welding mark, and use them to judge the battery sealing.
[0003] Currently, most of the existing welding mark detection technologies separately extract the welding mark area for measurement. For example, a "welding mark detection and height measurement method based on line laser" disclosed in a Chinese patent document, with the publication number CN111951240A. This method scans the tab with line laser to obtain the welding marks and height data on the tab, forms the original image according to the row and column distribution of each welding mark, processes the original image with a mean filter to obtain the reference image and the pixel values in the image, makes any profile line at the same position in the original image and the reference image respectively, obtains the corresponding height values on the profile line of the original image and the corresponding height values on the profile line of the reference image, corrects the uneven original image according to the reference image to obtain the bending correction image, performs 3D display on the original image and the bending correction image respectively, obtains the solder joint position through the 3D display of the obtained bending correction image, and constructs a solder joint histogram to obtain the solder joint height value. This invention provides a method for detecting individual solder joints in the welding mark separately. Although it reduces the measurement error of the tab itself and improves the accuracy of welding mark measurement, in the case of poor welding process, only separately extracting the welding mark area for calculation, the data measured by using this method is not accurate enough, and using the data measured by this method for product NG judgment will result in a high false rejection rate. Summary of the Invention
[0004] The present invention aims to overcome the problems in the prior art that when the welding process is poor, the welding mark area is extracted separately to calculate the length and width of the welding mark, the measurement results are not accurate enough, and the NG judgment of the product will cause poor stability and high omission rate. A method for identifying and detecting the length and width of welding marks based on image processing technology is provided.
[0005] To achieve the above object, the present invention adopts the following technical solutions:
[0006] A method for identifying and detecting the length and width of welding marks based on image processing technology, comprising the following steps: S1: Using image processing technology on two images of the same welding mark collected to obtain a high-explosion image and a low-explosion image; S2: Processing the high-explosion image to obtain a weld region region1; S3: Processing the weld region region1 and calculating the width of the weld; S4: Processing the low-explosion image to obtain a welding mark region region4; S5: Processing the welding mark region region4 and calculating the length of the welding mark, and finally calculating the offset of the welding mark. The present invention first distinguishes high and low exposure images according to the calculated value of grayscale, avoiding errors in the upper computer transmitting high and low exposure image information, and the algorithm itself judges to obtain the approximate region of the high-exposure weld. Because there is less interference noise than the low-exposure image and it is easier to obtain the required region, then obvious welds are obtained through the same region of the low-exposure image for region expansion, and then the welds and welding marks are separated for length and width calculation, which can avoid the problem of inaccurate measurement results caused by separately extracting the welding mark region to calculate the length and width of the welding mark when the welding process is poor, and the NG judgment of the product will cause poor stability and high omission rate.
[0007] As a preferred solution of the present invention, S1 is specifically: calculating the grayscale mean value of two images of the same welding mark collected by the camera, and judging according to the calculated value to obtain a high-explosion image and a low-explosion image. The present invention distinguishes high and low exposure images according to the calculated value of grayscale, avoiding errors in the upper computer transmitting high and low exposure image information.
[0008] As a preferred solution of the present invention, S2 is specifically: selecting a weld region for the high-explosion image, and successively performing binarization and morphological processing on the weld region, and judging and positioning the weld region region1 according to the relevant features of the processed weld region. The relevant features include grayscale value, contour length, etc.
[0009] As a preferred solution of the present invention, S3 is specifically: cutting the weld region region1 to obtain several regions, calculating the width value of each region and taking the median as the weld width. When the median is relatively large, taking the average value of the width values of several regions as the weld width.
[0010] As a preferred embodiment of the present invention, S4 is specifically as follows: Locate and crop the corresponding area of the low-explosion map according to the weld area region1 of the high-explosion map. Perform threshold processing on the corresponding area of the low-explosion map to screen out the connected regions. Further process the connected regions to obtain the weld area region2. The weld area region2 includes two upper and lower welds and weld imprints. Perform binarization and morphological processing on the weld area region2 successively. Judge and find the two upper and lower weld areas region3 according to the relevant characteristic conditions after processing. Generate a rectangular structural element according to the weld width, and perform an opening operation on the two upper and lower weld areas region3 for optimization. Subtract the optimized two upper and lower weld areas region3 from the weld area region2 to obtain the weld imprint area region4. The weld area region1 of the high-explosion map is only one of the two upper and lower welds. The weld area region2 obtains the two welds including the weld imprint area in the middle through the weld area region1. The weld area region3 is simply the two upper and lower weld areas. Therefore, subtracting the weld area region3 from the weld area region2 gives the pure weld imprint area region4.
[0011] As a preferred embodiment of the present invention, S5 is specifically as follows: Calculate the rectangular height to obtain the length of the weld imprint. Locate the deviation area of the weld imprint. Perform morphological processing and threshold segmentation on the deviation area successively to obtain the circumscribed rectangle, and calculate the offset of the weld imprint according to the circumscribed rectangle. Only the weld width is measured in the high-exposure map because the weld imprint is missing. There is a weld imprint area in the low-exposure map. The length and offset of the weld imprint are measured in the low-exposure map. The offset refers to the farthest distance from the small tail of the weld imprint to the weld.
[0012] Therefore, the present invention has the following beneficial effects: The present invention first distinguishes high and low-exposure maps according to the calculated value of grayscale, avoiding errors in the upper computer transmitting high and low-exposure map information. It is judged by the algorithm itself to obtain the approximate area of the weld in the high-exposure map. Compared with the low-exposure map, there is less interference noise and it is easier to obtain the required area. Then, obvious welds are obtained through the same area of the low-exposure map for area expansion. Then, by separating the weld and weld imprint and calculating the length and width, it can avoid the problem that the measurement results are not accurate enough when separately extracting the weld imprint area to calculate the length and width of the weld imprint in the case of poor welding process, which will cause poor stability and high false rejection rate in the NG judgment of the product. BRIEF DESCRIPTION OF THE DRAWINGS
[0013] Figure 1 is the flowchart of the method of the present invention;
[0014] Figure 2 is the low-exposure map in the embodiment of the present invention;
[0015] Figure 3 is the high-exposure map in the embodiment of the present invention;
[0016] Figure 4 is the flowchart of the method of an embodiment of the present invention;
[0017] Figure 5 is the schematic diagram of the measurement result of the weld mark length of the present invention;
[0018] Figure 6 is the schematic diagram of the measurement result of the weld width of the present invention;
[0019] Figure 7 is the schematic diagram of the weld mark area region4 and the deviation area of the present invention. Specific Embodiments
[0020] The present invention will be further described below in conjunction with the accompanying drawings and specific embodiments.
[0021] As Figure 1 shown, a method for identifying and detecting the length and width of a weld mark based on image processing technology first calculates the mean variance of the gray level of two images of the same weld mark collected by a camera to distinguish high and low exposure images, avoiding errors in the information of high and low exposure images transmitted by the host computer, so the algorithm judges by itself to obtain the approximate area of the weld seam in the high exposure image. Because there is less interference noise in the high exposure image than in the low exposure image and it is easier to obtain the required area, then binaryzation and morphological processing are performed on the same area of the low exposure image to obtain obvious weld seams for area expansion, and then the weld seam and weld mark are separated through local filtering and opening operation for length and width calculation. When the welding process is poor, it can avoid the problem that the measurement results are not accurate enough caused by separately extracting the weld mark area to calculate the weld mark length and width, and the NG judgment of the product will cause poor stability and high omission killing rate.
[0022] In this embodiment, first distinguish high and low exposure images. Calculate the gray level value of two images at the same position collected by the camera through the gray level mean to judge high and low exposure images. As Figure 2 shown is the low exposure image of this embodiment, and as Figure 3 shown is the high exposure image of this embodiment. After obtaining the high and low exposure images, process the high and low exposure images separately; as Figure 4 shown, intercept the ROI area, that is, the weld seam area, in the high exposure image, and perform binaryzation and morphological processing on the ROI area in the high exposure image successively. Judge and locate the weld seam area region1 through relevant features such as gray level value and contour length of the processed ROI area; cut the weld seam area region1 into several parts, calculate the width value of each part of the area, and take the median of these width values as the final weld width. If the median value is too large, take the average of these width values as the final weld width. The measurement results are as Figure 5As shown in the figure; in the low-explosion image, the ROI region is located and cropped according to the weld region region1 in the above high-explosion image. Image threshold processing is performed on the ROI region of the low-explosion image to screen connected regions with a certain threshold. Through relevant feature conditions such as gray value and contour length for these connected regions, the upper and lower weld regions of the weld mark are screened to obtain the weld region region2. The weld region region2 includes the upper and lower welds and the weld mark. Then, binaryzation and morphological processing are performed on the weld region region2. According to relevant feature conditions, the weld region region3 is judged and found. The weld region region3 is only the upper and lower weld regions. A rectangular structuring element is generated according to the weld width, and an opening operation is performed on the weld region region3 to remove the unevenly distributed and unevenly deep weld mark regions caused by the process. The weld mark region region4 is obtained by subtracting the weld region region3 from the weld region region2. As Figure 7 shown; calculating the height of the circumscribed rectangle of the weld mark region region4 can obtain the weld mark length, and the measurement result is as Figure 5 shown; as Figure 7 shown, based on the weld mark region region4, a certain distance is taken up and down and a certain distance is diffused to the right to locate the deviation region of the weld mark. As Figure 7 shown, morphological processing and threshold segmentation are successively performed on the deviation region to obtain a circumscribed rectangle, and the width of the circumscribed rectangle is the offset of the weld mark.
[0023] As described above, it is only the specific implementation manner of the present invention, but the protection scope of the present invention is not limited thereto. Any change or replacement that can be thought of without creative labor should be covered within the protection scope of the present invention.
Claims
1. A method for identifying and detecting the length and width of welding marks based on image processing technology, characterized in that It includes the following steps: S1: Apply image processing technology to two images of the same weld mark collected to obtain a high-explosion image and a low-explosion image; S2: Process the high-explosion image to obtain the weld region region1; S3: Process the weld region region1 and calculate the width of the weld to obtain the approximate region of the high-explosion image weld; S4: Process the low-explosion image, and expand the region of the obvious weld obtained through the same region of the low-explosion image and the high-explosion image to obtain the weld mark region region4; S5: Process the weld mark region region4 and calculate the length of the weld mark, and finally calculate the offset of the weld mark.
2. The method for identifying and detecting the length and width of a welding mark based on image processing technology according to claim 1, characterized in that, The specific content of S1 is: Calculate the gray mean value of two images of the same weld mark collected by the camera, and judge according to the calculated value to obtain the high-explosion image and the low-explosion image.
3. A method for identifying and detecting the length and width of welding marks based on image processing technology according to claim 1, characterized in that, The specific content of S2 is: Select the weld region from the high-explosion image, perform binarization and morphological processing on the weld region successively, and judge and locate the weld region region1 according to the relevant features of the processed weld region.
4. A method for identifying and detecting the length and width of welding marks based on image processing technology according to claim 1 or 3, characterized in that The specific content of S3 is: Cut the weld region region1 to obtain several regions, calculate the width value of each region and take the median as the weld width.
5. A method for identifying and detecting the length and width of welding marks based on image processing technology according to claim 4, characterized in that, The specific content of S4 is: Locate and crop the corresponding region of the low-explosion image according to the weld region region1 of the high-explosion image, perform threshold processing on the corresponding region of the low-explosion image to screen out the connected regions, further process the connected regions to obtain the weld region region2. The weld region region2 contains two upper and lower welds and the weld mark. Perform binarization and morphological processing on the weld region region2 successively. Judge and find the two upper and lower weld regions region3 according to the relevant feature conditions after processing. Generate a rectangular structural element through the weld width, perform opening operation on the two upper and lower weld regions region3 for optimization, and subtract the optimized two upper and lower weld regions region3 from the weld region region2 to obtain the weld mark region region4.
6. A method for identifying and detecting the length and width of welding marks based on image processing technology according to claim 1 or 5, characterized in that The specific content of S5 is: Calculate the length of the weld mark, locate the deviation region of the weld mark, perform morphological processing and threshold segmentation on the deviation region successively to obtain the circumscribed rectangle, and calculate the offset of the weld mark according to the circumscribed rectangle.
Citation Information
Patent Citations
Weld mark detection and height measurement method based on line laser
CN111951240A
Method for automatically identifying pipe weld defect based on double-wall double-projection transillumination image
CN104865277A
Power battery welding quality detection method
CN107093175A