Battery surface coating defect detection method and detection device
Through the combined visual system of 2D+3D, combined with 2D image detection and 3D image processing, the missed detection problem caused by insufficient samples in the prior art is solved, and the efficiency and stability of battery surface envelope defect detection are improved.
Patent Information
- Application Number
- CN202411741479.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-29
- Publication Date
- 2025-03-14
AI Technical Summary
Existing battery surface envelope defect detection methods are prone to missed inspection when there is insufficient sample, and have high requirements for the computing power of the detection equipment, resulting in insufficient efficiency and stability.
Using a vision system combined with 2D+3D, the 2D image detection and 3D image processing method is used to obtain 2D images and 3D point cloud data on the surface of the battery pack to detect defects. The specific steps include obtaining an image of the surface of the battery pack, eliminating the non-envelope area, and performing defect detection; obtaining point cloud data, dividing it into detection blocks, fitting the reference plane, detecting whether the distance between the data point and the reference plane exceeds the threshold, counting the number or area of data points exceeding the threshold, and determining whether there is a defect.
It improves the detection rate and stability of battery surface envelope defect detection, reduces the demand for the computing power of detection equipment, reduces manual participation, and improves detection efficiency.
Smart Images

Figure CN119619145A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of battery pack defect detection, and in particular to a battery surface coating defect detection method and device. Background Art
[0002] The production process of new energy batteries is very high, and the production quality of each process link needs to be strictly controlled. Products with defects are not allowed to flow into the subsequent process, resulting in rework and waste of time and material resources. Therefore, surface defect detection after battery coating is indispensable. Compared with manual visual inspection, visual inspection of surface defects has higher efficiency and stability.
[0003] In the current scheme, statistical defect detection is mainly carried out through machine learning algorithms. The technical solution entitled "A Surface Defect Detection Method for Blue Film Lithium Batteries" with application number CN202410350786.3 mainly provides a deep learning model for differentiating and detecting defects of different categories by training a rotating target model, an instance segmentation model, and a classification network model. However, a large number of defect samples need to be collected in advance to form a training set. When the number of a certain defect is very small, resulting in insufficient samples, there is a risk of missed detection. Moreover, it has high performance requirements for the detection equipment. Summary of the invention
[0004] In order to improve the detection rate and stability of battery surface coating detection and reduce the demand for computing power of detection equipment, the present invention provides a battery surface coating defect detection method and detection device.
[0005] The technical solution of the present invention provides a method for detecting defects on the surface of a battery, comprising the following steps: S1. A step of determining a battery surface coating defect based on 2D image detection: obtaining a surface image of a battery pack, removing a non-coating area from the surface image, and then performing defect detection on the retained battery pack surface image; S2. The step of determining the battery surface coating defects based on 3D image processing: acquiring point cloud data of the battery pack surface, dividing the point cloud data belonging to the battery pack surface into a number of detection blocks, obtaining a reference plane by data fitting for the point cloud data in each detection block, and performing defect detection on the battery pack surface based on the distance from the data point in the point cloud data to the reference plane.
[0006] Preferably, in the step of determining the battery surface coating defects based on 3D image processing in S2, it is determined whether there are data points in the detection block whose distance to their reference plane exceeds a given first threshold, and the number or area of data points exceeding the threshold is counted. If the number or area exceeds a second threshold, it is determined that a defect exists.
[0007] Preferably, in the step of determining the battery surface coating defects based on 3D image processing, the point cloud data in each detection block is fitted with a quadratic surface to obtain the corresponding reference surface.
[0008] Preferably, in the step of determining the battery surface coating defects based on 3D image processing, the point cloud data belonging to the battery pack surface is obtained by compensating and correcting the original point cloud data.
[0009] Preferably, in the compensation and correction step, the point cloud data is converted into a grayscale image, and the image corner points are determined based on the grayscale image; based on the coordinate change relationship between the image corner points and the corner points in the reference data, the transformation matrix of the point cloud data is determined, and after application, the point cloud data belonging to the battery pack surface is obtained.
[0010] Preferably, in the step of determining the battery surface coating defects based on 3D image processing, defect detection is performed as valid point cloud data only when the proportion of invalid points in the point cloud data belonging to the battery pack surface is less than a preset ratio, otherwise it is invalid point cloud data and defect detection is skipped.
[0011] Preferably, in the step of determining the battery surface coating defects based on 3D image processing, the point cloud data belonging to the battery pack surface is fitted into a plane, and the distance from each point in the point cloud data to the fitting plane is calculated to determine the flatness of the point cloud data. If the flatness exceeds a preset threshold, it is determined that a defect exists.
[0012] Preferably, in the step of determining the battery surface coating defects based on 2D image detection in S1, the acquired battery pack image is binarized with a preset threshold, the non-coating area of the battery pack is determined based on the grayscale maximum value, and the battery pack image is processed with the non-coating area as a mask to obtain the retained battery pack surface image.
[0013] Preferably, a connected domain in the battery pack image is used as a feature region, and the minimum circumscribed rectangle of the feature region is used as a feature description of the region. A transformation matrix is determined based on the difference between the feature description and a reference image to transform the battery pack image, and edge detection is performed on the battery pack to determine the outer edge of the retained battery pack surface image. Preferably, in the edge detection, the outer edge of the battery pack surface image is fitted with a straight line, and the angle between adjacent straight lines of the outer edge is detected. If the angle exceeds a preset range, it is determined that a defect exists.
[0014] The present invention further provides a battery surface coating defect detection device, characterized in that it comprises a guide rail and a loading platform for carrying a battery pack arranged on one side of the guide rail; A 2D camera and a 3D camera are movably arranged on the guide rail, and the 2D camera and the 3D camera scan the surface of the battery pack to obtain surface data of the battery pack when moving; Preferably, the loading platform is rotatably arranged to change the side of the battery pack facing the guide rail after rotation.
[0015] This battery surface coating defect detection method uses a 2D+3D combined visual system to detect the battery surface, avoiding the defect omission caused by a single detection mode and improving the detection rate. Using digital image processing technology, after establishing a detection area and reference coordinates based on the photographed image of the template battery, the subsequent battery image data is adaptively adjusted to reduce manual participation and improve efficiency. Since the camera group is movable, the battery carrier can be copied accordingly. Only by adding a camera trigger position can the detection of multiple batteries be realized, which increases the production speed. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] Figure 1 A schematic diagram of a battery surface coating defect detection device according to the present invention; Figure 2 is a front view of a 2D camera and light source combination of the present invention; Figure 3 The figure is a general flow chart of the battery surface coating defect detection method of the present invention; Figure 4 A detailed flow chart of the battery surface coating defect detection method of the present invention; Figure 5 It is a schematic diagram for identifying the coating area on the surface of the battery of the present invention; Figure 6 A schematic diagram of dividing the battery surface coating defect detection method of the present invention into multiple detection blocks for detection.
[0017] 1: Guide rail; 2: 2D camera; 21: Light source; 3: 3D camera; 4: Stage; 9: Battery pack. DETAILED DESCRIPTION
[0018] The present invention is described in detail below in conjunction with the accompanying drawings and specific embodiments. In this specification, the size ratios in the drawings do not represent the actual size ratios, but are only used to reflect the relative position relationship and connection relationship between the components. Components with the same name or the same number represent similar or identical structures and are only for illustrative purposes.
[0019] 3D visual inspection can obtain point cloud data of the battery surface with depth and size information, and has good results in detecting scratches, wrinkles, dents and other defects on the battery surface. However, when the surface defects are not manifested as height changes or the height changes are weak, it is generally difficult to accurately identify and detect them by 3D visual inspection alone. The deep learning method requires the collection of multiple samples and manual classification training models. When the samples are insufficient, the detection effect of the corresponding defects is not ideal. The present invention proposes a battery surface detection structure and method based on 2D+3D vision, in order to improve the detection rate and production efficiency and solve the above problems.
[0020] Figure 1 Schematic diagram of the battery surface coating defect detection device of the present invention. It has a 2D camera 2 and a 3D camera 3 that are movably arranged on a guide rail 1. A stage 4 is arranged on one side of the guide rail 1 for carrying a battery pack 9. When the 2D camera 2 and the 3D camera 3 move and scan the stage 4 in sequence, the corresponding data of the battery pack 9 is obtained. The stage 4 is rotatably arranged to change the side of the battery pack 9 facing the guide rail 1 after rotation, so as to achieve the purpose of detecting different sides of the battery pack 9.
[0021] Two light sources 21 are directed toward each other to provide lighting for the 2D camera to shoot, and the camera group is on one side of the battery. Figure 2 This is a front view of the 2D camera and light source combination. The guide rail 1 facilitates the movement of the camera group for shooting. The structure around the stage facilitates the positioning of the battery after placement and the fixation of the battery when it rotates.
[0022] Based on the above structure, the overall inspection process is as follows: the gripper moves the battery from the front station to the stage 4, the positioning cylinder assists in fixing the battery and then retracts, the light source and camera group begin to move on the guide rail 1, and the 3D camera scans the long side area of the battery to obtain point cloud data on both sides. When the camera group moves to the other side of the stage 4, the rotating cylinder causes the stage 4 to drive the battery to rotate 90°, and the camera group moves back to its original position, and the PLC triggers the 2D camera 2 and the 3D camera 3 at the corresponding position to obtain the surface image data of the battery. The 2D and 3D vision modules will process and analyze the corresponding data, and return the results to the PLC after completion, waiting for the next shooting.
[0023] Figure 3 It is a schematic diagram of the overall process of the present invention, Figure 4 The detailed process of the present invention is as follows. The battery surface coating defect detection method of the present invention comprises: S1, a step of determining the defects of the battery surface coating based on 2D image detection. The surface image of the battery pack is obtained by the 2D camera in the above device, and non-coating areas such as poles and explosion-proof valves are removed from the surface image. Then, the retained battery pack surface image is subjected to defect detection.
[0024] S2, the step of determining the coating defect on the battery surface based on 3D image processing. The point cloud data of the battery pack surface is obtained by the 3D camera in the above device, and the point cloud data belonging to the battery pack surface is divided into several detection blocks. The reference plane is obtained by data fitting for the point cloud data in each detection block, and the distance from the point cloud data to its reference plane is detected to see whether it exceeds a given first threshold, and the number or area of the point cloud exceeding the threshold is counted, and whether the number or area exceeds a given second threshold is used to determine whether there is a defect. If it is lower than the threshold, it is not considered a defect, otherwise it is considered a defect.
[0025] Among them, in the step of S1 to determine the surface coating defects of the battery based on 2D image detection, first trigger the photo to obtain the positive and negative images of the battery as the data source input, and in the ROI area (region of interest) in the input image, use a fixed threshold to binarize the image and perform morphological operations to form a connected domain to eliminate unnecessary background and interference information. Use the characteristic area as the screening condition to locate areas such as poles and explosion-proof valves. Then correct the ROI and caliper position according to the reference coordinates and angles. The caliper tool selects the weighted least squares strategy (huber) to fit a straight line on the edge of the battery, and screens batteries with no obvious abnormalities on the edge under the condition of limiting the minimum score. Determine another ROI with the intersection of the fitted straight lines around the battery, shield the area of the battery's inherent structure in the image, and detect defects in the surface background area.
[0026] In order to accommodate the possible offset of the battery position, before officially enabling the 2D vision module for inspection, it is necessary to take a photo in advance, manually adjust the ROI area and caliper parameters and positions, and locate the characteristic areas and edges of the battery in the positive and negative images. The position of the image at this time is determined as the reference position. In subsequent production, even if the battery position is offset, the affine transformation matrix can be used to refer to this reference to adaptively correct the position of the ROI and caliper, so as to facilitate subsequent inspections.
[0027] The detailed workflow is as follows.
[0028] After the battery is in place, the camera group moves first. When it reaches the photo-taking position, the camera is triggered to take a photo and obtain the image result of the battery. Figure 5 As shown, after filtering, binarization with a fixed threshold, morphological processing and other image processing operations are performed on the 2D image, a blob analysis model is created. The structures such as poles are illuminated by a light source and appear as large grayscale values on the image. After binarization, the pixel values of the poles and other areas can be mapped to the grayscale maximum value, thereby removing some interference factors in the image. That is, after a predetermined threshold processing, a white mask is formed in the non-encapsulated areas such as poles and explosion-proof valves in the image. The background data, that is, the data of the encapsulated patch area of the battery pack, can be obtained by deleting the image corresponding to this part of the mask from the image data. Then, defect detection is performed on the background data.
[0029] Specifically, within the divided ROI range, all connected domains brighter than the background are traversed to select the feature area with the largest feature area. Affected by the equipment or lighting, even if a connected domain is formed, the shape of the screened area may not be regular. In order to facilitate subsequent processing, the minimum circumscribed rectangle of the area is used as the feature description of the area to complete the positioning of the pole. The positioning principle of explosion-proof valves and other structures is similar to this, so it will not be repeated.
[0030] The edge of the background data may not be accurately determined. To achieve this, an improved method for determining the edge is provided. First, a feature region is found in the binary image, the feature region is compared with the reference image, the affine matrix of the image is determined, and the image is adjusted accordingly.
[0031] With reference to the preset reference position and angle, the transformation relationship between the angle and center coordinates of the minimum circumscribed moment of the pole located in step 2 is obtained, and the caliper, ROI and other tools are automatically adjusted.
[0032]
[0033]
[0034] in( , ) is the center of the minimum circumscribed moment, ( , ) are the reference coordinates.
[0035] Then, on the corrected image, a caliper or other measuring tool is used to refit straight lines on the edge of the battery to obtain straight lines L1 and L2 on the upper and lower edges of the battery and straight lines L3 and L4 on the left and right edges of the battery. The four vertices where the four edge lines intersect form a feature region (ROI) that encompasses the entire surface, called Using image processing operations, masks are added to the features such as poles and explosion-proof valves in the feature area, and the corresponding parts are deleted to detect Whether there are defects on the battery surface outside the feature area within the range, such as damage to the battery background surface causing white abnormal areas to appear in the image. The image within the retained feature area is a grayscale image or a binary image. If an abnormal area appears, it means there are bad defects.
[0036] In addition, the outer dimensions of the workpiece are obtained by calculating the distance between L1 (or L3) and L2 (or L4). The distance solution formula is as follows
[0037] in is a point on L1 (or L3), is the expression of the straight line L2 (or L4). In addition, in theory, L1 (or L3) and L2 (or L4) should remain relatively parallel, and L1 (or L2) and L3 (or L4) should be relatively perpendicular. The angle between the two straight lines is:
[0038] in, and are the difference between the horizontal coordinates and the vertical coordinates of the two points on line 1, and The difference between the horizontal coordinates and the vertical coordinates of the two points on line 2 can limit the angle within a certain range as a judgment of whether there is a defect. If the angle exceeds the preset range, it is considered that the edge is poor and there is a defect.
[0039] For defects that are manifested as height changes, the main step is to determine the defects of the battery surface coating based on 3D image processing. The general steps are to scan the battery and obtain point cloud data. The point cloud data belonging to the battery coating area is divided into several detection blocks. A parallel method is used to perform defect detection in each detection block to find the point cloud that obviously deviates from the reference plane and confirm its number or area.
[0040] After scanning the battery and obtaining the point cloud data, adjust the position of the ROI so that the area to be detected is located in the center of the ROI as much as possible; since there may be continuous data of multiple batteries, the image data of each surface of the battery is first segmented and extracted. Calculate the proportion of invalid points in the single ROI area after segmentation. Only when it is lower than the preset threshold (0.5) will subsequent processing be performed, otherwise the process will be terminated directly to further save time; find the position of the upper left corner point of the battery in the valid image data after segmentation (it can be other corner points, and this is taken as an example), and calculate the Euclidean distance of the strong corner point relative to the reference corner point (the reference corner point needs to be manually set once with reference to the image data after cutting), so as to complete the reference correction of the data. After the ROI position is adaptively adjusted according to the calculated corner point offset, it is further divided into multiple grid rectangles according to the step size in the x and y directions. Multiple threads are run in parallel, and the quadratic surface model is solved using the least squares method. The area exceeding the defect threshold (convex or concave) is counted to see whether it exceeds the preset area threshold, which is used as the defect identification. In addition, N points (N>3) can be set in the effective image data after segmentation, the height of each single point can be obtained, the reference plane can be fitted using the least squares method, the distance from each point to the fitting plane can be calculated, the flatness can be obtained, and whether the overall defect is confirmed based on the flatness data.
[0041] The detailed workflow is as follows.
[0042] The 3D camera scans the battery surface with a laser of a certain wavelength to obtain point cloud data. Divide the ROI for the battery's cylindrical surface, long side surface, etc., adjust the ROI size and position, and its length and width should be slightly larger than the length and width of the battery in the image to keep the battery within the ROI area. The adjustment is performed for the first time, and then it is automatically adjusted according to the relative offset between the actual position and the reference position. Copy and segment the point cloud data according to the divided multiple ROIs, remove invalid areas, and extract each data area of the battery.
[0043] Traverse the point cloud data in each area and find the number of invalid data , the total number of points in the statistical area , get the invalid point ratio , exceeds the limit value When the battery is detected, it is determined that there is no valid battery data and the subsequent detection process is skipped.
[0044]
[0045] The point cloud data is converted into a grayscale image. After binarization and morphological processing, the image corners are determined based on the Shi-Tomasi algorithm. The coordinate change relationship relative to the reference corners is calculated so that the position of the ROI can automatically follow when the image position changes. After the offset compensation of the corners, the N points (N>3) set in the reference follow.
[0046] According to the offset compensation amount obtained by corner point correction, adjust the position of ROI so that the area to be detected is inside it. Figure 6 As shown, then start from the upper left corner with a certain step length ( ,and ) is divided into multiple sub-grids for fine-grained detection, such as Figure 5 As shown. A multi-threaded parallel processing strategy is used for the divided sub-grids. Due to the possible height defects, the least squares method is selected here to simulate the surface, which is more realistic than the plane. The quadratic surface equation is
[0047] Taking the point cloud data as input, based on the least squares idea, the coefficients of the above surface equation are calculated by matrix relationship. Then traverse the point set ( , ) coordinates into the surface equation to obtain the actual height Fitting theory When the relative difference exceeds the preset limit, it means that there is an abnormal protrusion or depression, which is judged as abnormal. Here, the area of the abnormal area is checked to determine whether it is a defect. If it is greater than the threshold, there is a defect.
[0048] Use the least squares method to fit the plane, and solve the coefficients of the plane equation based on singular value decomposition (SVD) to obtain the plane expression of FPlane, and then calculate the distance from each point to the fitting plane, and use the extreme difference of the distance as the result of flatness. The preset plane equation is:
[0049] The least squares method is used to fit the plane, and the plane equation is solved based on the singular value decomposition (SVD). , , , The coefficients of each item are used to obtain the plane expression of FPlane. Point ( , , ) to the plane FPlane is expressed as:
[0050] If the flatness exceeds the threshold, it is determined that a defect exists.
[0051] The detection and judgment results of the 2D module and the 3D module are sent to the PLC for waste discharge basis and historical records.
[0052] This battery surface coating defect detection method uses a 2D+3D combined visual system to detect the battery surface, avoiding defect omissions caused by a single detection mode and improving the detection rate. Using digital image processing technology, after establishing a detection area and reference coordinates based on the photographed image of the template battery, the subsequent batteries are adaptively adjusted to reduce manual participation and improve efficiency. Since the camera group is movable, the battery carrier can be copied accordingly. Only by adding a camera trigger position can the detection of multiple batteries be realized, which increases the production speed.
[0053] The above content only describes the preferred implementation mode of the present invention, and does not limit the scope of the present invention. Without departing from the design spirit of the present invention, various modifications and improvements made to the technical solution of the present invention by ordinary technicians in this field should fall within the protection scope determined by the claims of the present invention.
Claims
1. A method for detecting defects in a battery surface coating, characterized in that: The following steps are involved: S1. A step of determining a battery surface coating defect based on 2D image detection: obtaining a surface image of a battery pack, removing a non-coating area from the surface image, and then performing defect detection on the retained battery pack surface image; S2. The step of determining the battery surface coating defects based on 3D image processing: acquiring point cloud data of the battery pack surface, dividing the point cloud data belonging to the battery pack surface into a number of detection blocks, obtaining a reference plane by data fitting for the point cloud data in each detection block, and performing defect detection on the battery pack surface based on the distance from the data point in the point cloud data to the reference plane.
2. The battery surface coating defect detection method according to claim 1, characterized in that: In the step of determining the battery surface coating defects based on 3D image processing in S2, it is determined whether there are data points in the detection block whose distance to the reference plane exceeds a given first threshold, and the number or area of the data points exceeding the threshold is counted. If the number or area exceeds a second threshold, it is determined that a defect exists.
3. The battery surface coating defect detection method according to claim 1, characterized in that: In the step of determining the battery surface coating defects based on 3D image processing, the point cloud data in each detection block is fitted with a quadratic surface to obtain the corresponding reference surface.
4. The battery surface coating defect detection method according to claim 3, characterized in that: In the step of determining the battery surface coating defects based on 3D image processing, the point cloud data belonging to the battery pack surface is obtained by compensating and correcting the original point cloud data.
5. The battery surface coating defect detection method according to claim 4, characterized in that: In the compensation and correction step, the point cloud data is converted into a grayscale image, and the image corner points are determined based on the grayscale image; based on the coordinate change relationship between the image corner points and the corner points in the reference data, the transformation matrix of the point cloud data is determined, and after application, the point cloud data belonging to the battery pack surface is obtained.
6. The battery surface coating defect detection method according to claim 4, characterized in that: In the step of determining the battery surface coating defects based on 3D image processing, defect detection is performed as valid point cloud data only when the proportion of invalid points in the point cloud data belonging to the battery pack surface is less than a preset ratio; otherwise, it is invalid point cloud data and defect detection is skipped.
7. The battery surface coating defect detection method according to claim 1, characterized in that: In the step of determining the battery surface coating defects based on 3D image processing, the point cloud data belonging to the battery pack surface is fitted into a plane, and the distance from each point in the point cloud data to the fitting plane is calculated to determine the flatness of the point cloud data. If the flatness exceeds a preset threshold, it is determined that a defect exists.
8. The battery surface coating defect detection method according to claim 1, characterized in that: In the step of determining the coating defects on the battery surface based on 2D image detection in S1, the acquired battery pack image is binarized with a preset threshold value, the non-coating area of the battery pack is determined based on the grayscale maximum value, and the battery pack image is processed with the non-coating area as a mask to obtain a retained battery pack surface image.
9. The battery surface coating defect detection method according to claim 8, characterized in that: Taking a connected domain in the battery pack image as a feature region, taking a minimum circumscribed rectangle of the feature region as a feature description of the region, determining a transformation matrix based on a difference between the feature description and a reference image to transform the battery pack image, and performing edge detection on the battery pack to determine an outer edge of a retained battery pack surface image; Preferably, in the edge detection, the outer edge of the battery pack surface image is fitted with a straight line, and the angle between adjacent straight lines of the outer edge is detected. If the angle exceeds a preset range, it is determined that a defect exists.
10. A battery surface coating defect detection device, characterized in that: It comprises a guide rail (1) and a loading platform (4) arranged on one side of the guide rail (1) and used for carrying a battery pack (9); A 2D camera (2) and a 3D camera (3) are movably arranged on the guide rail (1), and when the 2D camera (2) and the 3D camera (3) move, they scan the surface of the battery pack (9) to obtain surface data of the battery pack (9); Preferably, the loading platform (4) is rotatably arranged to change the side of the battery pack (9) facing the guide rail (1) after rotation.
Citation Information
Patent Citations
Surface defect detection method for blue film coated lithium battery
CN118247246A