Battery detection method, device, computer equipment and storage medium
Through pre-trained solder joint detection model and grayscale processing technology, the battery welding area is automatically detected, which solves the problem of welding defects and realizes efficient and low-cost battery quality control, which is suitable for products of different specifications.
Patent Information
- Application Number
- CN202411104035.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-13
- Publication Date
- 2025-01-17
- Estimated Expiration
- 2044-08-13
AI Technical Summary
During the battery production process, abnormal equipment and environment during the welding process lead to welding defects, affecting the quality of the battery. The existing detection methods are costly, low efficiency and poor generalization, making it difficult to adapt to products of different specifications.
The battery image is detected by a pre-trained solder joint detection model, and the solder joint and weld areas are automatically detected through grayscale processing and area confirmation to reduce the defect false alarm rate. It is suitable for products of different specifications.
It realizes automated inspection, reduces costs, improves efficiency and high accuracy. It is suitable for battery products of different specifications, reduces production costs and improves battery quality.
Smart Images

Figure CN118644476B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of battery manufacturing technology, and in particular to a battery detection method, device, computer equipment and storage medium. Background Art
[0002] With the development of new energy technology, batteries have been widely used. In the battery production process, the battery top cover and the battery aluminum shell need to be welded. During the welding process, abnormalities in equipment, environment, etc. will cause welding defects and affect the quality of the battery. Therefore, how to detect batteries and prevent defective products from flowing to the next process has become an urgent problem to be solved. Summary of the invention
[0003] Based on the above problems, the present application provides a battery detection method, apparatus, computer equipment and storage medium, which can automatically detect batteries, which is not only low-cost but also highly efficient and can improve battery quality.
[0004] In a first aspect, the present application provides a battery detection method, the method comprising: using a pre-trained weld detection model to detect a battery image of a top cover welding process to obtain a weld detection result; performing grayscale processing on the battery image to obtain a grayscale image; determining a weld area and a weld area based on the weld detection result and the grayscale image; detecting the weld area and the weld area to obtain a battery detection result; the battery detection result is used to characterize whether the welds of the battery are abnormal or normal and the welds are abnormal or normal; wherein, detecting the weld area and the weld area to obtain the battery detection result comprises: when the weld area and the weld area have an intersection, respectively determining the specifications of the weld area and the specifications of the weld area; determining the battery detection result based on the specifications of the weld area and / or the specifications of the weld area.
[0005] In the technical solution of the embodiment of the present application, the battery can be automatically inspected, which is low-cost and high-efficiency compared to manual inspection. Moreover, the weld spot detection model adopted in the embodiment of the present application does not require manual intervention and has good generalization, and can detect products of different specifications. Moreover, according to the specifications of the weld spot area and / or the specifications of the weld seam area, the battery inspection results can be accurately determined, and the probability of false alarm of defects can be reduced, thereby improving battery quality and reducing production costs.
[0006] In some embodiments, the weld detection results include initial detection boundaries of multiple welds and confidence levels of each initial detection boundary, and the weld area and weld seam area are determined based on the weld detection results and the grayscale image, including: selecting one or more candidate detection boundaries from multiple initial detection boundaries based on the confidence levels of each initial detection boundary; and determining the weld area and weld seam area based on the one or more candidate detection boundaries and the grayscale image. In the technical solution of the embodiment of the present application, the initial detection boundaries are screened using confidence levels, which can improve the accuracy of the weld position, thereby improving the accuracy of battery detection.
[0007] In some embodiments, the solder joint area and the weld seam area are determined based on one or more candidate detection boundaries and grayscale images, including: performing boundary cropping processing on the grayscale image according to the grayscale value to obtain a first cropped image; performing coordinate transformation on each candidate detection boundary based on the first cropped image to obtain the solder joint area; performing gradient fitting processing based on the first cropped image to obtain the weld seam area. In the technical solution of the embodiment of the present application, the grayscale image is cropped, and the part not related to the battery can be cropped to avoid this part affecting subsequent detection. Therefore, the accuracy of the solder joint area can be improved, thereby improving the accuracy of battery detection.
[0008] In some embodiments, coordinate transformation is performed on each candidate detection boundary based on the first cropped image to obtain the solder joint area, including: for each candidate detection boundary, solder joint cropping is performed on the first cropped image according to the candidate detection boundary to obtain a second cropped image; and the position coordinates of the candidate detection boundary are transformed into the second cropped image to obtain the solder joint area. In the technical solution of the embodiment of the present application, the detection accuracy of the solder joint area can be improved by performing solder joint cropping on the first cropped image, thereby improving the accuracy of subsequent battery detection, thereby improving the accuracy of subsequent battery detection, reducing the probability of false alarm of defects, thereby improving battery quality and reducing production costs.
[0009] In some embodiments, the position coordinates of the candidate detection boundary are converted into the second cropped image to obtain the solder joint area, including: converting the position coordinates of the candidate detection boundary into the second cropped image to obtain an intermediate detection boundary; adjusting the boundary position of the intermediate detection boundary according to the grayscale value of the second cropped image to obtain the solder joint area. In the technical solution of the embodiment of the present application, the boundary position adjustment of the intermediate detection boundary can improve the detection accuracy of the solder joint area, thereby improving the accuracy of subsequent battery detection, reducing the probability of false defect alarms, thereby improving battery quality and reducing production costs.
[0010] In some embodiments, gradient fitting processing is performed based on the first cropped image to obtain the weld area, including: determining the grayscale gradient of the first cropped image; determining a path whose grayscale gradient is greater than a preset gradient threshold; performing fitting processing based on the pixel points of the path to obtain the weld area. In the technical solution of the embodiment of the present application, a relatively accurate weld area can be obtained by fitting processing using the grayscale gradient, which can improve the accuracy of battery detection and reduce the probability of false alarm of defects.
[0011] In some embodiments, the solder joint area and the weld seam area are detected to obtain the battery detection result, including: when the solder joint area and the weld seam area do not intersect, determining that the battery detection result includes that the battery has a solder joint abnormality. In the technical solution of the embodiment of the present application, when the solder joint area and the weld seam area do not intersect, the battery detection result is directly determined, the battery detection speed is fast, the efficiency is high, and the detection personnel can be reminded in time, thereby reducing production line losses and further reducing production costs.
[0012] In some embodiments, the specifications of the weld area and the weld area are determined separately, including: determining the specifications of the weld area according to the number of pixels in the weld area and the acquisition accuracy of the image acquisition device that acquires the battery image; determining the specifications of the weld area according to the number of pixels in the weld area and the acquisition accuracy. In the technical solution of the embodiment of the present application, the actual specifications of the welds and welds can be determined so that the battery can be tested according to the actual specifications later, avoiding the problem of different battery test results caused by different acquisition accuracy.
[0013] In some embodiments, the training process of the solder joint detection model includes: obtaining a first training sample set; the training sample set includes sample images of multiple different types of batteries and annotations of each sample image, and the annotations are used to indicate the location of the solder joints in the sample images; performing data enhancement processing on the first training sample set to obtain a second training sample set; training a neural network model based on the second training sample set to obtain a solder joint detection model. In the technical solution of the embodiment of the present application, the sample images are collected for different types of batteries, so the solder joint detection model has good generalization and can detect products of different specifications; and the second training sample set is obtained through data enhancement, so a small number of sample images can be annotated to obtain a large number of training samples, which reduces the workload of annotation and reduces labor costs.
[0014] In some embodiments, grayscale processing is performed on a battery image to obtain a grayscale image, including: using an adaptive threshold to binarize the battery image to obtain a binary image; performing a morphological opening operation on the binary image to obtain a grayscale image. In the technical solution of the embodiment of the present application, the use of an adaptive threshold can perform different binarization processes on different battery images, which is more flexible than a fixed threshold and has a better image processing effect; performing a morphological erosion operation on the binary image can eliminate small particle noise, and then performing a morphological dilation operation can fill the holes in the area, thereby improving the image quality of the grayscale image, and then improving the accuracy of subsequent battery detection.
[0015] In a second aspect, the present application also provides a battery detection device, the device comprising:
[0016] A solder joint detection module is used to detect the battery image of the top cover welding process using a pre-trained solder joint detection model to obtain a solder joint detection result;
[0017] An image processing module is used to perform grayscale processing on the battery image to obtain a grayscale image;
[0018] An area confirmation module is used to determine the soldering point area and the welding seam area according to the soldering point detection result and the grayscale image;
[0019] The battery detection module is used to detect the welding point area and the welding seam area to obtain the battery detection result; the battery detection result is used to characterize whether the welding point of the battery is abnormal or normal and the welding seam is abnormal or normal;
[0020] The battery detection module is specifically used to determine the specifications of the welding point area and the specifications of the welding seam area respectively when the welding point area and the welding seam area intersect; and determine the battery detection result according to the specifications of the welding point area and / or the specifications of the welding seam area.
[0021] In a third aspect, the present application further provides a computer device, comprising a memory and a processor, wherein the memory stores a computer program, and the processor implements any one of the methods in the first aspect when executing the computer program.
[0022] In a fourth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the method of any one of the first aspects is implemented.
[0023] In a fifth aspect, the present application further provides a computer program product, comprising a computer program, which implements any one of the methods in the first aspect when executed by a processor. BRIEF DESCRIPTION OF THE DRAWINGS
[0024] Various other advantages and benefits will become apparent to those of ordinary skill in the art by reading the detailed description of the optional embodiments below. The accompanying drawings are only used for the purpose of illustrating the optional embodiments and are not to be considered as limiting the present application. Moreover, the same reference numerals are used throughout the drawings to represent the same components. In the drawings:
[0025] Figure 1 is a schematic diagram of an application environment of a battery detection method according to an embodiment of the present application;
[0026] Figure 2 is a flowchart of a battery detection method according to an embodiment of the present application;
[0027] Figure 3 is a flowchart of the steps of determining the battery test result in one embodiment of the present application;
[0028] Figure 4 It is a flowchart of the steps of determining the welding spot area and the welding seam area according to the welding spot detection result and the grayscale image in one embodiment of the present application;
[0029] Figure 5 It is a flowchart of the steps of determining a welding spot area and a welding seam area according to one or more candidate detection boundaries and a grayscale image according to an embodiment of the present application;
[0030] Figure 6 is a schematic diagram of a grayscale image according to an embodiment of the present application;
[0031] Figure 7 It is a flowchart of a step of performing coordinate transformation on each candidate detection boundary to obtain a welding spot area based on a first cropped image according to an embodiment of the present application;
[0032] Figure 8 It is a flow chart of a step of obtaining a weld area by performing gradient fitting processing based on a first cropped image according to an embodiment of the present application;
[0033] Fig. 9 is a flow chart of the training steps of the solder joint detection model according to an embodiment of the present application;
[0034] Fig.10 It is a flowchart of the grayscale processing steps of a battery image according to an embodiment of the present application;
[0035] Fig.11 is a structural block diagram of a battery detection device according to an embodiment of the present application;
[0036] Fig.12 is a structural block diagram of a battery detection device according to another embodiment of the present application;
[0037] Fig.13 It is a diagram of the internal structure of a computer device according to an embodiment of the present application. DETAILED DESCRIPTION
[0038] The following embodiments of the technical solution of the present application are described in detail in conjunction with the accompanying drawings. The following embodiments are only used to more clearly illustrate the technical solution of the present application, and are therefore only used as examples, and cannot be used to limit the scope of protection of the present application.
[0039] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by technicians in the technical field to which this application belongs; the terms used herein are only for the purpose of describing specific embodiments and are not intended to limit this application; the terms "including" and "having" in the specification and claims of this application and the above-mentioned figure descriptions and any variations thereof are intended to cover non-exclusive inclusions.
[0040] In the description of the embodiments of the present application, the technical terms "first", "second", etc. are only used to distinguish different objects, and cannot be understood as indicating or implying relative importance or implicitly indicating the number, specific order or primary and secondary relationship of the indicated technical features. In the description of the embodiments of the present application, the meaning of "multiple" is more than two, unless otherwise clearly and specifically defined.
[0041] Reference to "embodiments" herein means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present application. The appearance of the phrase in various locations in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein may be combined with other embodiments.
[0042] In the description of the embodiments of the present application, the term "and / or" is only a description of the association relationship of the associated objects, indicating that there may be three relationships. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in this article generally indicates that the associated objects before and after are in an "or" relationship.
[0043] In the description of the embodiments of the present application, the term "multiple" refers to more than two (including two). Similarly, "multiple groups" refers to more than two groups (including two groups), and "multiple pieces" refers to more than two pieces (including two pieces).
[0044] In the description of the embodiments of the present application, unless otherwise clearly specified and limited, technical terms such as "installed", "connected", "connected", "fixed" and the like should be understood in a broad sense. For example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection or an indirect connection through an intermediate medium, and it can be the internal connection of two elements or the interaction relationship between two elements. For those of ordinary skill in the art, the specific meanings of the above terms in the embodiments of the present application can be understood according to the specific circumstances.
[0045] With the development of new energy technology, batteries have been widely used. In the battery production process, the battery top cover and the battery aluminum shell need to be welded. During the welding process, abnormalities in equipment, environment, etc. will cause welding defects and affect the quality of the battery. Therefore, how to detect batteries and prevent defective products from flowing to the next process has become an urgent problem to be solved.
[0046] At present, manual inspection or inspection based on grayscale values is mostly used. Manual inspection is costly and inefficient. Grayscale value-based inspection also requires manual pre-setting of inspection frames, has poor generalization, and is difficult to apply to product inspections of different specifications.
[0047] In response to the above problems, the present application provides a battery detection method, which uses a pre-trained weld detection model to detect the battery image of the top cover welding process to obtain the weld detection result; and grayscale processing is performed on the battery image to obtain a grayscale image; the weld area and the weld area are determined according to the weld detection result and the grayscale image; the weld area and the weld area are detected to obtain the battery detection results of abnormal or normal battery welds and abnormal or normal welds. Through the technical solution of the embodiment of the present application, the detection can be automatically performed, which is not only low-cost but also highly efficient. In addition, the weld detection model used in the embodiment of the present application does not require manual intervention and has good generalization, and can detect products of different specifications, thereby improving battery quality and reducing production costs.
[0048] The battery detection method provided in the embodiment of the present application can be applied to Figure 1 In the application environment shown. The application environment includes an image acquisition device 101 and a computer device 102. The image acquisition device 101 and the computer device 102 can communicate through a network. The above-mentioned image acquisition device 101 may include but is not limited to various cameras, two-dimensional line scan cameras, three-dimensional cameras, etc.; the above-mentioned computer device 102 may include but is not limited to various personal computers, laptops, tablet computers and servers, etc.
[0049] According to some embodiments of the present application, referring to Figure 2 , provides a battery detection method, which is applied to Figure 1 Taking the computer device in the example as an example, the following steps may be included:
[0050] Step 201, using a pre-trained weld spot detection model to detect the battery image of the top cover welding process to obtain a weld spot detection result.
[0051] The welding spot detection result may include the number and position of welding spots in the battery image.
[0052] In the battery top cover welding process, the image acquisition device acquires the image of the battery and transmits the battery image to the computer device. The computer device is provided with a pre-trained solder joint detection model, and the battery image is input into the solder joint detection model for detection, and the solder joint detection model can output the solder joint detection result.
[0053] Step 202: grayscale processing is performed on the battery image to obtain a grayscale image.
[0054] The computer device can also perform grayscale processing on the battery image while using the solder joint detection model for detection. The grayscale processing process can include: determining the pixel value of each pixel in the battery image, setting the pixel value less than the preset pixel threshold as the first value, setting the pixel value greater than or equal to the preset pixel threshold as the second value, and obtaining the grayscale image according to the set pixel values.
[0055] For example, the pixel values less than the preset pixel threshold 150 are set to 0, and the pixel values greater than or equal to the preset pixel threshold 150 are set to 255, and a grayscale image is obtained according to the set pixel values.
[0056] It should be noted that the preset pixel threshold is not limited to the above examples, and in practical applications, it can be set accordingly according to the situation.
[0057] Step 203, determining the welding spot area and the welding seam area according to the welding spot detection result and the grayscale image.
[0058] After determining the weld spot detection results and the grayscale image, the initial region of each weld spot can be determined in the grayscale image according to the weld spot detection results; then, the boundary position of each initial region is adjusted according to the pixel value of each pixel in the grayscale image to obtain the weld spot region in the grayscale image. Next, the weld seam region is determined in the grayscale image according to the preset positional relationship between the weld and the weld spot, and the pixel values in the weld spot region and the grayscale image.
[0059] Step 204, inspect the welding spot area and the welding seam area to obtain the battery inspection result.
[0060] Among them, the battery detection results are used to characterize whether the battery's welding points are abnormal or normal and whether the welding seams are abnormal or normal.
[0061] For the welding process of the battery top cover and the battery shell, the role of the weld is to connect the battery top cover and the battery shell. Therefore, if the weld does not cover the weld between the battery top cover and the battery shell, it can be directly determined that the battery inspection result is that the battery has an abnormal weld. If the weld covers the weld between the battery top cover and the battery shell, it can be determined whether the size of the weld and the width of the weld meet the quality inspection specifications respectively; if the size of the weld does not meet the quality inspection specifications, it is determined that the battery inspection result includes the presence of an abnormal weld in the battery; if the width of the weld does not meet the quality inspection specifications, it is determined that the battery inspection result includes the presence of an abnormal weld in the battery; if both the size of the weld and the width of the weld do not meet the quality inspection specifications, it is determined that the battery inspection result includes the presence of an abnormal weld and an abnormal weld in the battery.
[0062] In some embodiments, reference Figure 3 , the above detection process may include the following steps:
[0063] Step 2041, when the weld area and the weld area intersect, respectively determine the specifications of the weld area and the specifications of the weld area.
[0064] Among them, specifications include length, width, area, etc.
[0065] If the weld area intersects with the weld area, it means that the weld covers the gap between the battery top cover and the battery shell, and plays a role in connecting the battery top cover and the battery shell. In this case, the specification of the weld area is determined according to the number of pixels in the weld area, and the specification of the weld area is determined according to the number of pixels in the weld area.
[0066] For example, the area of the welding spot region is determined according to the number of pixels in the welding spot region, and the width of the welding seam is determined according to the number of pixels in the welding seam region.
[0067] Step 2042, determining the battery detection result according to the specifications of the welding point area and / or the specifications of the welding seam area.
[0068] If the specification of the welding spot area is not within the first specification range, it is determined that the battery detection result includes that the battery has welding spot abnormalities; if the specification of the weld seam area is not within the second specification range, it is determined that the battery detection result includes that the battery has weld seam abnormalities. If the specification of the welding spot area is not within the first specification range, and the specification of the weld seam area is not within the second specification range, it is determined that the battery detection result includes that the battery has welding spot abnormalities and weld abnormalities. If the specification of the welding spot area is within the first specification range, and the specification of the weld seam area is within the second specification range, it is determined that the battery detection result includes that the battery welding is normal.
[0069] For example, if the area of the weld point region exceeds the preset area range, it means that the weld point is too large, and the battery detection result is determined to include that the battery has a weld point abnormality; if the width of the weld seam region deviates from the preset width range, it means that the weld seam is too large, and the battery detection result is determined to include that the battery has a weld seam abnormality.
[0070] It should be noted that the first specification range and the second specification range can be set according to actual conditions.
[0071] In some embodiments, when it is determined that the battery test results include abnormal or normal battery welding points and abnormal or normal welding seams, an alarm message is output to prompt the test personnel to take corresponding measures on the battery and production line.
[0072] In the above embodiment, a pre-trained weld detection model is used to detect the battery image of the top cover welding process to obtain the weld detection result; grayscale processing is performed on the battery image to obtain a grayscale image; the weld area and the weld area are determined according to the weld detection result and the grayscale image; the weld area and the weld area are detected to obtain the battery detection result. In the technical solution of the embodiment of the present application, the battery can be automatically detected, which is low in cost and high in efficiency compared with manual detection. Moreover, the weld detection model used in the embodiment of the present application detects the weld position, so no manual intervention is required, and the weld detection model has good generalization and can detect products of different specifications. Furthermore, according to the specifications of the weld area and / or the specifications of the weld area, the battery detection result can be accurately determined to reduce the probability of false alarms of defects, thereby improving battery quality and reducing production costs.
[0073] According to some embodiments of the present application, the solder joint detection result includes the initial detection boundaries of multiple solder joints and the confidence of each initial detection boundary, wherein the confidence is used to characterize the probability that the initial detection boundary is a solder joint. For example, a confidence of 90% indicates that the probability that the initial detection boundary is a solder joint is 90%; a confidence of 40% indicates that the probability that the initial detection boundary is a solder joint is 40%.
[0074] Reference Figure 4 In the above embodiment, “determining the welding spot area and the welding seam area according to the welding spot detection result and the grayscale image” may include the following steps:
[0075] Step 301 : Screening out one or more candidate detection boundaries from a plurality of initial detection boundaries according to the confidence of each initial detection boundary.
[0076] The battery image is input into the solder joint detection model, and the solder joint detection model outputs the initial detection boundaries of multiple solder joints and the confidence of each initial detection boundary. The confidence threshold can be pre-set in the computer device, and then screening is performed based on the confidence threshold: the initial detection boundaries with confidence greater than or equal to the confidence threshold are determined as candidate detection boundaries; the initial detection boundaries with confidence less than the confidence threshold are eliminated.
[0077] For example, the solder joint detection model outputs the initial detection boundaries of three solder joints, the confidence levels of the three initial detection boundaries are 90%, 80%, and 40%, respectively, and the confidence threshold is 70%. The initial detection boundaries with confidence levels of 90% and 80% are determined as candidate detection boundaries.
[0078] In some embodiments, multiple initial detection boundaries may be screened according to the number of welds preset by the welding process to determine the candidate detection boundary. For example, if the number of welds set by the welding process is 1, then the initial detection boundary with a confidence level of 90% is determined as the candidate detection boundary from the initial detection boundaries with confidence levels of 90% and 80%.
[0079] It should be noted that the screening method for the initial detection boundary is not limited to the above example and can be set according to actual conditions.
[0080] Step 302: Determine a welding spot region and a welding seam region according to one or more candidate detection boundaries and a grayscale image.
[0081] After the candidate detection boundaries are screened, the welding spot area can be found in the grayscale image according to the welding spot position indicated by the candidate detection boundaries. Then, the welding seam area can be found in the grayscale image according to the positional relationship between the welding spot and the welding seam.
[0082] In the above embodiment, one or more candidate detection boundaries are selected from multiple initial detection boundaries according to the confidence of each initial detection boundary; the solder joint area and the weld seam area are determined according to the one or more candidate detection boundaries and the grayscale image. In the technical solution of the embodiment of the present application, the initial detection boundary is selected by using the confidence, which can improve the accuracy of the solder joint position, thereby improving the accuracy of battery detection.
[0083] According to some embodiments of the present application, referring to Figure 5 In the above embodiment, “determining the welding spot area and the welding seam area according to one or more candidate detection boundaries and grayscale images” may include the following steps:
[0084] Step 401 , performing boundary cropping processing on the grayscale image according to the grayscale value to obtain a first cropped image.
[0085] The battery image is gray-processed to obtain a gray-scale image. The gray-scale image contains parts outside the battery edge, which may affect quality detection. Therefore, the gray-scale image can be divided into a battery area and a battery edge area according to the gray-scale value, and then the battery edge area is cropped, and the image of the battery area is used as the first cropped image.
[0086] like Figure 5 In the grayscale image shown, the grayscale value of each pixel above the image is 255. This part is the battery edge area A, which can be cropped and the remaining part is used as the first cropped image B.
[0087] Step 402 : performing coordinate transformation on each candidate detection boundary based on the first cropped image to obtain a welding spot area.
[0088] The position coordinates of the candidate detection boundary in the battery image are mapped to the first cropped image to obtain the target detection boundary in the first cropped image, and the area in the target detection boundary is determined as the welding point area.
[0089] Step 403: Perform gradient fitting processing based on the first cropped image to obtain a weld area.
[0090] like Figure 6 In the grayscale image shown, after grayscale processing, the pixel values of the weld area are significantly different from those of other areas. By performing fitting processing based on the gradient change of the pixel values, the weld area can be found in the first cropped image.
[0091] In the above embodiment, the grayscale image is subjected to boundary cropping according to the grayscale value to obtain a first cropped image; based on the first cropped image, coordinate transformation is performed on each candidate detection boundary to obtain a solder joint area; based on the first cropped image, gradient fitting is performed to obtain a weld seam area. In the technical solution of the embodiment of the present application, the grayscale image is cropped to crop out the part that is not related to the battery to prevent this part from affecting subsequent detection. Therefore, the accuracy of the solder joint area can be improved, thereby improving the accuracy of battery detection.
[0092] According to some embodiments of the present application, referring to Figure 7 In the above embodiment, “converting the coordinates of the candidate detection boundary based on the first cropped image to obtain the welding spot area” may include the following steps:
[0093] Step 4021: for each candidate detection boundary, perform welding point cropping processing on the first cropped image according to the candidate detection boundary to obtain a second cropped image.
[0094] The computer device may first crop the image of the welding point from the first cropped image according to the position coordinates of the candidate detection boundary to obtain a second cropped image.
[0095] In some embodiments, in order to allow the second cropped image to include a complete weld, an initial cropping boundary is determined in the first cropped image based on the position coordinates of the candidate detection boundary; then, the initial cropping boundary is expanded to obtain a target cropping boundary; and then the first cropped image is cropped according to the target cropping boundary to obtain a second cropped image.
[0096] For example, after determining the initial cropping boundary in the first cropped image, the initial cropping boundary is expanded by 20 pixels in four directions to obtain the target cropping boundary. It should be noted that the number of pixels for the expansion process is not limited to the above example, and is deliberately set according to the acquisition accuracy of the image acquisition device.
[0097] Step 4022: convert the position coordinates of the candidate detection boundary into the second cropped image to obtain the welding point area.
[0098] After the second cropped image is obtained, the position coordinates of the candidate detection boundary are converted into the second cropped image, and the welding spot area can be obtained in the second cropped image.
[0099] It can be understood that by performing welding spot cropping processing on the first cropped image, the detection accuracy of the welding spot area can be improved, thereby improving the accuracy of subsequent battery detection.
[0100] In some embodiments, converting the position coordinates of the candidate detection boundary into the second cropped image to obtain the weld area may include: converting the position coordinates of the candidate detection boundary into the second cropped image to obtain an intermediate detection boundary; adjusting the boundary position of the intermediate detection boundary according to the grayscale value of the second cropped image to obtain the weld area.
[0101] Take the lower boundary of the middle detection boundary as an example, obtain the number of solder joint pixels that the lower boundary passes through, if the number of solder joint pixels that pass through is greater than x% of the number of pixels of the lower boundary, adjust the lower boundary downward until the number of solder joint pixels that the lower boundary passes through is equal to or less than x% of the number of pixels of the lower boundary. On the contrary, if the number of solder joint pixels that the lower boundary passes through is less than x% of the number of boundary pixels when the lower boundary is first calculated, it means that the lower boundary does not cover the solder joints at this time, then adjust the lower boundary upward until the number of solder joint pixels that the lower boundary passes through is greater than or equal to x% of the number of pixels of the lower boundary. Similarly, adjust the upper boundary, left boundary, and right boundary of the middle detection boundary.
[0102] It should be noted that the above x% may be 5%, which may be adjusted according to actual conditions. For example, when adjusting the left border, the calculation ratio may be increased because of the pixel influence of the weld.
[0103] It can be understood that adjusting the boundary position of the intermediate detection boundary can improve the detection accuracy of the welding point area, thereby improving the accuracy of subsequent battery detection.
[0104] In the above embodiment, the first cropped image is subjected to solder point cropping according to the candidate detection boundary to obtain the second cropped image; the candidate detection boundary is mapped to the second cropped image to obtain the solder point area. In the technical solution of the embodiment of the present application, the solder point cropping of the first cropped image and the boundary position adjustment of the intermediate detection boundary can improve the detection accuracy of the solder point area, thereby improving the accuracy of subsequent battery detection, reducing the probability of false defect alarms, thereby improving battery quality and reducing production costs.
[0105] According to some embodiments of the present application, referring to Figure 8 In the above embodiment, “performing gradient fitting processing based on the first cropped image to obtain a weld area” may include the following steps:
[0106] Step 4031, determining the grayscale gradient of the first cropped image.
[0107] The pixel difference between every two adjacent pixels in the first cropped image is calculated in a top-to-bottom or bottom-to-top order, and the difference is determined as a grayscale gradient.
[0108] Step 4032, determine the path whose grayscale gradient is greater than a preset gradient threshold.
[0109] According to the grayscale gradient, find the path whose grayscale gradient is greater than the preset gradient threshold. Figure 5 In the grayscale image shown, the pixel value in the weld area is 255, and the pixel value outside the weld area is 0. A dynamic programming algorithm can be used to find a path in the first cropped image whose grayscale gradient is greater than a preset gradient threshold.
[0110] Step 4033, performing fitting processing based on the pixel points of the path to obtain the weld area.
[0111] The pixel points in the path are subjected to straight line fitting and connection processing, and the area where the connected pixel points are located is determined as the weld area.
[0112] In the above embodiment, the grayscale gradient of the first cropped image is determined; a path whose grayscale gradient is greater than a preset gradient threshold is determined; and a fitting process is performed based on the pixel points of the path to obtain a weld area. In the technical solution of the embodiment of the present application, a relatively accurate weld area can be obtained by fitting the grayscale gradient, which can improve the accuracy of battery detection and reduce the probability of false alarm of defects.
[0113] According to some embodiments of the present application, in the above embodiments, "detecting the welding point area and the welding seam area to obtain the battery detection result" may include: when there is no intersection between the welding point area and the welding seam area, determining that the battery detection result is that the battery has a welding point abnormality.
[0114] If the welding spot area does not intersect with the welding seam area, it indicates that the welding spot does not cover the gap between the battery top cover and the battery shell, and the welding spot does not play the role of connecting the battery top cover and the battery shell. In this case, it is directly determined that the battery has welding spot abnormality.
[0115] In the technical solution of the embodiment of the present application, when there is no intersection between the welding point area and the welding seam area, the battery detection result is directly determined, the battery detection speed is fast and efficient, and the detection personnel can be reminded in time, thereby reducing production line losses and further reducing production costs.
[0116] According to some embodiments of the present application, "determining the specifications of the weld point area and the specifications of the weld seam area respectively" in the above embodiments may include: determining the specifications of the weld point area based on the number of pixels in the weld point area and the acquisition accuracy of the image acquisition device that acquires the battery image; determining the specifications of the weld seam area based on the number of pixels in the weld seam area and the acquisition accuracy.
[0117] Among them, the acquisition accuracy of the image acquisition device represents the corresponding relationship between the pixel size and the actual size in the image. For example, the pixel width is W, corresponding to the actual width is W'; the pixel length is L, corresponding to the actual length is L'; the pixel area is S, corresponding to the actual area is S'.
[0118] After the solder joint area is determined, the width of the solder joint in the image can be determined based on the pixel width and the number of pixels in the solder joint area in the width direction; the actual width of the solder joint can be determined based on the width of the solder joint in the image and the acquisition accuracy of the image acquisition device, that is, the specification of the solder joint area can be determined. Similarly, the actual length of the solder joint, the actual area of the solder joint, etc. can be determined.
[0119] After determining the weld area, the width of the weld in the image can be determined based on the pixel width and the number of pixels in the weld area in the width direction; the actual width of the weld can be determined based on the width of the weld in the image and the acquisition accuracy of the image acquisition device, that is, the specification of the weld area can be determined.
[0120] In the above embodiment, the specification of the weld area is determined according to the number of pixels in the weld area and the acquisition accuracy of the image acquisition device that acquires the battery image; the specification of the weld area is determined according to the number of pixels in the weld area and the acquisition accuracy. In the technical solution of the embodiment of the present application, the actual specifications of the welds and welds can be determined so that the battery can be tested according to the actual specifications later, avoiding the problem of different battery test results caused by different acquisition accuracy.
[0121] According to some embodiments of the present application, referring to Fig. 9 ,The training process of the solder joint detection model can include the following steps:
[0122] Step 501: Obtain a first training sample set.
[0123] The training sample set includes sample images of multiple different types of batteries and annotations of each sample image, where the annotations are used to indicate the locations of welding points in the sample images.
[0124] An image acquisition device is used to acquire images of different types of batteries to obtain a plurality of sample images; a welding point position in each sample image is marked; and the plurality of sample images and the markings of each sample image are summarized to obtain a first training sample set.
[0125] Step 502: Perform data enhancement processing on the first training sample set to obtain a second training sample set.
[0126] The data enhancement method may include: at least one of horizontal flipping, vertical flipping, 90 degree clockwise rotation, 90 degree counterclockwise rotation, random cropping, image translation, brightness change, contrast change, image stitching, and image cropping.
[0127] By performing data enhancement processing on one or more sample images in the first training sample set, the number of sample images can be increased to obtain a second training sample set. For example, sample image 1 can be randomly cropped to obtain a new sample image, and sample image 1 and the new sample image can be spliced to obtain another new sample image.
[0128] Step 503: training a neural network model based on the second training sample set to obtain a solder joint detection model.
[0129] The sample images in the second training sample set are input into the pre-established neural network model to obtain the training detection results output by the neural network model; the loss is calculated based on the training detection results and annotations, and if the calculated loss value does not meet the preset convergence conditions, the model parameters of the neural network model are adjusted. The training is terminated until the calculated loss value meets the preset convergence conditions, and the model at the end of the training is used as the solder joint detection model.
[0130] In some embodiments, the second training sample set can also be divided into a training subset and a test subset. The neural network model is trained using the training subset, and the trained model is tested using the test subset. When the test results meet the preset indicators, the tested model is used as the solder joint detection model.
[0131] The above-mentioned preset indicators may be detection accuracy, detection efficiency, etc. In practical applications, the preset indicators may be set according to the situation.
[0132] In the above embodiment, a first training sample set is obtained; data enhancement processing is performed on the first training sample set to obtain a second training sample set; a neural network model is trained based on the second training sample set to obtain a solder joint detection model. In the technical solution of the embodiment of the present application, sample images are collected for different types of batteries, so the solder joint detection model has good generalization and can detect products of different specifications; and the second training sample set is obtained through data enhancement, so a small number of sample images can be annotated to obtain a large number of training samples, which reduces the workload of annotation and reduces labor costs.
[0133] According to some embodiments of the present application, referring to Fig.10 In the above embodiment, “performing grayscale processing on the battery image to obtain a grayscale image” may include the following steps:
[0134] Step 601 : Binarization processing is performed on the battery image using an adaptive threshold to obtain a binary image.
[0135] An adaptive algorithm can be used to determine an adaptive threshold for binarization processing, including: establishing a relationship between the proportion of background pixels, a relationship between the proportion of foreground pixels, an average grayscale value of background pixels, and an average grayscale value of foreground pixels, respectively; establishing a relationship between the overall cumulative value of the grayscale image based on the relationship between the proportion of background pixels and the proportion of foreground pixels; calculating the inter-class variance of foreground pixels and background pixels according to the relationship between the overall cumulative value of the grayscale image, the average grayscale value of background pixels, and the average grayscale value of foreground pixels; and determining the inter-class variance as the adaptive threshold for binarization processing.
[0136] The pixel values less than the adaptive threshold are set to the first value, the pixel values greater than or equal to the adaptive threshold are set to the second value, and a grayscale image is obtained according to the set pixel values.
[0137] Step 602: Perform a morphological opening operation on the binary image to obtain a grayscale image.
[0138] The morphological opening operation includes an operation of first corrosion and then expansion.
[0139] First, a morphological erosion operation is performed on the binary image to obtain an intermediate image; then a morphological dilation operation is performed on the intermediate image to obtain a grayscale image.
[0140] In the above embodiment, an adaptive threshold is used to perform binarization on the battery image to obtain a binary image; a morphological opening operation is performed on the binary image to obtain a grayscale image. In the technical solution of the embodiment of the present application, an adaptive threshold can be used to perform different binarization operations on different battery images, which is more flexible than a fixed threshold and has a better image processing effect; a morphological erosion operation is performed on the binary image to eliminate small particle noise, and then a morphological dilation operation is performed to fill the holes in the area, thereby improving the image quality of the grayscale image, and then improving the accuracy of subsequent battery detection.
[0141] According to some embodiments of the present application, a battery detection method is provided, which is applied to Figure 1 Taking the computer device in the example as an example, the following steps may be included:
[0142] Step 1: Use the pre-trained solder joint detection model to detect the battery image of the top cover welding process to obtain the solder joint detection result.
[0143] The solder joint detection result includes initial detection boundaries of multiple solder joints and confidence levels of each initial detection boundary.
[0144] Step 2: select one or more candidate detection boundaries from the multiple initial detection boundaries according to the confidence of each initial detection boundary.
[0145] Step 3: Binarize the battery image using an adaptive threshold to obtain a binary image; perform a morphological opening operation on the binary image to obtain a grayscale image.
[0146] Step 4: perform boundary cropping on the grayscale image according to the grayscale value to obtain a first cropped image.
[0147] Step 5, for each candidate detection boundary, perform weld spot cropping on the first cropped image according to the candidate detection boundary to obtain a second cropped image; convert the position coordinates of the candidate detection boundary into the second cropped image to obtain an intermediate detection boundary; adjust the position of the intermediate detection boundary according to the grayscale value of the second cropped image to obtain the weld spot area.
[0148] Step 6, determining the grayscale gradient of the first cropped image; using a dynamic programming algorithm to determine a path whose gradient is greater than a preset gradient threshold; performing fitting processing based on the pixel points of the path to obtain a weld area.
[0149] Step 7: When there is no intersection between the welding point area and the welding seam area, it is determined that the battery detection result is that the battery has welding point abnormality.
[0150] Step 8, determining the specifications of the weld area according to the number of pixels in the weld area and the acquisition accuracy of the image acquisition device; determining the specifications of the weld area according to the number of pixels in the weld area and the acquisition accuracy.
[0151] Step 9: Determine the battery test result according to the specifications of the welding spot area and / or the specifications of the welding seam area.
[0152] The technical solution of the embodiment of the present application can automatically detect the battery, which is not only low-cost but also highly efficient. Moreover, the solder joint detection model adopted in the embodiment of the present application does not require human intervention and has good generalization ability. It can detect products of different specifications, thereby improving battery quality and reducing production costs.
[0153] It should be understood that, although the various steps in the above flowchart are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear description in this article, the execution of these steps is not strictly limited in order, and these steps can be executed in other orders. Moreover, at least a part of the steps in the above flowchart may include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.
[0154] Based on the same inventive concept, the embodiment of the present application also provides a battery detection device for implementing the battery detection method involved above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations in one or more battery detection device embodiments provided below can refer to the limitations of the battery detection method above, and will not be repeated here.
[0155] Each module in the above battery detection device can be implemented in whole or in part by software, hardware or a combination thereof. Each module can be embedded in or independent of a processor in an electronic device in the form of hardware, or can be stored in a memory in the electronic device in the form of software, so that the processor can call and execute the corresponding operations of each module.
[0156] According to some embodiments of the present application, referring to Fig.11 , provides a battery detection device, the device comprising:
[0157] The welding spot detection module 701 is used to detect the battery image of the top cover welding process using a pre-trained welding spot detection model to obtain welding spot detection results;
[0158] An image processing module 702 is used to perform grayscale processing on the battery image to obtain a grayscale image;
[0159] The area confirmation module 703 is used to determine the welding spot area and the welding seam area according to the welding spot detection result and the grayscale image;
[0160] The battery detection module 704 is used to detect the welding point area and the welding seam area to obtain the battery detection result; the battery detection result is used to characterize whether the welding point of the battery is abnormal or normal and the welding seam is abnormal or normal;
[0161] Among them, the battery detection module 704 is specifically used to determine the specifications of the weld area and the weld area respectively when the weld area and the weld area intersect; and determine the battery detection result according to the specifications of the weld area and / or the specifications of the weld area.
[0162] In some embodiments, the weld detection results include initial detection boundaries of multiple welds and confidence levels of each initial detection boundary. The area confirmation module 703 is specifically used to filter out one or more candidate detection boundaries from the multiple initial detection boundaries based on the confidence levels of each initial detection boundary; and determine the weld area and weld seam area based on the one or more candidate detection boundaries and the grayscale image.
[0163] In some embodiments, the area confirmation module 703 is specifically used to perform boundary cropping processing on the grayscale image according to the grayscale value to obtain a first cropped image; perform coordinate transformation on each candidate detection boundary based on the first cropped image to obtain a weld area; perform gradient fitting processing based on the first cropped image to obtain a weld area.
[0164] In some embodiments, the area confirmation module 703 is specifically used to perform weld point cropping processing on the first cropped image according to each candidate detection boundary to obtain a second cropped image; and convert the position coordinates of the candidate detection boundary into the second cropped image to obtain the weld point area.
[0165] In some embodiments, the area confirmation module 703 is specifically used to convert the position coordinates of the candidate detection boundary into the second cropped image to obtain the intermediate detection boundary; adjust the boundary position of the intermediate detection boundary according to the grayscale value of the second cropped image to obtain the welding point area.
[0166] In some embodiments, the region confirmation module 703 is specifically used to determine the grayscale gradient of the first cropped image; determine a path whose grayscale gradient is greater than a preset gradient threshold; and perform fitting processing based on pixel points of the path to obtain a weld region.
[0167] In some embodiments, the battery detection module 704 is specifically configured to determine that the battery detection result includes abnormal welding points of the battery when there is no intersection between the welding point area and the welding seam area.
[0168] In some embodiments, the battery detection module 704 is specifically used to determine the specifications of the weld area according to the number of pixels in the weld area and the acquisition accuracy of the image acquisition device that acquires the battery image; and to determine the specifications of the weld area according to the number of pixels in the weld area and the acquisition accuracy.
[0169] In some embodiments, reference Fig.12 , the device further comprises:
[0170] The sample acquisition module 705 is used to acquire a first training sample set; the training sample set includes sample images of multiple different types of batteries and annotations of each sample image, where the annotations are used to indicate the locations of welding points in the sample images;
[0171] A sample enhancement module 706 is used to perform data enhancement processing on the first training sample set to obtain a second training sample set;
[0172] The training module 707 is used to train the neural network model based on the second training sample set to obtain a solder joint detection model.
[0173] In some embodiments, the image processing module 702 is specifically configured to perform binarization processing on the battery image using an adaptive threshold to obtain a binary image; and perform a morphological opening operation on the binary image to obtain a grayscale image.
[0174] According to some embodiments of the present application, a computer device is provided. The computer device may be a terminal, and its internal structure diagram may be as follows: Fig.13As shown. The computer device includes a processor, a memory, an input / output interface, a communication interface, a display unit and an input device. The processor, the memory and the input / output interface are connected through a system bus, and the communication interface, the display unit and the input device are connected to the system bus through the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The input / output interface of the computer device is used to exchange information between the processor and the external device. The communication interface of the computer device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner can be implemented through WIFI, a mobile cellular network, NFC (near field communication) or other technologies. When the computer program is executed by the processor, a battery detection method is implemented. The display unit of the computer device is used to form a visually visible picture, which can be a display screen, a projection device or a virtual reality imaging device. The display screen can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device can be a touch layer covering the display screen, or a button, trackball or touchpad set on the computer device shell, or an external keyboard, touchpad or mouse.
[0175] Those skilled in the art will understand that Fig.13 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0176] According to some embodiments of the present application, there is also provided a non-transitory computer-readable storage medium including instructions, such as a memory including instructions, and the above instructions can be executed by a processor of an electronic device to complete the above method. For example, the non-transitory computer-readable storage medium can be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, etc.
[0177] According to some embodiments of the present application, a computer program product is also provided, and when the computer program is executed by a processor, the above method can be implemented. The computer program product includes one or more computer instructions. When these computer instructions are loaded and executed on a computer, part or all of the above method can be implemented in whole or in part according to the process or function described in the embodiment of the present application.
[0178] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., but are not limited to this.
[0179] The technical features of the above-described embodiments may be arbitrarily combined. To make the description concise, not all possible combinations of the technical features in the above-described embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0180] The above-described embodiments only express several implementation methods of the present application, which is convenient for understanding the technical solutions of the present application in detail, but cannot be understood as limiting the scope of protection of the invention patent. It should be pointed out that for ordinary technicians in this field, without departing from the concept of the present application, several modifications and improvements can be made, which all belong to the protection scope of the present application. It should be understood that the technical solutions obtained by those skilled in the art through logical analysis, reasoning or limited experiments on the basis of the technical solutions provided in the present application are all within the protection scope of the attached claims described in the present application. Therefore, the protection scope of the patent of this application shall be based on the contents of the attached claims, and the description and drawings can be used to explain the contents of the claims.
Claims
1. A battery detection method, characterized in that: The method comprises: Use the pre-trained solder joint detection model to detect the battery image of the top cover welding process and obtain the solder joint detection results; Performing grayscale processing on the battery image to obtain a grayscale image; Determine a welding spot area and a welding seam area according to the welding spot detection result and the grayscale image; Detecting the welding spot area and the welding seam area to obtain a battery detection result; the battery detection result is used to characterize whether the welding spot of the battery is abnormal or normal and whether the welding seam is abnormal or normal; The step of detecting the welding spot area and the welding seam area to obtain the battery detection result includes: In the case where the welding spot area and the welding seam area have an intersection, respectively determining the specifications of the welding spot area and the specifications of the welding seam area; Determining the battery detection result according to the specification of the welding point area and / or the specification of the welding seam area; The solder joint detection result includes initial detection boundaries of a plurality of solder joints and confidence levels of the initial detection boundaries, and determining a solder joint area and a weld area according to the solder joint detection result and the grayscale image includes: Screening out one or more candidate detection boundaries from the plurality of initial detection boundaries according to the confidence of each of the initial detection boundaries and the preset number of welding spots; Determine the welding spot area and the welding seam area according to one or more candidate detection boundaries and the grayscale image; The step of determining the welding spot area and the welding seam area according to one or more of the candidate detection boundaries and the grayscale image comprises: Performing boundary cropping processing on the grayscale image according to the grayscale value to obtain a first cropped image; Performing coordinate transformation on each of the candidate detection boundaries based on the first cropped image to obtain the welding point area; The weld area is determined in the grayscale image according to a preset positional relationship between the weld and the weld point, and the weld point area and pixel values in the grayscale image.
2. The method according to claim 1, characterized in that The method further comprises: Gradient fitting processing is performed based on the first cropped image to obtain the weld area.
3. The method according to claim 1, characterized in that The step of performing coordinate transformation on each of the candidate detection boundaries based on the first cropped image to obtain the solder joint area includes: For each of the candidate detection boundaries, performing welding point cropping processing on the first cropped image according to the candidate detection boundary to obtain a second cropped image; The position coordinates of the candidate detection boundary are converted into the second cropped image to obtain the welding point area.
4. The method according to claim 3, characterized in that: The step of converting the position coordinates of the candidate detection boundary into the second cropped image to obtain the welding spot area includes: Convert the position coordinates of the candidate detection boundary into the second cropped image to obtain an intermediate detection boundary; The intermediate detection boundary is adjusted in position according to the grayscale value of the second cropped image to obtain the welding point area.
5. The method according to claim 2, characterized in that: The step of performing gradient fitting processing based on the first cropped image to obtain the weld area includes: determining a grayscale gradient of the first cropped image; Determine a path whose grayscale gradient is greater than a preset gradient threshold; The welding seam area is obtained by performing fitting processing based on the pixel points of the path.
6. The method according to any one of claims 1 to 5, characterized in that: The detecting the welding spot area and the welding seam area to obtain a battery detection result includes: When the welding point area and the welding seam area have no intersection, it is determined that the battery detection result includes that the battery has welding point abnormality.
7. The method according to claim 1, characterized in that The separately determining the specifications of the welding spot area and the specifications of the welding seam area includes: Determine the specification of the welding spot area according to the number of pixels in the welding spot area and the acquisition accuracy of the image acquisition device that acquires the battery image; The specification of the weld area is determined according to the number of pixels in the weld area and the acquisition accuracy.
8. The method according to any one of claims 1 to 5, characterized in that: The training process of the solder joint detection model includes: Acquire a first training sample set; the training sample set includes sample images of multiple different types of batteries and annotations of each sample image, wherein the annotations are used to indicate the positions of welding points in the sample images; Performing data enhancement processing on the first training sample set to obtain a second training sample set; A neural network model is trained based on the second training sample set to obtain the solder joint detection model.
9. The method according to any one of claims 1 to 5, characterized in that: The grayscale processing of the battery image to obtain a grayscale image includes: Using an adaptive threshold to perform binarization processing on the battery image to obtain a binarized image; A morphological opening operation is performed on the binary image to obtain the grayscale image.
10. A battery detection device, characterized in that: The device comprises: A solder joint detection module is used to detect the battery image of the top cover welding process using a pre-trained solder joint detection model to obtain a solder joint detection result; An image processing module, used for performing grayscale processing on the battery image to obtain a grayscale image; An area confirmation module, used to determine a welding spot area and a welding seam area according to the welding spot detection result and the grayscale image; A battery detection module, used to detect the welding point area and the welding seam area to obtain a battery detection result; the battery detection result is used to characterize whether the welding point of the battery is abnormal or normal and whether the welding seam is abnormal or normal; The battery detection module is specifically used to determine the specifications of the welding point area and the specifications of the welding seam area respectively when the welding point area and the welding seam area have an intersection; and determine the battery detection result according to the specifications of the welding point area and / or the specifications of the welding seam area; The weld spot detection result includes initial detection boundaries of multiple weld spots and confidence levels of each initial detection boundary. The region confirmation module is specifically configured to select one or more candidate detection boundaries from the multiple initial detection boundaries according to the confidence levels of each initial detection boundary and the preset number of weld spots; and determine the weld spot region and the weld seam region according to the one or more candidate detection boundaries and the grayscale image. The area confirmation module is specifically used to perform boundary cropping processing on the grayscale image according to the grayscale value to obtain a first cropped image; based on the first cropped image, coordinate transformation is performed on each of the candidate detection boundaries to obtain the weld area; according to the preset positional relationship between the weld and the weld, and the pixel values in the weld area and the grayscale image, determine the weld area in the grayscale image.
11. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the method according to any one of claims 1 to 9 is implemented.
12. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 9 is implemented.
Citation Information
Patent Citations
Thin steel plate narrow welding joint online visual inspection and control device
CN103480991A
Welding spot detection method based on convolutional neural network
CN113409250A
Method for identifying and detecting length and width of welding marks based on image processing technology
CN114549397A
Machine vision detection method, detection apparatus and detection system thereof
WO2023123003A1