Battery cell pole visual inspection method, system, device and storage medium
Patent Information
- Application Number
- CN202611433883.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-09-15
- Publication Date
- 2026-11-27
AI Technical Summary
In existing technologies, the positioning failure problem caused by the variable surface condition of the battery cell terminals is difficult to completely solve through hardware modification, and the modification cost is high and the cycle is long.
By acquiring pixel images and shooting coordinates of the battery cell terminals, a matching score and pixel offset are calculated using a pre-built terminal image template library. The pixel offset is then converted into a physical offset using a preset mapping matrix, ensuring the accuracy and consistency of the detection results.
Even when the surface condition of the battery cell terminal is abnormal, it can still output target coordinates with real physical meaning, which improves the stability and accuracy of welding or processing and avoids positioning failure.
Smart Images

Figure CN123181391A_ABST
Abstract
Description
Technical Field
[0001] This application belongs to the field of visual inspection technology, and in particular relates to a visual inspection method, system, device and storage medium for battery cell terminals. Background Technology
[0002] In the field of new energy battery manufacturing, visual positioning and inspection at the pre-welding station of the cell terminals is a key step to ensure welding accuracy and product quality.
[0003] In existing technologies, visual inspection at the pre-welding station generally adopts a single template matching method. When surface abnormalities such as scratches, dirt, or rework grinding occur on the battery cell terminals, it will directly lead to positioning failures such as matching failure or abnormal matching points.
[0004] Existing improvement measures mostly rely on hardware modifications, including replacing tooling fixtures, adjusting tray structures, and modifying supplementary lighting solutions. These modifications are not only costly and time-consuming, but also fail to fundamentally solve the positioning failure problem caused by the variable surface conditions of the battery cell terminals. Summary of the Invention
[0005] The purpose of this application is to provide a visual inspection method, system, device and storage medium for battery cell terminals to solve the positioning failure problem caused by the changing surface conditions of battery cell terminals.
[0006] To achieve the above objectives, the solution proposed in this application is: In a first aspect, embodiments of this application provide a visual inspection method for battery cell terminals, including: Obtain the first pixel image of the first cell terminal and the coordinates of the first pixel image capture; In a pre-built electrode image template library, determine any template image whose surface similarity value to the first pixel image is greater than or equal to a preset similarity threshold, and the template image includes the second cell electrode. Calculate the matching score between the first pixel image and the template image; The pixel offset between the first cell electrode and the second cell electrode is calculated based on the matching score and the preset matching threshold. The pixel offset is converted into a physical offset using a preset mapping matrix; The target coordinates are obtained by superimposing the physical offset with the shooting coordinates.
[0007] The method described in the embodiments of this application may also have the following additional technical features: Further, the matching score between the first pixel image and the template image is calculated, including: Calculate the contour similarity value between the first pixel image and the template image; In the first pixel image, a grayscale calculation region is determined, and in the grayscale calculation region, the pixel grayscale value of the first pixel image is calculated. The matching score is obtained by weighted fusion of surface similarity value, contour similarity value and pixel gray value.
[0008] Furthermore, the pixel offset between the first and second battery cell terminals is calculated based on the matching score and a preset matching threshold, including: When the matching score is greater than or equal to the preset matching threshold, the first center pixel coordinates of the first cell electrode are extracted in the first pixel image; the second center pixel coordinates of the second cell electrode are extracted in the template image; and the first difference between the first center pixel coordinates and the second center pixel coordinates is used as the pixel offset. When the matching score is less than the preset matching threshold, the first pixel image is binarized to obtain the second pixel image; in the second pixel image, the third center pixel coordinates of the first cell electrode are extracted; the second difference between the third center pixel coordinates and the second center pixel coordinates is used as the pixel offset.
[0009] Furthermore, when the matching score is less than a preset matching threshold and the surface similarity value is greater than or equal to a preset similarity threshold, the cell electrode visual inspection method also includes: Calculate the third difference between the coordinates of the first center pixel and the coordinates of the second center pixel; When the fourth difference between the third difference and the second difference is less than or equal to the preset difference threshold, the preset matching threshold is updated according to the matching score to obtain the updated matching threshold; The pixel offset between the first and second battery cell terminals is calculated based on the matching score and the updated matching threshold.
[0010] Furthermore, when the matching score is less than a preset matching threshold, the first pixel image is binarized to obtain the second pixel image, including: The first pixel image is converted to grayscale and denoised to obtain the third pixel image; The third pixel image is binarized to obtain the second pixel image.
[0011] Furthermore, after binarizing the third pixel image to obtain the second pixel image, the cell electrode visual inspection method also includes: Edge detection is performed on the second pixel image to obtain the edge point set; The edge point set is superimposed and fused with the second pixel image to obtain the fourth pixel image; In the fourth pixel image, the fourth center pixel coordinates of the first cell terminal are extracted; the fifth difference between the fourth center pixel coordinates and the second center pixel coordinates is used as the pixel offset.
[0012] Secondly, this application provides a battery cell electrode visual inspection system, including a PLC system, an industrial computer and a three-axis servo system; a camera is installed at the Z-axis end of the three-axis servo system. The imaging device is connected to the industrial control computer for communication. The imaging device is used to acquire the first pixel image of the first cell terminal and send the first pixel image to the industrial control computer. The PLC system is connected to the three-axis servo system and the industrial computer respectively. The PLC system is used to read the shooting coordinates fed back by the three-axis servo system when the shooting device shoots the first pixel image, and send the shooting coordinates to the industrial computer. An industrial control computer includes a storage module, a computing unit, and a coordinate mapping unit; The storage module is used to store a pre-built image template library; the industrial control computer is used to determine any template image in the pre-built electrode image template library whose surface similarity value with the first pixel image is greater than or equal to a preset similarity threshold, and the template image includes the second cell electrode. The calculation unit is used to calculate the pixel offset between the first cell electrode and the second cell electrode based on the matching score and the preset matching threshold; The coordinate mapping unit stores a preset mapping matrix, which is used to convert pixel offsets into physical offsets using the preset mapping matrix. The industrial control computer is used to superimpose the physical offset with the shooting coordinates to obtain the target coordinates, and then send the target coordinates to the PLC system.
[0013] Furthermore, the computing unit includes a single-point correction module and a branch storage module; The single-point correction module is used to extract the first center pixel coordinates of the first cell electrode in the first pixel image when the matching score is greater than or equal to the preset matching threshold; extract the second center pixel coordinates of the second cell electrode in the template image; and use the first difference between the first center pixel coordinates and the second center pixel coordinates as the pixel offset. The branch storage module includes an image binarization processing unit and a geometric parameter calculation unit; The image binarization processing unit is used to perform image binarization processing on the first pixel image to obtain the second pixel image when the matching score is less than the preset matching threshold. The geometric parameter calculation unit is used to extract the third center pixel coordinates of the first cell electrode in the second pixel image; and to use the second difference between the third center pixel coordinates and the second center pixel coordinates as the pixel offset.
[0014] Thirdly, embodiments of this application provide a visual inspection device for battery cell terminals. The visual inspection device for battery cell terminals includes a processor and a memory. The memory stores a computer program, which is loaded and executed by the processor to implement a visual inspection method for battery cell terminals provided in the first aspect of embodiments of this application.
[0015] Fourthly, embodiments of this application provide a computer-readable storage medium storing a computer program. When the computer program is executed by a processor, it is used to implement a cell electrode visual inspection method provided in the first aspect of embodiments of this application.
[0016] The cell electrode visual inspection method provided in this application has the following advantages compared with the prior art: This application embodiment lays the data foundation for all subsequent calculations by acquiring the first pixel image and shooting coordinates. Regardless of the path used to calculate the pixel offset, the shooting coordinates serve as the reference for mechanical coordinate transformation, binding the image processing results with the actual physical space. This ensures that even if the surface condition of the battery cell electrode is abnormal, the final output target coordinates still have real physical meaning and can guide the welding equipment to perform precise operations.
[0017] This application embodiment improves the adaptability to the surface state of the battery cell electrode by determining the template image from a pre-built electrode image template library, fundamentally solving the problem of single template matching failure caused by the diversity of battery cell electrode surface states.
[0018] This application embodiment calculates the matching score between the first pixel image and the template image, which can provide a reliable reference basis when the surface state of the battery cell electrode is changing, rather than directly determining whether the matching is successful or unsuccessful, thus further solving the problem of positioning failure.
[0019] This application embodiment calculates pixel offset, enabling it to perform calculations based on the relationship between the matching score and the preset matching threshold when the surface state of the battery cell electrode is variable, rather than directly determining that the positioning has failed and being unable to output any positioning results.
[0020] This application embodiment converts pixel offsets into physical offsets through a preset mapping matrix, further ensuring the consistency of detection results under varying conditions on the surface of the battery cell terminals.
[0021] The embodiments of this application obtain the target coordinates by superimposing the physical offset with the shooting coordinates, making the detection results readily usable without requiring additional calculations from the back-end welding or processing equipment, thereby improving the overall stability of cell electrode detection and subsequent welding or processing. Attached Figure Description
[0022] Figure 1 A structural block diagram of the cell electrode visual inspection system according to an embodiment of this application is shown; Figure 2 A structural block diagram of the computing unit according to an embodiment of this application is shown; Figure 3 A structural block diagram of a cell electrode visual inspection system according to another embodiment of this application is shown; Figure 4 A flowchart illustrating the visual inspection method for battery cell terminals according to an embodiment of this application is shown. Figure 5 A flowchart illustrating the matching score calculation method according to an embodiment of this application is shown; Figure 6 A flowchart illustrating the pixel offset calculation method according to an embodiment of this application is shown; Figure 7 A flowchart illustrating the preset matching threshold update method according to an embodiment of this application is shown; Figure 8 A schematic flowchart of an image binarization processing method according to an embodiment of this application is shown; Figure 9 A flowchart illustrating a pixel offset calculation method according to another embodiment of this application is shown; Figure 10 A structural block diagram of a computer device according to an embodiment of this application is shown.
[0023] Explanation of reference numerals in the attached drawings: 11. PLC system; 12. Industrial computer; 13. Three-axis servo system; 14. Imaging device; 15. Coaxial lighting device; 16. Tray positioning mechanism; 21. Single-point correction module; 22. Branch storage module; 23. Image binarization processing unit; 24. Geometric parameter calculation unit. Detailed Implementation
[0024] To make the above-mentioned objectives, features, and advantages of this application more apparent and understandable, the specific embodiments of this application will be described in detail below with reference to the accompanying drawings. It should be understood that the specific embodiments described herein are for illustrative purposes only and are not intended to limit the scope of this application. Furthermore, it should be noted that, for ease of description, only the parts relevant to this application are shown in the accompanying drawings, not the entire structure. Based on the embodiments in this application, all other embodiments obtained by those skilled in the art without inventive effort are within the scope of protection of this application.
[0025] The terms “comprising” and “having”, and any variations thereof, used in this application are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or apparatus that includes a series of steps or units is not limited to the steps or units listed, but may optionally include steps or units not listed, or may optionally include other steps or units inherent to such process, method, product, or apparatus.
[0026] In this application, the reference to "embodiment" means that a specific feature, structure, or characteristic described in connection with an embodiment may be included in at least one embodiment of this application. The appearance of this phrase in various places throughout the specification does not necessarily refer to the same embodiment, nor is it a mutually exclusive, independent, or alternative embodiment. It will be explicitly and implicitly understood by those skilled in the art that the embodiments described in this application can be combined with other embodiments.
[0027] Please refer to Figure 1 This application provides a visual inspection system for battery cell terminals. This system is applied in the field of new energy battery manufacturing, and performs visual inspection of the position of the battery cell terminals before welding or processing them.
[0028] Specifically, the battery cell electrode visual inspection system includes a PLC system 11, an industrial computer 12, and a three-axis servo system 13. The PLC system 11 is a programmable logic controller used to control the operating logic of the battery cell electrode visual inspection system; the industrial computer 12 is an industrial control computer responsible for image processing and calculation functions in the battery cell electrode visual inspection system; the three-axis servo system 13 includes three movement directions—X-axis, Y-axis, and Z-axis—and is controlled by the PLC system 11 to achieve rapid positioning.
[0029] At the Z-axis end of the three-axis servo system 13, an imaging device 14 is fixedly installed. The imaging device 14 is used to acquire images of the first battery cell terminal to obtain a first pixel image. The imaging device 14 in this embodiment can be selected from various options, such as an industrial camera and lens, a vision sensor, etc.
[0030] The shooting device 14 is communicatively connected to the industrial control computer 12. In this embodiment of the application, there are multiple options for the communication connection method, such as communicating through image transmission interfaces such as Gigabit Ethernet (GigE), USB 3.0 or Camera Link, to ensure that the first pixel image acquired by the shooting device 14 is sent to the industrial control computer 12 for processing.
[0031] The PLC system 11 is connected to the three-axis servo system 13 and the industrial computer 12 respectively. There are also multiple communication connection methods in this embodiment, such as communication connection through industrial fieldbus (such as PROFINET, EtherCAT or RS-485).
[0032] On one hand, the PLC system 11 is used to control the three-axis servo system 13 to reach the specified shooting position, so that the shooting device 14 fixedly installed at the end of the Z-axis of the three-axis servo system 13 can acquire the first pixel image at the specified shooting position, and read the feedback values of the encoders of each axis of the three-axis servo system 13 when the shooting device 14 acquires the first pixel image. The PLC system 11 generates shooting coordinates based on the feedback values of each axis encoder.
[0033] On the other hand, the PLC system 11 and the industrial computer 12 perform bidirectional data interaction. For example, the PLC system 11 sends the captured coordinates to the industrial computer 12 at the same time, or receives the target coordinates sent by the industrial computer 12.
[0034] Specifically, the industrial control computer 12 includes a storage module, a computing unit, and a coordinate mapping unit.
[0035] The storage module stores a pre-built image template library. When the shooting device 14 sends the first pixel image to the industrial control computer 12, the industrial control computer 12 determines a template image including the second battery cell terminal in the pre-built image template library. The template image must satisfy that the surface similarity value with the first pixel image is greater than or equal to a preset similarity threshold.
[0036] The calculation unit is used to calculate the matching score between the first pixel image and the template image, and to calculate the pixel offset between the first cell electrode and the second cell electrode based on the relationship between the matching score and the preset matching threshold.
[0037] The coordinate mapping unit stores a preset mapping matrix used to convert pixel offsets into physical offsets. This preset mapping matrix is pre-established and stored through a nine-point calibration process.
[0038] Specifically, the process of establishing this preset mapping matrix includes: The operator places the calibration board (such as a checkerboard calibration board or a dot array calibration board) on the standard testing plane of the battery cell terminals. The PLC system 11 controls the three-axis servo system 13 to move the imaging device 14 sequentially to the nine preset calibration point positions (usually a 3x3 uniform grid) on the calibration board. At each calibration point, the PLC system 11 records the corresponding mechanical coordinates of the point and sends them to the industrial control computer 12. At the same time, the imaging device 14 acquires the pixel image of the point, and the industrial control computer 12 extracts the pixel coordinates of the calibration point in the pixel image.
[0039] At this point, the industrial computer 12 has obtained a set of mechanical coordinates and pixel coordinates that correspond one-to-one with these mechanical coordinates. The industrial computer 12 can then calculate the preset mapping matrix using these two sets of coordinates.
[0040] The industrial control computer 12 converts the pixel offset into a physical offset using the preset mapping matrix and then superimposes it onto the shooting coordinates to obtain the target coordinates, and then sends the target coordinates to the PLC system 11.
[0041] In some embodiments, the PLC system 11 may also send the target coordinates to equipment used for welding or processing the first cell electrode.
[0042] It should be understood that, in addition to storing a pre-built image template library, the aforementioned storage module can also store various preset thresholds, such as preset similarity thresholds and preset matching thresholds.
[0043] Please refer to Figure 2 This is a computing unit provided in an embodiment of the present application. The computing unit includes a single-point correction module 21 and a branch storage module 22.
[0044] In this embodiment, the single-point correction module 21 and the branch storage module 22 correspond to two different detection paths. The single-point correction module 21 corresponds to the first detection path, and the branch storage module 22 corresponds to the second detection path. The first detection path is applicable when the matching score is greater than or equal to a preset matching threshold, while the second detection path is applicable when the matching score is less than the preset matching threshold.
[0045] Specifically, when the matching score is greater than or equal to the preset matching threshold, the single-point correction module 21 extracts the first center pixel coordinates of the first cell electrode in the first pixel image; extracts the second center pixel coordinates of the second cell electrode in the template image; and uses the first difference between the first center pixel coordinates and the second center pixel coordinates as the pixel offset.
[0046] The branch storage module 22 further includes an image binarization processing unit 23 and a geometric parameter calculation unit 24. When the matching score is less than a preset matching threshold, the image binarization processing unit 23 performs image binarization processing on the first pixel image to obtain the second pixel image. The geometric parameter calculation unit 24 extracts the third center pixel coordinates of the first cell electrode in the second pixel image and uses the second difference between the third center pixel coordinates and the second center pixel coordinates as the pixel offset.
[0047] Please refer to Figure 3 This application provides a battery cell electrode visual inspection system, which further includes a coaxial supplementary lighting device 15 and a tray positioning mechanism 16.
[0048] The coaxial lighting device 15 is mounted directly below the shooting device 14. The coaxial lighting device 15 is coaxially configured with the shooting device 14 and moves synchronously with the three-axis servo system 13. The coaxial lighting device 15 is used to provide additional illumination when the shooting device 14 is shooting, so as to highlight the edge contour and surface features of the first cell terminal post, while suppressing the interference of ambient light.
[0049] The tray positioning mechanism 16 is connected to the PLC system 11 for control. Before the imaging device 14 acquires the first pixel image, it performs a clamping action on the first cell terminal in response to the PLC system 11 to ensure that the position of the first cell terminal is stable during the detection process. After the detection is completed, it performs a releasing action on the first cell terminal in response to the PLC system 11 again.
[0050] Please refer to Figure 4 This application provides a method for visual inspection of battery cell terminals, applied to the aforementioned battery cell terminal visual inspection system. The method includes the following steps: Step 101: Obtain the first pixel image of the first cell terminal and the shooting coordinates of the first pixel image.
[0051] The first cell terminal in this embodiment is the cell terminal to be tested.
[0052] In some embodiments, the first cell terminal is a circular terminal.
[0053] In other embodiments, the first cell terminal is a rectangular terminal.
[0054] When the shooting device 14 of this application embodiment captures the image of the first battery cell electrode when the PLC system 11 controls the three-axis servo system 13 to reach the specified shooting position, the image obtained is the first pixel image of this application embodiment.
[0055] In some embodiments, the specified shooting location is manually set by the operator.
[0056] In other embodiments, the designated shooting location is a teaching point pre-set by the operator.
[0057] While the imaging device 14 acquires the first pixel image, the PLC system 11 acquires the feedback values of the encoders of each axis of the three-axis servo system 13, and generates the imaging coordinates of the first pixel image based on the feedback values of each axis.
[0058] It should be noted that the shooting coordinates in this embodiment are mechanical coordinates obtained by the shooting device 14.
[0059] Step 102: In the pre-built electrode image template library, determine any template image whose surface similarity value with the first pixel image is greater than or equal to a preset similarity threshold, and the template image includes the second cell electrode.
[0060] The pre-built electrode image template library in this application embodiment is stored in the built-in storage module of the industrial control computer 12. The pre-built electrode image template library includes various template images corresponding to various types of battery cell electrodes, such as normal electrode template images, scratched electrode template images, and dirty electrode template images.
[0061] Once the imaging device 14 acquires the first pixel image, it will send the first pixel image to the industrial control computer 12.
[0062] In some embodiments, after receiving the first pixel image, the industrial control computer 12 sequentially performs surface similarity calculations on various template images in the pre-built polar image template library. When the surface similarity value between any template image and the first pixel image is greater than or equal to a preset similarity threshold, the template image is used as the basis for subsequent calculations.
[0063] In other embodiments, the industrial computer 12 can also traverse all template images in the pole image template library and use the template image with the highest surface similarity value as the basis for subsequent calculations.
[0064] The preset similarity threshold in this application embodiment is a threshold used to determine whether the first pixel image can be successfully matched with the corresponding template image in the pre-built polar image template library.
[0065] Preferably, the preset similarity threshold in this application embodiment is 0.75.
[0066] It should be understood that the cell terminal in the template image is the second cell terminal in the embodiment of this application.
[0067] The industrial control computer 12 in this embodiment can calculate the surface similarity value between the first pixel image and the template image using various methods, such as normalized cross-correlation or squared difference matching.
[0068] Step 103: Calculate the matching score between the first pixel image and the template image.
[0069] After the industrial control computer 12 determines the template image corresponding to the first pixel image through step 102, this step further calculates the matching score between the first pixel image and the template image.
[0070] The matching score in this embodiment is used to characterize the overall matching degree between the first pixel image and the template image.
[0071] In some embodiments, the matching score can be calculated by weighting the contour similarity value between the first pixel image and the template image based on the surface similarity value, and the weighted calculation result is used as the matching score.
[0072] In another embodiment, the matching score can be calculated by weighting the pixel grayscale value of the first pixel image based on the surface similarity value and the contour similarity value, and the weighted calculation result is used as the matching score.
[0073] Step 104: Calculate the pixel offset between the first cell terminal and the second cell terminal based on the matching score and the preset matching threshold.
[0074] After the industrial control computer 12 calculates the matching score between the first pixel image and the template image through step 103, it needs to calculate the pixel offset between the first cell electrode and the second cell electrode based on the relationship between the matching score and the preset matching threshold.
[0075] The preset matching threshold in this application embodiment is used to calculate the pixel offset of the first battery cell terminal and the second battery cell terminal.
[0076] Preferably, in this embodiment of the application, the preset matching threshold is obtained by acquiring multiple frames (e.g., 20 frames) of battery cell electrode images with known normal surface conditions, calculating the average matching score of each frame, and multiplying this average value by a preset coefficient (e.g., 0.9) to obtain the preset matching threshold. This preset coefficient is used to set an entry lower limit slightly lower than the normal average value to avoid frequent false switching to the second detection path due to fluctuations in normal operating conditions.
[0077] When the matching score is greater than or equal to the preset matching threshold, it means that the first pixel image meets the detection conditions of the first detection path. At this time, the pixel offset between the first cell electrode and the second cell electrode can be directly calculated.
[0078] When the matching score is less than the preset matching threshold, it means that the first pixel image does not meet the detection conditions of the first detection path. In this case, if the pixel offset between the first cell electrode and the second cell electrode is directly calculated, the value obtained will be inaccurate.
[0079] Therefore, the first pixel image needs to be processed through the second detection path, and then the pixel offset between the first cell electrode and the second cell electrode needs to be calculated based on the processed pixel image.
[0080] It should be noted that when the matching score is greater than or equal to the preset matching threshold, regardless of whether the first pixel image is determined to be a normal polar template image, a scratched polar template image, or a dirty polar template image in step 102, it means that the first pixel image meets the detection conditions of the first detection path.
[0081] Step 105: Convert the pixel offset into a physical offset using a preset mapping matrix.
[0082] The preset mapping matrix of this application embodiment has been described in detail above and will not be repeated here.
[0083] Since the shooting coordinates obtained by the PLC system 11 in step 101 are mechanical coordinates, while the pixel offset calculated by the industrial computer 12 in step 104 is pixel data, the two do not belong to the same dimension. Therefore, the shooting coordinates and pixel offsets cannot be directly superimposed for calculation.
[0084] In this embodiment, the industrial control computer 12 converts the pixel offset into a physical offset with the same dimensions as the mechanical coordinates through a preset mapping matrix, so that subsequent calculations can be performed.
[0085] Step 106: Overlay the physical offset with the shooting coordinates to obtain the target coordinates.
[0086] In this embodiment of the application, the process of superimposing the physical offset with the shooting coordinates to obtain the target coordinates is performed in the industrial control computer 12.
[0087] It should be noted that in step 101, after the PLC system obtains the shooting coordinates, it will send the shooting coordinates to the industrial control computer 12. It is not until step 106 that the industrial control computer 12 will perform superposition calculation on the shooting coordinates and the physical offset obtained in step 105 to obtain the final target coordinates.
[0088] In some embodiments, the industrial computer 12 sends the obtained target coordinates to the PLC system 11 so that the PLC system 11 can send the target coordinates to the equipment used for welding or processing the first cell electrode.
[0089] In summary, the cell electrode visual detection method of this application calculates the matching score between the first pixel image and the template image, and selects different detection methods for the first cell electrode based on the relationship between the matching score and the preset matching threshold. This enables the final target coordinates to be obtained even if the first cell electrode is a scratched or dirty electrode, without directly causing positioning failure. Therefore, the cell electrode visual detection method of this application solves the positioning failure problem caused by the variable surface condition of the cell electrode.
[0090] Please refer to Figure 5 This application provides a matching score calculation method, which includes the following steps: Step 201: Calculate the contour similarity value between the first pixel image and the template image.
[0091] After obtaining the surface similarity value in step 102, the industrial control computer 12 in this embodiment of the application further calculates the contour similarity between the first pixel image and the template image in order to improve the accuracy of the matching degree between the first pixel image and the template image represented by the matching score.
[0092] The industrial computer 12 first determines the region of interest in the first pixel image.
[0093] For example, the industrial computer 12 uses the center point of the matching box of the template image in the first pixel image as a reference, and uses 1.2-1.5 times the diameter of the standard pole as the side length or radius to determine a rectangular or circular area in the first pixel image, and takes this area as the region of interest.
[0094] Then, after adaptive threshold binarization of the region of interest, the target contour of the first pixel image is extracted.
[0095] For example, after the industrial control computer 12 performs adaptive threshold binarization on the region of interest, it obtains a binary image. It then uses a contour extraction algorithm to extract all contours from the binary image and sorts the pixel areas (number of pixels) enclosed by all contours. The contour with the largest pixel area is then taken as the target contour.
[0096] It should be understood that the industrial control computer 12 can extract the template outline of the template image using the same method, or it can directly obtain the template outline using the global fixed threshold binarization method.
[0097] When the second cell electrode in the template image is a circular electrode, the contour similarity value is calculated by calculating the total length of the closed boundary of the target contour and the pixel area of the target contour, as shown in the following formula:
[0098] in, Indicates the contour similarity value; The pixel area representing the target outline; Represents the total length of the closed boundary of the target contour, in pixels.
[0099] The value range is 0-1.0. The closer it is to 1.0, the closer the shape of the target contour is to the ideal circle.
[0100] Preferably, in the embodiments of this application, The first cell terminal is considered to be a circular terminal.
[0101] When the second cell electrode in the template image is a rectangular electrode, the contour similarity value is calculated by the ratio of the pixel area of the target contour to the pixel area of the template contour, and the ratio of the minimum to the maximum value between the aspect ratios of the target contour and the template contour. The formula is as follows:
[0102] in, Indicates the contour similarity value; The pixel area representing the target outline; The pixel area representing the template outline; Indicates the aspect ratio of the target profile; This indicates the aspect ratio of the template outline.
[0103] The value range is 0-1.0. The closer it is to 1.0, the closer the shape of the target contour is to the ideal rectangle.
[0104] Preferably, in the embodiments of this application, The first cell terminal is considered to be a rectangular terminal.
[0105] Step 202: Determine the grayscale calculation region in the first pixel image, and calculate the pixel grayscale value of the first pixel image in the grayscale calculation region.
[0106] Based on step 201, the industrial control computer 12 can also calculate the pixel grayscale value of the first pixel image to further improve the accuracy of the matching degree between the first pixel image and the template image represented by the matching score.
[0107] In some embodiments, the industrial computer 12 also determines the region of interest in the first pixel image and uses the region of interest as the grayscale calculation area. The method for determining the region of interest is the same as the method in step 201, and will not be repeated here.
[0108] In other embodiments, the industrial computer 12 can also shrink the region of interest to the same range as the matching frame to ensure that the grayscale calculation area is strictly limited to the surface area of the cell electrode post.
[0109] Calculate the standard deviation of pixel grayscale within the grayscale calculation area, and use this standard deviation as the pixel grayscale value.
[0110] When the pixel grayscale value is within the preset grayscale threshold range, it indicates that the surface grayscale of the first battery cell electrode is uniform; when the pixel grayscale value is not within the preset grayscale threshold range, it indicates that the surface grayscale of the first battery cell electrode is not uniform. Specifically, if the pixel grayscale value is less than the minimum value of the preset grayscale threshold range, it indicates that the first battery cell electrode is overexposed or reflective; if the pixel grayscale value is greater than the maximum value of the preset grayscale threshold range, it indicates that the first battery cell electrode is severely contaminated.
[0111] The preset grayscale threshold range in this embodiment is [15, 45].
[0112] Step 203: The surface similarity value, contour similarity value and pixel gray value are weighted and fused to obtain the matching score.
[0113] After calculating the contour similarity and pixel grayscale value in steps 201 and 202 respectively, the industrial control computer combines the surface similarity value obtained in step 102 and performs a weighted fusion of these three values to obtain a matching score, as shown in the following formula:
[0114] in, Indicates the matching score; , , These represent the weights of the surface similarity value, contour similarity value, and pixel grayscale value, respectively. ; This indicates normalization processing; Indicates the surface similarity value; This represents the pixel grayscale value.
[0115] Preferably, the embodiments of this application The value is 0.5; The value is 0.3; The value is 0.2.
[0116] Please refer to Figure 6 This application provides a pixel offset calculation method, which includes the following steps: Step 301: When the matching score is greater than or equal to the preset matching threshold, extract the first center pixel coordinates of the first cell electrode in the first pixel image; extract the second center pixel coordinates of the second cell electrode in the template image; and use the first difference between the first center pixel coordinates and the second center pixel coordinates as the pixel offset.
[0117] When the matching score is greater than or equal to the preset matching threshold, it means that the first pixel image meets the detection conditions of the first detection path. At this time, the pixel offset between the first cell electrode and the second cell electrode can be directly calculated.
[0118] The industrial control computer 12 extracts the first center pixel coordinates and the second center pixel coordinates from the first pixel image and the template image respectively. The first difference obtained by subtracting the second center pixel coordinates from the first center pixel coordinates is the pixel offset of this application embodiment.
[0119] Step 302: When the matching score is less than the preset matching threshold, the first pixel image is binarized to obtain the second pixel image; in the second pixel image, the third center pixel coordinates of the first cell electrode are extracted; the second difference between the third center pixel coordinates and the second center pixel coordinates is used as the pixel offset.
[0120] Taking the preset matching threshold as an example, which is calculated based on the normal polar template image, when the matching score is less than the preset matching threshold, it means that the first pixel image does not meet the detection conditions of the first detection path. At this time, the industrial control computer 12 needs to perform binarization processing on the first pixel image through the second detection path to obtain the second pixel image that can be used for calculation.
[0121] The industrial control computer 12 extracts the third center pixel coordinates and the second center pixel coordinates from the second pixel image and the template image, respectively. The second difference obtained by subtracting the second center pixel coordinates from the third center pixel coordinates is the pixel offset of this application embodiment.
[0122] In some embodiments, taking the preset matching threshold calculated based on a normal polar template image as an example, when the matching score is less than the preset matching threshold, it means that the first pixel image does not belong to the normal polar template image and the first pixel image needs to be binarized before subsequent calculations can continue. However, if the surface similarity value is greater than or equal to the preset similarity threshold, it means that the first pixel image has matched a normal polar template image in the pre-built image template library, which presents a contradiction.
[0123] The occurrence of this contradiction indicates that the preset matching threshold is set unreasonably, and therefore the preset matching threshold needs to be updated.
[0124] Please refer to Figure 7 This application provides a preset matching threshold update method. When the matching score is less than a preset matching threshold and the surface similarity value is greater than or equal to a preset similarity threshold, the preset matching threshold update method includes the following steps: Step 401: Calculate the third difference between the coordinates of the first center pixel and the coordinates of the second center pixel.
[0125] The industrial computer 12 first extracts the first center pixel coordinates of the first cell terminal and extracts the second center pixel coordinates of the second cell terminal from the template image. The third difference is obtained by subtracting the second center pixel coordinates from the first center pixel coordinates.
[0126] Step 402: When the fourth difference between the third difference and the second difference is less than or equal to the preset difference threshold, the preset matching threshold is updated according to the matching score to obtain the updated matching threshold.
[0127] Since one of the prerequisites for updating the preset matching threshold is that the matching score is less than the preset matching threshold, the industrial control computer 12 will obtain the second difference through step 302.
[0128] After the industrial control computer 12 obtains the third difference value through step 401, the third difference value is subtracted from the second difference value to obtain the fourth difference value of this application embodiment. The fourth difference value is used to characterize the degree of difference between the detection results obtained by the first detection path and the second detection path.
[0129] When the fourth difference is less than or equal to the preset difference threshold, it indicates that although the matching score is less than the preset matching threshold, the detection results obtained by the first detection path and the second detection path are similar, which means that the first cell terminal is a normal terminal. At this time, the preset matching threshold needs to be updated to obtain the updated matching threshold. In this embodiment, the preset difference threshold is 0.1, and the formula is as follows:
[0130] in, This indicates that the matching threshold has been updated; The value of the smoothing coefficient is 0.9-0.95, and preferably, in this embodiment, it is 0.92. This indicates a preset matching threshold; This indicates the matching score in this step.
[0131] When the fourth difference is greater than the preset difference threshold, it means that although the surface similarity value is greater than or equal to the preset similarity threshold, the detection results obtained by the first detection path and the second detection path are not similar. This indicates that the first cell electrode is not a normal electrode and there is no need to update the preset matching threshold. The pixel offset is still calculated through the second detection path.
[0132] Step 403: Calculate the pixel offset between the first cell terminal and the second cell terminal based on the matching score and the updated matching threshold.
[0133] After updating the preset matching threshold in step 402, the industrial control computer 12 recalculates the pixel offset between the first battery cell terminal and the second battery cell terminal based on the matching score and the updated matching threshold.
[0134] Please refer to Figure 8 The present application provides an image binarization processing method. When the matching score is less than a preset matching threshold, the image binarization processing method includes the following steps: Step 501: Perform grayscale conversion and noise reduction on the first pixel image to obtain the third pixel image.
[0135] The third pixel image in this embodiment is obtained by preprocessing the first pixel image before the second pixel image is obtained by image binarization processing by the industrial control computer 12.
[0136] Specifically, the preprocessing in this application embodiment includes grayscale conversion and noise reduction of the first pixel image. In the actual scenario of industrial visual inspection, the first pixel image in this application embodiment is usually a three-channel color image. However, the three-channel color image does not meet the input conditions for image binarization processing. Therefore, in this step, the industrial control computer 12 first performs grayscale conversion on the first pixel image to convert the first pixel image into a single-channel grayscale image.
[0137] Then, the industrial control computer 12 performs noise reduction processing on the single-channel grayscale image. Specifically, in this embodiment, the median filtering method is used to perform noise reduction processing on the single-channel grayscale image to weaken the scratches or dirt on the surface of the first cell electrode, while preserving the edge contour of the first cell electrode and the edge contour of the background in the first pixel image.
[0138] Step 502: Perform image binarization on the third pixel image to obtain the second pixel image.
[0139] The second pixel image in this embodiment is the image that participates in the pixel offset calculation.
[0140] After obtaining the third pixel image through step 501, the industrial control computer 12 can perform image binarization processing on the third pixel image. Specifically, the image binarization processing in this step adopts adaptive threshold binarization processing, which has been explained in detail above and will not be repeated here.
[0141] In some embodiments, although the second pixel image obtained after image binarization has weakened the scratches or dirt on the surface of the first cell terminal, there may still be a problem that the pixel offset calculated from the second pixel image is inaccurate due to polishing highlights, shadows or very serious scratches.
[0142] Therefore, please refer to Figure 9 Another embodiment of this application provides a pixel offset calculation method, which, after performing image binarization processing on the third pixel image to obtain the second pixel image, further includes: Step 601: Perform edge detection on the second pixel image to obtain the edge point set.
[0143] The industrial computer 12 performs edge detection on the second pixel image to extract the light and dark junction points between the first cell electrode and the background in the second pixel image, forming an edge point set.
[0144] This set of edge points characterizes the boundary location of the grayscale abrupt change between the first cell electrode and the background in the second pixel image.
[0145] Step 602: Overlay and fuse the edge point set with the second pixel image to obtain the fourth pixel image.
[0146] First, the industrial computer 12 creates a blank image, extracts the edge contour of the first cell terminal retained in step 501, and superimposes the edge contour and the edge point set obtained in step 601 into the blank image through a logical "OR" operation to form an initial fused contour map. Then, the industrial control computer 12 performs morphological closing operation on the initial fused contour map to bridge the micro-fracture caused by the surface defects of the first cell terminal. After the morphological closing operation, multiple connected regions are formed. Finally, the industrial control computer 12 extracts the connected region with the largest area after morphological closing operation, and uses the outer boundary of the connected region as a mask to perform a region filling operation, setting all pixels inside the outer boundary as foreground and all pixels outside the outer boundary as background, thereby obtaining the fourth pixel image of this application embodiment.
[0147] Step 603: In the fourth pixel image, extract the fourth center pixel coordinates of the first cell terminal; use the fifth difference between the fourth center pixel coordinates and the second center pixel coordinates as the pixel offset.
[0148] In some embodiments, the industrial computer 12 extracts all the outermost contours in the fourth pixel image again. It should be noted that the reason for this extraction is that the morphological closing operation in step 602 may introduce minor auxiliary noise or edge burrs. Therefore, in this embodiment, the industrial computer 12 exposes these minor auxiliary noise or edge burrs as independent contours by extracting all the outermost contours in the fourth pixel image so that they can be removed in subsequent filtering.
[0149] The industrial control computer 12 obtains the target profile of the first cell terminal by filtering all the outermost contours.
[0150] In some embodiments, the industrial computer 12 calculates the pixel area of all outermost contours and removes tiny noise contours whose pixel area is less than a preset lower threshold (such as 15% of the template image area).
[0151] In other embodiments, the industrial computer 12 calculates the distance between the centroid of all outermost contours and the center point of the matching box, and removes outlier contours whose distance is greater than a preset radius threshold (such as 0.4-0.6 times the normal pole diameter).
[0152] After obtaining the target contour, the target contour is fitted to a shape of the same type as the second cell electrode post using the method in step 201, and the center point of the fitted contour is used as the coordinate of the fourth center pixel.
[0153] Finally, the fifth difference obtained by subtracting the second center pixel coordinate from the fourth center pixel coordinate is used as the pixel offset in this embodiment.
[0154] Through steps 601 to 603, the embodiments of this application solve the problem that the pixel offset accuracy calculated from the second pixel image may be poor due to polishing highlights, shadows, or very severe scratches.
[0155] The cell electrode visual inspection system provided in this application embodiment can achieve... Figures 4 to 9 The various processes implemented in the embodiment of the cell electrode visual inspection method will not be described again here to avoid repetition.
[0156] This application also provides a computer device, please refer to... Figure 10 The computer device includes a processor 701 and a memory 702. The memory 702 stores a program or instruction that can run on the processor 701. When the program or instruction is executed by the processor 701, it implements each step of the above-mentioned cell electrode visual inspection method and can achieve the same technical effect. To avoid repetition, it will not be described in detail here.
[0157] It should be noted that the computer device in this application embodiment includes the mobile computer device and the non-mobile computer device described above.
[0158] The memory 702 can be used to store software programs and various data. The memory 702 may primarily include a first storage area for storing programs or instructions and a second storage area for storing data. The first storage area may store the operating system, application programs or instructions required for at least one function (such as sound playback, image playback, etc.). Furthermore, the memory 702 may include volatile memory or non-volatile memory, or both. The non-volatile memory may be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. Volatile memory can be random access memory (RAM), static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDRSDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link dynamic random access memory (SLDRAM), and direct memory bus RAM (DRRAM). The memory 702 in this embodiment includes, but is not limited to, these and any other suitable types of memory.
[0159] Processor 701 may include one or more processing units; optionally, processor 701 integrates an application processor and a modem processor, wherein the application processor mainly handles operations involving the operating system, user interface, and applications, and the modem processor mainly handles wireless communication signals, such as a baseband processor. It is understood that the aforementioned modem processor may also not be integrated into processor 701.
[0160] This application also provides a readable storage medium storing a program or instructions. When the program or instructions are executed by a processor, they implement the various processes of the above-described battery cell electrode visual inspection method embodiments and achieve the same technical effect. To avoid repetition, they will not be described again here.
[0161] This application also provides a chip, which includes a processor and a communication interface. The communication interface and the processor are coupled. The processor is used to run programs or instructions to implement the various processes of the above-described embodiment of the cell electrode visual inspection method, and can achieve the same technical effect. To avoid repetition, it will not be described again here.
[0162] It should be understood that the chip mentioned in the embodiments of this application may also be referred to as a system-on-a-chip, system chip, chip system, or system-on-a-chip, etc.
[0163] This application also provides a computer program product, which is stored in a storage medium and executed by at least one processor to implement the various processes of the above-described embodiment of the cell electrode visual inspection method, and can achieve the same technical effect. To avoid repetition, it will not be described again here.
[0164] It should be noted that, in this application, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element. Furthermore, it should be noted that the scope of the methods and apparatuses in the embodiments of this application is not limited to performing functions in the order shown or discussed, but may also include performing functions substantially simultaneously or in the reverse order, depending on the functions involved. For example, the described methods may be performed in a different order than described, and various steps may be added, omitted, or combined. Additionally, features described with reference to certain examples may be combined in other examples.
[0165] The embodiments of this application have been described above with reference to the accompanying drawings. However, this application is not limited to the specific embodiments described above. The specific embodiments described above are merely illustrative and not restrictive. Those skilled in the art can make many other forms under the guidance of this application without departing from the spirit and scope of the claims, and all of these forms are within the protection scope of this application.
Claims
1. A method for visual inspection of battery cell terminals, characterized in that, The visual inspection method for battery cell terminals includes: Obtain the first pixel image of the first cell terminal and the shooting coordinates of the first pixel image; In a pre-built electrode image template library, any template image whose surface similarity value to the first pixel image is greater than or equal to a preset similarity threshold is determined, and the template image includes a second cell electrode. Calculate the matching score between the first pixel image and the template image; The pixel offset between the first cell electrode and the second cell electrode is calculated based on the matching score and the preset matching threshold. The pixel offset is converted into a physical offset using a preset mapping matrix; The target coordinates are obtained by superimposing the physical offset with the shooting coordinates.
2. The method for visual inspection of battery cell terminals according to claim 1, characterized in that, The calculation of the matching score between the first pixel image and the template image includes: Calculate the contour similarity value between the first pixel image and the template image; A grayscale calculation region is determined in the first pixel image, and the pixel grayscale value of the first pixel image is calculated in the grayscale calculation region. The matching score is obtained by weighted fusion of the surface similarity value, the contour similarity value, and the pixel grayscale value.
3. The method for visual inspection of battery cell terminals according to claim 1 or 2, characterized in that, The step of calculating the pixel offset between the first cell electrode and the second cell electrode based on the matching score and a preset matching threshold includes: When the matching score is greater than or equal to the preset matching threshold, the first center pixel coordinates of the first cell electrode are extracted in the first pixel image; the second center pixel coordinates of the second cell electrode are extracted in the template image; and the first difference between the first center pixel coordinates and the second center pixel coordinates is used as the pixel offset. When the matching score is less than the preset matching threshold, the first pixel image is binarized to obtain the second pixel image; in the second pixel image, the third center pixel coordinate of the first cell terminal is extracted; the second difference between the third center pixel coordinate and the second center pixel coordinate is used as the pixel offset.
4. The method for visual inspection of battery cell terminals according to claim 3, characterized in that, When the matching score is less than the preset matching threshold and the surface similarity value is greater than or equal to the preset similarity threshold, the cell electrode visual detection method further includes: Calculate the third difference between the coordinates of the first center pixel and the coordinates of the second center pixel; When the fourth difference between the third difference and the second difference is less than or equal to a preset difference threshold, the preset matching threshold is updated according to the matching score to obtain an updated matching threshold; The pixel offset between the first cell terminal and the second cell terminal is calculated based on the matching score and the updated matching threshold.
5. The method for visual inspection of battery cell terminals according to claim 3, characterized in that, When the matching score is less than the preset matching threshold, the first pixel image is subjected to image binarization processing to obtain the second pixel image, including: The first pixel image is subjected to grayscale conversion and noise reduction processing to obtain the third pixel image; The third pixel image is subjected to image binarization to obtain the second pixel image.
6. The method for visual inspection of battery cell terminals according to claim 5, characterized in that, After performing image binarization processing on the third pixel image to obtain the second pixel image, the cell electrode visual detection method further includes: Edge detection is performed on the second pixel image to obtain an edge point set; The edge point set is superimposed and fused with the second pixel image to obtain the fourth pixel image; In the fourth pixel image, the fourth center pixel coordinate of the first cell terminal is extracted; the fifth difference between the fourth center pixel coordinate and the second center pixel coordinate is used as the pixel offset.
7. A visual inspection system for battery cell terminals, characterized in that, The cell electrode visual inspection system includes a PLC system, an industrial computer, and a three-axis servo system; a camera is installed at the Z-axis end of the three-axis servo system. The imaging device is communicatively connected to the industrial control computer. The imaging device is used to acquire a first pixel image of the first cell electrode and send the first pixel image to the industrial control computer. The PLC system is communicatively connected to the three-axis servo system and the industrial computer respectively. The PLC system is used to read the shooting coordinates fed back by the three-axis servo system when the shooting device shoots the first pixel image, and send the shooting coordinates to the industrial computer. The industrial control computer includes a storage module, a computing unit, and a coordinate mapping unit; The storage module is used to store a pre-built image template library; the industrial control computer is used to determine any template image in the pre-built electrode image template library whose surface similarity value with the first pixel image is greater than or equal to a preset similarity threshold, wherein the template image includes a second cell electrode. The calculation unit is used to calculate the pixel offset between the first battery cell terminal and the second battery cell terminal based on the matching score and the preset matching threshold. The coordinate mapping unit stores a preset mapping matrix, and the coordinate mapping unit is used to convert the pixel offset into a physical offset through the preset mapping matrix. The industrial control computer is used to superimpose the physical offset with the shooting coordinates to obtain the target coordinates, and then send the target coordinates to the PLC system.
8. The cell electrode visual inspection system according to claim 7, characterized in that, The computing unit includes a single-point correction module and a branch storage module; The single-point correction module is used to extract the first center pixel coordinates of the first cell electrode in the first pixel image when the matching score is greater than or equal to the preset matching threshold; extract the second center pixel coordinates of the second cell electrode in the template image; and use the first difference between the first center pixel coordinates and the second center pixel coordinates as the pixel offset. The branch storage module includes an image binarization processing unit and a geometric parameter calculation unit; The image binarization processing unit is used to perform image binarization processing on the first pixel image to obtain the second pixel image when the matching score is less than the preset matching threshold. The geometric parameter calculation unit is used to extract the third center pixel coordinates of the first cell electrode in the second pixel image; and to use the second difference between the third center pixel coordinates and the second center pixel coordinates as the pixel offset.
9. A visual inspection device for battery cell terminals, the device comprising a processor and a memory, wherein the memory stores a computer program, characterized in that, The computer program is loaded and executed by the processor to implement the cell electrode visual inspection method as described in any one of claims 1 to 6.
10. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by the processor, it is used to implement the cell electrode visual inspection method as described in any one of claims 1 to 6.
