Image processing method and apparatus, cell defect detection method and apparatus, and device
By performing nonlinear stretching on the cell area image, using exponential function and stretching parameters, the problem of poor imaging effect of cell image is solved, and the accuracy of defect detection and imaging quality are improved.
Patent Information
- Application Number
- PCT/CN2024/129999
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2024-03-01
- Filing Date
- 2024-11-05
- Publication Date
- 2025-09-04
AI Technical Summary
In the prior art, the battery cell image imaging effect is poor, resulting in poor defect detection effect.
The nonlinear stretching formula constructed by an exponential function is used to process the image of the battery cell area. By including the contrast stretching coefficient and pixel enhancement coefficient, the contrast and grayscale interval of the battery cell area image is improved to highlight the details.
Improves the accuracy and imaging effect of cell defect detection, providing a clearer image for subsequent detection.
Smart Images

Figure CN2024129999_04092025_PF_FP_ABST
Abstract
Description
Image processing method, battery cell defect detection method, device and equipment
[0001] CROSS-REFERENCE TO RELATED APPLICATIONS
[0002] This application claims priority to Chinese patent application CN202410233964.4, filed on March 1, 2024, entitled “Image processing method, battery cell defect detection method, device and equipment,” and the entire contents of that application are incorporated herein by reference. Technical Field
[0003] The present application relates to the field of image processing technology, and more specifically, to an image processing method, a battery cell defect detection method, a device, and equipment. Background Art
[0004] With the widespread use of lithium-ion polymer battery products, the safety of each battery component has received increasing attention. The battery cell is the energy storage part of a rechargeable battery, and its quality directly determines the quality of the battery. Therefore, it is particularly important to conduct quality inspections on the battery cells to determine if there are any defects.
[0005] The current related technology directly captures images of the battery cells and then performs defect detection based on the captured images. However, the imaging of the images is affected by many interference factors, resulting in poor imaging effects, which in turn leads to poor detection effects.
[0006] Summary of the Invention
[0007] The purpose of the embodiments of the present application is to provide an image processing method, a battery cell defect detection method, a device and an apparatus to improve the problem of poor imaging effect and poor detection effect caused by existing methods.
[0008] In a first aspect, an embodiment of the present application provides an image processing method, the method comprising:
[0009] Acquire a cell image of the battery cell;
[0010] Extracting a cell region image containing the cell from the cell image;
[0011] The cell area image is subjected to nonlinear stretching processing using a nonlinear stretching formula constructed using an exponential function to obtain a stretched image, wherein the nonlinear stretching formula is constructed based on stretching parameters, and the stretching parameters include a contrast stretching coefficient and / or a pixel enhancement coefficient, and the contrast stretching coefficient and the pixel enhancement coefficient are determined based on the pixel variance value of the cell area image.
[0012] In the above implementation process, a stretched image is obtained by performing nonlinear stretching processing on the cell region image of the battery cell. In this way, nonlinear stretching processing can be performed on the pixels in the area where the battery cell is located in a targeted manner. After processing, the contrast between the various layers of the anode and cathode of the battery cell in the cell region image can be improved, thereby improving the imaging effect. In addition, the nonlinear stretching formula uses an exponential function, which can expand the grayscale interval in the cell region image, highlight the detailed features, and improve the stretching effect. In addition, a higher-definition image can be provided for subsequent defect detection of the battery cell, thereby improving the accuracy of cell defect detection. In addition, the stretching parameters include a contrast stretching coefficient, which can further enhance the contrast of the cell region image, and the stretching parameters include a pixel enhancement coefficient, which can further highlight the contrast in the cell region image and improve the stretching effect.
[0013] Optionally, performing nonlinear stretching processing on the cell region image using a nonlinear stretching formula constructed using an exponential function to obtain a stretched image includes:
[0014] Obtaining the maximum pixel value, the minimum pixel value, and the stretching parameter in the cell area image;
[0015] According to the maximum pixel value, the minimum pixel value and the stretching parameter, a nonlinear stretching formula constructed using an exponential function is used to calculate the pixel value of each pixel point after nonlinear stretching of the cell area image to obtain a stretched image.
[0016] In the above implementation process, the pixel value of each pixel after nonlinear stretching is calculated by using the pixel maximum value, pixel minimum value and stretching parameters, which can enhance the contrast of the cell area image and improve the stretching effect.
[0017] Optionally, the stretching parameters are obtained by:
[0018] Obtaining pixel variance values in the cell area image;
[0019] The contrast stretching coefficient and / or the pixel enhancement coefficient are determined according to the pixel variance value and a preset variance threshold.
[0020] In the above implementation process, since the pixel variance value of the battery cell area image can reflect the distribution of image pixels, the contrast stretching coefficient and / or pixel enhancement coefficient is determined based on the pixel variance value, so as to know to what extent the battery cell area image needs to be stretched to adapt to its pixel distribution, thereby improving the overall stretching effect of the image.
[0021] Optionally, if the stretching parameters include a contrast stretching coefficient and a pixel enhancement coefficient, the nonlinear stretching formula constructed using an exponential function is expressed as follows:
[0022] Wherein, f(x, y) represents the pixel value of the pixel after nonlinear stretching, G represents the pixel value of the pixel in the cell area image, δ represents the contrast stretching coefficient, τ represents the pixel enhancement coefficient, G min Indicates the minimum value of the pixel, G max Indicates the maximum value of the pixel.
[0023] In the above implementation process, the nonlinear stretching formula uses exponential stretching, which can expand the grayscale interval in the cell area image, highlight the detail features, and thus improve the stretching effect.
[0024] Optionally, obtaining the maximum pixel value, the minimum pixel value, and the stretching parameter in the cell area image includes:
[0025] Determine the convolution window size;
[0026] Traversing the cell area image according to the convolution window size, obtaining the maximum pixel value, the minimum pixel value, and the stretching parameter of the image area corresponding to the convolution window;
[0027] The step of calculating the pixel value of each pixel point after nonlinear stretching of the cell area image using a nonlinear stretching formula constructed by an exponential function according to the maximum pixel value, the minimum pixel value, and the stretching parameter to obtain a stretched image includes:
[0028] According to the maximum pixel value of the corresponding image area, the minimum pixel value and the stretching parameter, a nonlinear stretching formula constructed using an exponential function is used to calculate the pixel value of the corresponding pixel point in the corresponding image area after nonlinear stretching of the battery cell area image, until the pixel value of each pixel point after nonlinear stretching is obtained to obtain a stretched image.
[0029] In the above implementation process, the cell area image is divided into regions according to the convolution window size, so that the features between the layers of the cell can be better highlighted during nonlinear stretching, thereby improving the stretching effect.
[0030] Optionally, determining the convolution window size includes:
[0031] Obtaining the thickness of the cathode and anode electrodes of the battery cell;
[0032] The convolution window size is determined according to the thickness.
[0033] In the above implementation process, a more appropriate convolution window size can be determined according to the thickness of the anode and cathode electrodes, which can make a more reasonable division of the battery cell area, so that the detailed features can be better captured during nonlinear stretching, thereby improving the effect of subsequent battery cell defect detection.
[0034] Optionally, extracting a cell region image containing the cell from the cell image includes:
[0035] Performing histogram statistics on the battery cell image to determine an image segmentation threshold;
[0036] A cell region image including the cell is segmented from the cell image using the image segmentation threshold.
[0037] In this implementation, the cell region image is extracted from the cell image. This filters out the non-cell regions within the cell image, effectively reducing the computational effort required for subsequent nonlinear stretching and minimizing the interference of background information on subsequent defect detection. Furthermore, because histogram statistics involve grayscale values, complex calculations and processing for each pixel are unnecessary, resulting in a low computational cost and rapid image segmentation.
[0038] Optionally, performing nonlinear stretching processing on the cell region image using a nonlinear stretching formula constructed using an exponential function to obtain a stretched image includes:
[0039] If the pixel value of the corresponding pixel point in the cell region image is less than or equal to the stretching threshold, the cell region image is subjected to nonlinear stretching processing using a nonlinear stretching formula constructed using an exponential function to obtain a stretched image.
[0040] In the above implementation process, since the area for defect detection is generally the cell pixel area, the nonlinear stretching process is only performed on the cell pixel area in the cell area image, which can improve the stretching process efficiency.
[0041] Optionally, the cell region image is an image obtained based on X-ray photography. Due to the strong penetrating power of X-rays, it is easy to obtain the features between the layers of the cell, and then more defects can be detected later.
[0042] Optionally, after extracting the cell region image containing the cell from the cell image, and performing nonlinear stretching processing on the cell region image using the nonlinear stretching formula constructed by the exponential function, before obtaining the stretched image, the method further includes:
[0043] Performing logarithmic transformation on the battery cell region image to obtain a transformed battery cell region image.
[0044] In the above implementation process, based on the variation law of ray intensity, the density of the battery cells is wirelessly acquired by performing logarithmic transformation on the battery cell area image. This can amplify the influence of the battery cell thickness on the pixel value of each pixel point, and further help to perform nonlinear stretching on the battery cell area image, so as to more clearly define the thickness distribution of the battery cells and improve the detection effect of battery cell defects.
[0045] In a second aspect, an embodiment of the present application provides a method for detecting defects in a battery cell, the method comprising:
[0046] Acquire a stretched image, where the stretched image is obtained according to the method provided in the first aspect above;
[0047] Defect detection is performed on the battery cell according to the stretched image.
[0048] In the above implementation process, after the nonlinear stretching processing of the cell area image is performed by the above method, a stretched image with stronger contrast can be obtained, which can further highlight the detail features in the image, thereby improving the accuracy of cell defect detection.
[0049] In a third aspect, an embodiment of the present application provides an image processing device, comprising:
[0050] A cell image acquisition module, used to acquire a cell image of a cell;
[0051] A region image acquisition module, configured to extract a cell region image containing the cell from the cell image;
[0052] An image processing module is used to perform nonlinear stretching processing on the battery cell area image using a nonlinear stretching formula constructed using an exponential function to obtain a stretched image, wherein the nonlinear stretching formula is constructed based on stretching parameters, and the stretching parameters include a contrast stretching coefficient and / or a pixel enhancement coefficient, and the contrast stretching coefficient and the pixel enhancement coefficient are determined based on the pixel variance value of the battery cell area image.
[0053] In a fourth aspect, an embodiment of the present application provides a battery cell defect detection device, the device comprising:
[0054] a stretched image acquisition module, configured to acquire a stretched image, wherein the stretched image is obtained according to the method provided in the first aspect;
[0055] A defect detection module is used to perform defect detection on the battery cell according to the stretched image.
[0056] In a fifth aspect, an embodiment of the present application provides an electronic device comprising a processor and a memory, wherein the memory stores computer-readable instructions. When the computer-readable instructions are executed by the processor, the steps in the method provided in the first aspect above are executed.
[0057] In a sixth aspect, an embodiment of the present application provides a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the steps in the method provided in the first aspect above are executed.
[0058] In a seventh aspect, an embodiment of the present application provides a computer program product, comprising computer program instructions, which, when read and executed by a processor, execute the steps of the method provided in the first aspect above.
[0059] Other features and advantages of the present application will be described in the following description and, in part, will become apparent from the description or be understood by practicing the embodiments of the present application. The objectives and other advantages of the present application can be achieved and obtained through the structures particularly pointed out in the written description, claims, and drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0060] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the following is a brief introduction to the drawings required for use in the embodiments of the present application. It should be understood that the following drawings only show certain embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other relevant drawings can be obtained based on these drawings without creative work.
[0061] FIG1 is a flow chart of an image processing method provided in an embodiment of the present application;
[0062] FIG2 is a schematic diagram of dividing an image region based on a convolution window size according to an embodiment of the present application;
[0063] FIG3 is a schematic diagram of an original X-ray image provided in an embodiment of the present application;
[0064] FIG4 is a schematic diagram of an image after logarithmic transformation provided in an embodiment of the present application;
[0065] FIG5 is a schematic diagram of an image after nonlinear stretching provided in an embodiment of the present application;
[0066] FIG6 is a flow chart of a method for detecting battery cell defects provided in an embodiment of the present application;
[0067] FIG7 is a schematic diagram of a process of producing a battery cell according to an embodiment of the present application;
[0068] FIG8 is a schematic diagram of an image processing process provided by an embodiment of the present application;
[0069] FIG9 is a structural block diagram of an image processing device provided in an embodiment of the present application;
[0070] FIG10 is a structural block diagram of a battery cell defect detection device provided in an embodiment of the present application;
[0071] FIG11 is a schematic structural diagram of an electronic device for executing an image processing method or a battery cell defect detection method provided in an embodiment of the present application. DETAILED DESCRIPTION
[0072] The technical solutions in the embodiments of the present application will be described clearly and completely below in conjunction with the accompanying drawings in the embodiments of the present application.
[0073] It should be noted that the terms "system" and "network" in the embodiments of the present invention are used interchangeably. "Multiple" refers to two or more. In view of this, in the embodiments of the present invention, "multiple" can also be understood as "at least two." "And / or" describes the association relationship between associated objects, indicating that three relationships can exist. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / ", unless otherwise specified, generally indicates that the related objects are in an "or" relationship.
[0074] Currently, defect detection is performed directly using collected battery cell images. However, the imaging of the collected battery cell images is affected by many interference factors, resulting in poor imaging effects, and further resulting in poor battery cell defect detection effects.
[0075] In order to solve the above problems, an embodiment of the present application provides an image processing method, which obtains a stretched image by performing nonlinear stretching processing on the cell area image of the battery cell. The nonlinear stretching processing can be performed on the pixels in the area where the battery cell is located in a targeted manner. After processing, the contrast between the various layers of the anode and cathode of the battery cell in the cell area image can be improved, thereby improving the imaging effect. The nonlinear stretching formula adopts an exponential function, which can expand the grayscale interval in the cell area image, highlight the detail features, and improve the stretching effect, thereby providing a clearer image for subsequent defect detection of the battery cell, thereby improving the accuracy of defect detection.
[0076] Please refer to FIG1 , which is a flowchart of an image processing method provided in an embodiment of the present application. The method includes the following steps:
[0077] Step S110: Acquire a cell image of the battery cell.
[0078] The battery cell image may be understood as an image obtained by photographing the battery cell, such as an infrared image, an X-ray image, an ultrasonic image, and the like.
[0079] In some embodiments, if it is an X-ray image, then the battery cell image here is an image obtained based on X-ray photography. For example, the formed battery cell can be placed in an X-ray device for photography to obtain the battery cell image.
[0080] Step S120: extracting a cell region image including the cell from the cell image.
[0081] Since a lot of background information may exist in the battery cell image obtained by direct shooting, in order to reduce interference with battery cell defect detection, a battery cell area image where the battery cell area is located can be extracted from the battery cell image.
[0082] When detecting the cell area, a corresponding detection algorithm, such as a neural network model, can be used to detect the cells in the cell image. The cell area image containing the cells can then be segmented from the cell image. This removes the non-cell background area in the cell image, reducing the computational complexity of subsequent stretching. Furthermore, when performing subsequent cell defect detection, it reduces the interference of other background information on the detection results, thereby improving accuracy. Furthermore, when performing subsequent nonlinear stretching, only the cell area image is nonlinearly stretched, which reduces the impact of stretching other non-cell areas on the pixel stretching effect of the cell area. This can enhance the stretching effect of the cell area image and provide powerful assistance for subsequent cell defect detection.
[0083] Step S130: performing nonlinear stretching processing on the cell region image using a nonlinear stretching formula constructed using an exponential function to obtain a stretched image.
[0084] Understandably, if the cell image is an X-ray image, due to the imaging principle and environmental influences of X-ray images, the overall image contrast is low and the noise is excessive, which can lead to the loss of object details. Consequently, the accuracy of cell defect detection using the obtained image is low. Therefore, in order to enhance the contrast of the cell region image, this solution performs nonlinear stretching on the cell region image.
[0085] Of course, other images, such as infrared images and ultrasonic images, may also have low image contrast due to the influence of their shooting environment. Therefore, in this case, the image processing method in this scheme can also be used to perform nonlinear stretching processing on the obtained battery cell area image.
[0086] Nonlinear stretching is primarily used to alter the grayscale distribution within an image to improve visual quality or contrast. Nonlinear stretching employs a uniform nonlinear transformation function within the corresponding grayscale value range, leveraging the mathematical properties of the function to expand and compress the grayscale value ranges.
[0087] Nonlinear stretching can employ various nonlinear functions, such as exponential, logarithmic, Gaussian, and square root. These functions can expand or contract grayscale intervals, highlighting or de-emphasizing image details to improve image quality. For example, an exponential function can expand the grayscale intervals in dark areas of an image, highlighting those details. A logarithmic function, on the other hand, stretches bright areas while compressing dark areas.
[0088] In the present application, in order to accurately detect defects at the cathode end of the battery cell, it is necessary to highlight the detailed features between the layers of the anode and cathode of the battery cell in the battery cell area image. Therefore, in this solution, a nonlinear stretching formula constructed by an exponential function can be used to perform nonlinear stretching processing on the battery cell area image to highlight the detailed features between the layers, and then the battery cell can be accurately detected based on the detailed features.
[0089] Among them, the nonlinear stretching formula adopted in this scheme is constructed based on the stretching parameters, which include contrast stretching coefficients and / or pixel enhancement coefficients. The contrast stretching coefficients and pixel enhancement coefficients are determined based on the pixel variance value of the cell area image. It can be understood that the contrast stretching coefficient can be used to enhance the contrast of the image, and the pixel enhancement coefficient can enhance the image pixels. Since the pixel variance value of the cell area image can reflect the distribution of image pixels, by determining the contrast stretching coefficient and / or pixel enhancement coefficient based on the pixel variance value, it can be known to what extent the cell area image needs to be stretched to adapt to its pixel distribution, thereby improving the overall stretching effect of the image.
[0090] In the above implementation process, a stretched image is obtained by performing nonlinear stretching processing on the cell region image of the battery cell. In this way, nonlinear stretching processing can be performed on the pixels in the area where the battery cell is located in a targeted manner. After processing, the contrast between the various layers of the anode and cathode of the battery cell in the cell region image can be improved, thereby improving the imaging effect. In addition, the nonlinear stretching formula uses an exponential function, which can expand the grayscale interval in the cell region image, highlight the detailed features, and improve the stretching effect. In addition, a higher-definition image can be provided for subsequent defect detection of the battery cell, thereby improving the accuracy of cell defect detection. In addition, the stretching parameters include a contrast stretching coefficient, which can further enhance the contrast of the cell region image, and the stretching parameters include a pixel enhancement coefficient, which can further highlight the contrast in the cell region image and improve the stretching effect.
[0091] Based on the above embodiment, in the method of performing nonlinear stretching processing on the battery area image, the maximum pixel value, minimum pixel value and stretching parameters in the battery area image can be obtained first, and then the pixel value of each pixel point after the battery area image is nonlinearly stretched can be calculated using a nonlinear stretching formula constructed by an exponential function based on the maximum pixel value, minimum pixel value and stretching parameters to obtain a stretched image.
[0092] The maximum pixel value may refer to the maximum value among all pixel values in the cell region image, and the minimum pixel value may refer to the minimum value among all pixel values in the cell region image. The stretching parameter refers to a parameter used for stretching processing. The stretching parameter in this embodiment may include a contrast stretching coefficient and / or a pixel enhancement coefficient.
[0093] In some other embodiments, the stretching parameter may be a constant, and its value may be set based on experience. In this approach, a nonlinear stretching formula constructed using an exponential function is used to calculate the pixel value of each pixel after nonlinear stretching. Specifically, the nonlinear stretching formula constructed using the exponential function may be as follows:
[0094] Where f(x,y) represents the pixel value of the pixel after nonlinear stretching, G represents the pixel value of the pixel in the cell area image, a represents the stretching parameter, which can be a constant, G min Indicates the minimum pixel value, G max Indicates the maximum value of a pixel.
[0095] In this way, for each pixel point in the cell area image, the pixel value of each pixel point can be substituted into the above formula to calculate the pixel value after nonlinear stretching corresponding to each pixel point, and finally obtain the stretched image.
[0096] It is understandable that the above nonlinear stretching formula is only an example. In practical applications, the nonlinear stretching formula composed of corresponding exponential functions can be flexibly set. For example, the basic exponential stretching function can be used: f(x, y) = G x , where f(x,y) represents the pixel value after nonlinear stretching, G can refer to the pixel value of the pixel in the image, and x can be obtained based on the stretching parameter, which can be used to control the degree of stretching of the pixel. Another example: exponential stretching function: f(x,y) = a·e x , where f(x,y) represents the pixel value after nonlinear stretching, a represents the pixel value of the pixel in the image, and x is obtained according to the stretching parameter. Another example: compound exponential stretching function: f(x,y) = a·(e bx +c) d, where f(x,y) represents the pixel value of the pixel after nonlinear stretching, a can represent the pixel value of the pixel in the image, x can be obtained according to the stretching parameters, and b, c, and d can be constants.
[0097] In the above implementation process, the pixel value of each pixel after nonlinear stretching is calculated by using the pixel maximum value, pixel minimum value and stretching parameters, which can enhance the contrast of the cell area image and improve the stretching effect.
[0098] Based on the above embodiment, if the battery cell area image is an image obtained by X-ray photography, then the pixels of the obtained battery cell area image are 16 bits, that is, the grayscale value of the pixel is 0-65535, the grayscale level of the grayscale image is relatively large, and the distribution of the pixel value is relatively concentrated, which leads to too low utilization of the grayscale level, resulting in very low contrast of the image and a very poor sensory experience for the human eye. Therefore, the original data can be nonlinearly stretched and adjusted to increase the contrast of the image to adapt to human eye observation.
[0099] The aforementioned processing using the maximum and minimum pixel values is equivalent to normalizing the pixel values. To enhance the stretching effect, the aforementioned stretching parameters may include a contrast stretching coefficient and / or a pixel enhancement coefficient. The contrast stretching coefficient may stretch the pixel values to a range of 0-65535. Alternatively, since the pixel value range of a display is 0-255, i.e., an 8-bit image, the contrast stretching coefficient may also be used to stretch the pixel values to a range of 0-255. This approach can reduce computational complexity and facilitate subsequent image processing and display.
[0100] When the stretching parameters include a contrast stretching coefficient, in the above method of calculating the pixel value of the pixel point after nonlinear stretching, the above a can represent the contrast stretching coefficient, and its value can be 65535 or 255. Of course, in practical applications, the value of the contrast stretching coefficient can be flexibly set according to the value range of the pixel, or the value of the contrast stretching coefficient can be set according to the actual stretching requirements. That is to say, the contrast stretching coefficient can also take other values, such as 254, 65534, 250 and other values.
[0101] In other implementation methods of obtaining stretching parameters, the pixel variance value in the battery cell area image can be obtained first, and then the contrast stretching coefficient and / or pixel enhancement coefficient can be determined based on the pixel variance value and the preset variance threshold. Then, the pixel value of each pixel point after nonlinear stretching of the battery cell area image can be calculated using a nonlinear stretching formula constructed by an exponential function based on the pixel maximum value, pixel minimum value, and the contrast stretching coefficient and / or pixel enhancement coefficient.
[0102] The pixel variance value here can be the variance calculated for the pixel values of each pixel point in the cell area image. The pixel variance value can be used to evaluate the difference between the pixel value of each pixel point and the expected pixel value. In other words, the pixel variance value can reflect the pixel fluctuation of each pixel point. In the cell area image, the pixels in the electrode area of the cell have larger fluctuations, while the pixels in the non-electrode area have smaller fluctuations. Therefore, the contrast stretching coefficient and / or pixel enhancement coefficient can be determined based on the pixel variance value and a preset variance threshold.
[0103] Among them, the preset variance threshold can be set according to the actual situation, or the preset variance threshold can be obtained in advance through experiments, such as collecting different battery cell area images during the experiment, and then detecting the pixel variance value when the battery cell's electrode area is clearer. The pixel variance value at this time can be used as the preset variance threshold. The inventor of the present application found through a large number of experiments that in the clearer battery cell area images, the pixel variance value of the battery cell's electrode area is around 15, so the preset variance threshold can be set to 15. Of course, the preset variance threshold can be flexibly determined according to the actual situation, such as 14, 16, etc., or it can be determined according to the actual desired effect.
[0104] Thus, when determining the contrast stretch coefficient, if the preset variance threshold is 15 and the pixel variance value is greater than or equal to 15, the contrast stretch coefficient can be set to 65535 or another value, indicating that nonlinear stretching is to be performed. If the pixel variance value is less than 15, the contrast stretch coefficient can be set to 0, indicating that nonlinear stretching is not to be performed. Of course, in practical applications, a smaller value can also be used as required, such as when the pixel variance value is less than 15, the contrast stretch coefficient can be set to 1 or 2. In other words, the contrast stretch coefficient can be determined based on the pixel variance value and the preset variance threshold. Depending on the difference between the pixel variance value and the preset variance threshold, the corresponding contrast stretch coefficient can take different values. This can be used to set the contrast stretch coefficient value for different differences between the pixel variance value and the preset variance threshold according to actual requirements. For example, when the pixel variance value is greater than or equal to the preset variance threshold, the contrast stretch coefficient takes a value of x, and when the pixel variance value is less than the preset variance threshold, the contrast stretch coefficient takes a value of y. Here, x and y can be flexibly set according to actual requirements.
[0105] In some embodiments, the pixel variance value here may refer to the pixel variance value of a certain area. For example, the battery cell area image may be divided into multiple image areas, and then the pixel variance value of each image area is calculated. In this way, based on the pixel variance value, it can be known whether the image area is the electrode area of the battery cell. Then, a corresponding contrast stretch coefficient can be determined for each image area. For example, if the pixel variance value of image area 1 is greater than a preset variance threshold, then the contrast stretch coefficient of image area 1 is a1. For each pixel point in image area 1, its pixel value can be substituted into the above-mentioned nonlinear stretching formula for calculation, and the pixel value of each pixel point in image area 1 after nonlinear stretching can be obtained. If the pixel variance value of image area 2 is less than the preset variance threshold, then the contrast stretch coefficient of image area 2 is a2. At this time, for image area 2, its pixel value can also be substituted into the above-mentioned nonlinear stretching formula for calculation, and the pixel value of each pixel point in image area 2 after nonlinear stretching can be obtained.
[0106] It can be understood that the pixel maximum value and pixel minimum value here can also refer to the pixel maximum value and pixel minimum value of the image area. For example, when calculating the pixel value of the pixel point in image area 1 after nonlinear stretching, the pixel maximum value and pixel minimum value substituted into the above nonlinear stretching formula refer to the pixel maximum value and pixel minimum value corresponding to the image area 1.
[0107] In order to enhance the brightness and contrast of the image after nonlinear stretching, the above stretching parameters may further include a pixel enhancement coefficient.
[0108] The method of determining the pixel enhancement coefficient here is similar to the method of determining the contrast stretching coefficient mentioned above. For example, when the pixel variance value is greater than or equal to the preset variance threshold, the pixel enhancement coefficient can be taken as j. When the pixel variance value is less than the preset variance threshold, the pixel enhancement coefficient can be taken as k. It can be understood that in different cases where the pixel variance value is compared with the preset variance threshold, the corresponding pixel enhancement coefficient can take different values. This can be set according to actual needs. The value of the pixel enhancement coefficient in different cases where the pixel variance value is compared with the preset variance threshold. For example, when the pixel variance value is greater than or equal to the preset variance threshold, the pixel enhancement coefficient is j. When the pixel variance value is less than the preset variance threshold, the pixel enhancement coefficient is k. Here, j and k can be flexibly set according to actual needs.
[0109] For example, j can be 20 and k can be 0. The pixel enhancement coefficient is set to 20 because the inventors of this solution found through extensive experiments that this value has a better image enhancement effect. Of course, in actual applications, other values can be used as needed, such as 18 or 21. Here, when the pixel variance value is less than the preset variance threshold, it indicates that no stretching is required, and naturally no enhancement is required. The pixel enhancement coefficient is then set to 0. Of course, in actual applications, a smaller value, such as 1 or 2, can also be used as needed.
[0110] If the nonlinear stretching formula constructed using the exponential function is constructed based on the above-mentioned contrast stretching coefficient and pixel enhancement coefficient, the nonlinear stretching formula constructed using the exponential function can be as follows:
[0111] Among them, f(x,y) represents the pixel value of the pixel after nonlinear stretching, G represents the pixel value of the pixel in the cell area image, δ represents the contrast stretching coefficient, τ represents the pixel enhancement coefficient, G min Indicates the minimum pixel value, G max Indicates the maximum value of a pixel.
[0112] As an example, the values of the contrast stretching coefficient δ and the pixel enhancement coefficient τ can be as follows: Among them, f std represents the pixel variance value, and the preset variance threshold is 15. It can be understood that the values of the contrast stretching coefficient and the pixel enhancement coefficient here are only examples. In actual situations, the values can be flexibly determined according to the needs based on the comparison between the pixel variance value and the preset variance threshold. For example, when the pixel variance value is less than the preset variance threshold, the values of the contrast stretching coefficient and the pixel enhancement coefficient can be 1. Other values can also be flexibly set according to actual needs.
[0113] In some other embodiments, the contrast stretch coefficient δ and the pixel enhancement coefficient τ may also be obtained based on other formulas, such as a continuous function between the pixel variance value and the stretch coefficient, such as a=f(b), where a represents the stretch parameter, b represents the pixel variance value, and f may be a linear function, such as a sigmoid function. The sigmoid function has a range of 0-1, and 20sigmoid(x) can map x to a number between 0-20, thereby obtaining the corresponding stretch parameter based on the pixel variance value. Different continuous functions between the pixel variance value and the coefficient may also be set for the contrast stretch coefficient and the pixel enhancement coefficient.
[0114] In addition to the continuous functions listed above, a polynomial function can also be used to obtain the stretching coefficient, such as: f(x) = ax + b, where x represents the pixel variance value, and a and b can be constants. In this way, the pixel variance value can be mapped to the stretching parameter, and different values of a and b can be set for the contrast stretching coefficient and pixel enhancement coefficient in this way.
[0115] It can be understood that if there is no contrast stretching coefficient, that is, the stretching parameters only include the pixel enhancement coefficient, δ here can be replaced by a in the above nonlinear stretching formula, that is, it can be a constant. In this case, the nonlinear stretching formula can be expressed as follows:
[0116] Among them, f(x,y) represents the pixel value of the pixel after nonlinear stretching, G represents the pixel value of the pixel in the cell area image, a represents a constant, and the specific value can be flexibly set according to actual needs, τ represents the pixel enhancement coefficient, G min Indicates the minimum pixel value, G max Indicates the maximum value of a pixel.
[0117] In this method, the cell area image can also be divided into regions according to the above method, and then for each image area, the corresponding pixel variance value, contrast stretching coefficient, pixel enhancement coefficient, pixel maximum value and pixel minimum value are determined, and then the pixel value of each pixel point in the image area after nonlinear stretching is calculated according to the above formula.
[0118] It should be noted that the above-mentioned method of dividing the cell region image into regions can be flexibly set according to actual conditions. For example, the cell region can be divided into blocks according to set sizes, or the regions can be divided randomly.
[0119] In the above implementation, the stretching parameters include a contrast stretching coefficient, which further enhances the contrast of the cell region image and improves the stretching effect. The stretching parameters also include a pixel enhancement coefficient, which further emphasizes the contrast in the cell region image and improves the stretching effect. The nonlinear stretching formula uses exponential stretching, which expands the grayscale intervals in the cell region image, highlighting detailed features and further improving the stretching effect.
[0120] On the basis of the above embodiment, because there is interference between the levels of the battery cells, in order to highlight the features between the levels of the battery cells, when the battery cell area image is divided into regions, a convolution window method can also be used for division. For example, the convolution window size can be determined first, and then the battery cell area image is traversed according to the convolution window size to obtain the maximum pixel value, minimum pixel value and stretching parameter of the image area corresponding to the convolution window. When obtaining the stretched image, the pixel value of the corresponding pixel point in the corresponding image area after nonlinear stretching of the battery cell area image can be calculated using a nonlinear stretching formula constructed by an exponential function according to the maximum pixel value, minimum pixel value and stretching parameter of the corresponding image area, until the pixel value of each pixel point after nonlinear stretching is obtained to obtain a stretched image.
[0121] The convolution window size can be flexibly set according to actual needs. For example, the convolution window size is 1x3 and the step size is 1. As shown in Figure 2, the image region 1 corresponding to the first convolution window includes 3 pixels. At this time, the maximum pixel value, minimum pixel value, and stretching parameter corresponding to the image region 1 can be first obtained. The method for obtaining the stretching parameter can refer to the relevant description in the above embodiment. Then, the maximum pixel value, minimum pixel value, stretching parameter, and the pixel value of the first pixel can be substituted into the above nonlinear stretching formula to calculate the pixel value of the first pixel after nonlinear stretching. The convolution window is then moved backward by one step size, and the image region 2 corresponding to the second convolution window is obtained. The pixel value of the first pixel (i.e., the second pixel) in the image region 2 after nonlinear stretching can be calculated in the same manner. Therefore, the pixel values of all pixels after nonlinear stretching can be obtained in the same manner, and finally a stretched image is obtained.
[0122] It should be noted that if the convolution window is at the edge, the area can be divided by padding pixels. For example, in image area 4 in Figure 2, a pixel 0 can be padded here, and the minimum pixel value in image area 4 is 0. The subsequent calculation process is the same as the above method. Alternatively, when the convolution window is at the edge, it can be moved forward so that the convolution window can contain the corresponding number of pixels. For example, image area 4 can also be another area shown in Figure 2, and then the calculation process can be performed in the same way for image area 4.
[0123] It should also be noted that the moving step of the convolution window can also be set according to actual needs, so that the number of pixels calculated in each image area is related to the size of the convolution window and the moving step. For example, if the convolution window size is 1*3 and the step size is 2, then the number of calculated pixels in each image area is 2, that is, the first pixel and the second pixel at the starting position of the image area. For example, if the convolution window size is 2*2 and the step size is 2, then the number of calculated pixels in each image area is 4, that is, all the pixels in the image area. Therefore, the corresponding pixel points of the image area mentioned above do not only refer to the first pixel point, but can be understood as the pixel points determined by the window size and the moving step size.
[0124] In the above implementation process, the cell area image is divided into regions according to the convolution window size, so that the features between the layers of the cell can be better highlighted during nonlinear stretching, thereby improving the stretching effect.
[0125] On the basis of the above embodiment, in order to improve the stretching effect, in the above method of determining the convolution window size, the thickness of the anode and cathode electrodes of the battery cell can also be obtained, and then the convolution window size can be determined based on the thickness.
[0126] Here, the correspondence between thickness and convolution window size can be obtained in advance through a large number of experiments. For example, when determining which thickness corresponds to which convolution window size through a large number of experiments, the effect of the stretched image obtained in the above manner can be used to determine it, and then the determined correspondence between the thickness and the convolution window size can be stored in the image processing device. Then, when determining the convolution window size, the correspondence can be found by obtaining the thickness of the anode and cathode electrodes of the current battery cell, and then the corresponding convolution window size can be obtained.
[0127] In the above implementation process, a more appropriate convolution window size can be determined according to the thickness of the anode and cathode electrodes, which can make a more reasonable division of the battery cell area, so that the detailed features can be better captured during nonlinear stretching, thereby improving the effect of subsequent battery cell defect detection.
[0128] On the basis of the above embodiment, in the method of extracting the cell area image containing the cell in the cell image, it is also possible to perform histogram statistics on the cell image, determine the image segmentation threshold, and then use the image segmentation threshold to segment the cell area image containing the cell from the cell image.
[0129] By performing histogram analysis on a cell image, the distribution of grayscale values within the cell image can be intuitively visualized. For example, the number of pixels at each grayscale level in the cell image is counted to form a histogram. The grayscale levels with the highest number of pixels in the histogram are then found. The pixel regions corresponding to these grayscale levels can be considered the cell regions within the image. The cell regions can be determined by obtaining the peaks or valleys in the histogram. Based on the peak positions, an appropriate threshold, known as the image segmentation threshold, is then selected to segment the cell image into different regions. For example, based on the principle of X-ray image acquisition, the pixel values of the cell region in an X-ray image should be relatively low, while the pixel values of the non-cell region should be relatively high. Therefore, when segmenting the cell region image, pixel values within the cell image that are less than or equal to the image segmentation threshold are considered to be cell regions, while pixel values greater than the image segmentation threshold are considered to be non-cell regions. This allows the cell region image containing the cell to be segmented from the cell image.
[0130] In the above implementation process, since the histogram statistics involve the statistics of grayscale values, there is no need to perform complex calculations and processing on each pixel, so the calculation cost is relatively low and fast image segmentation can be achieved.
[0131] On the basis of the above embodiment, since the segmented battery cell area image may still contain a small amount of background information, when the above-mentioned nonlinear stretching processing is performed on the battery cell area image, nonlinear stretching processing can also be performed only on the pixel points of the battery cell area. For example, if the pixel value of the corresponding pixel point in the battery cell area image is less than or equal to the stretching threshold, the nonlinear stretching formula constructed by the exponential function is used to perform nonlinear stretching processing on the corresponding pixel point in the battery cell area image to obtain a stretched image.
[0132] That is, for pixels whose values are less than or equal to the stretching threshold, the nonlinear stretching method described above can be used for processing, while for pixels whose values are greater than the stretching threshold, no nonlinear stretching is performed. The calculation formula can be shown as follows:
[0133] Among them, G represents the pixel value of a certain pixel, and θ represents the stretching threshold.
[0134] It is understandable that the stretching threshold here can also be set according to the actual situation. For example, the minimum threshold of the pixel points in the battery cell area can be determined through a large number of experiments, and then the minimum threshold is determined as the stretching threshold. Alternatively, the stretching threshold can be set to be smaller than the above-mentioned image segmentation threshold. This is because during segmentation, background information of the non-battery cell area may be segmented out, and the pixel values of the background image of the non-battery cell area are generally larger than the pixel values of the battery cell area. Therefore, setting a stretching threshold that is smaller than the image segmentation threshold can determine the pixel points where the battery cells in the image are located, and then performing nonlinear stretching processing on these pixel points, so that a better stretching effect can be achieved for the battery cell pixels.
[0135] In the above implementation process, since the area for defect detection is generally the cell pixel area, the nonlinear stretching process is only performed on the cell pixel area in the cell area image, which can improve the stretching process efficiency.
[0136] On the basis of the above embodiment, the X-ray device can emit X-rays with a uniformly distributed dose through the X-ray tube. When the X-rays penetrate a certain part of the battery cell, they are affected by factors such as the thickness and density of the part, and then produce a corresponding degree of attenuation. The pixel value of each pixel point in the battery cell area image can be related to the unattenuated dose of the X-rays after penetrating the corresponding part of the battery cell. For example, under the same conditions such as material density, the smaller the thickness of the battery cell part penetrated by the X-rays, the lower the dose of X-ray attenuation, the higher the dose reaching the program device, and the higher the brightness of the pixel at the corresponding position in the obtained battery cell area image. If the pixel value is defined as the brightness value, it can be summarized that the smaller the thickness of the battery cell part, the higher the pixel value of the corresponding pixel in the battery cell area image.
[0137] When using X-ray equipment to capture images of the battery cell area, you can first set the acquisition parameters of the X-ray equipment, including voltage, current, magnification, exposure time, etc. It can be understood that the set acquisition parameters may be different under different scene requirements.
[0138] The basic principle of X-ray imaging is that when X-ray passes through the irradiated object, the intensity of the ray will continue to decrease due to factors such as scattering and absorption. Ideally, the ray attenuation formula in this process can be described as: I = I0e -Ex ;
[0139] Wherein, I represents the received energy, that is, the dose of the ray after attenuation at a certain pixel point in the cell area image, or the pixel value of the pixel point, I0 represents the incident energy, that is, the dose of the input ray, E represents the material coefficient, and x represents the material thickness.
[0140] As the thickness of the cell layers gradually increases, the contrast between adjacent layers will gradually weaken, as shown in Figure 3. Therefore, according to the principle of ray attenuation, with the above-mentioned I representing the pixel value, the cell area image is logarithmically transformed to obtain a linear relationship model corresponding to the thickness change, and finally the transformed cell area image is obtained, as shown in Figure 4. The transformation process can be expressed as follows: ln I=ln(I0e -Ex )=-Ex+ln I0;
[0141] Among them, the cell area image after logarithmic transformation can be understood as lnI, so that the correspondence between the cell thickness and the pixel value of the pixel point in the cell area image can be obtained. In this way, the distribution of the cell thickness can be accurately reflected by the pixel value, and then reliable detection of cell defects can be achieved.
[0142] It should be noted that the cell region image in the above embodiment may refer to a transformed cell region image, that is, the transformed cell region image is subjected to nonlinear stretching processing, and the image after nonlinear stretching transformation may be shown in FIG5 .
[0143] In the above implementation process, based on the variation law of ray intensity, the density of the battery cells is wirelessly acquired by performing logarithmic transformation on the battery cell area image. This can amplify the influence of the battery cell thickness on the pixel value of each pixel point, and further help to perform nonlinear stretching on the battery cell area image, so as to more clearly define the thickness distribution of the battery cells and improve the detection effect of battery cell defects.
[0144] Based on the above embodiments, in actual application scenarios, there is noise interference in the battery cell image obtained by X-ray photography, or there may also be noise interference in the battery cell area image obtained above, so the battery cell area image or the battery cell image can be denoised, and the denoising processing here can be implemented by Gaussian filtering and mean filtering.
[0145] For example, the mean filter is first used to process the cell area image or the cell image. The implementation of the mean filter is as follows:
[0146] Where f(x,y) is the cell region image or cell image containing noise, g(x,y) is the cell region image or cell image obtained after mean filtering, s is the set of pixels in the template centered at point (ij), and the template size is m*n.
[0147] Then, Gaussian filtering can be performed again on the cell area image or cell image after mean filtering. The implementation process of Gaussian filtering is as follows:
[0148] Wherein, G(x,y) represents the cell area image or cell image obtained after Gaussian filtering, σ represents the standard deviation of the Gaussian function, and (x,y) represents the coordinates of the pixel point.
[0149] It is understandable that the cell region image or the cell image may be first subjected to Gaussian filtering and then to mean filtering, and the order of filtering the two may not be particularly limited. Moreover, in practical applications, other filtering methods (such as median filtering) may be used to filter out noise in the cell region image or the cell image, or a combination of multiple filtering methods may be used to process the cell region image or the cell image, thereby reducing the impact of subsequent defect detection results on the cell.
[0150] Based on the above embodiment, after obtaining the stretched image, the stretched image can be used to detect defects in the battery cell. As shown in FIG6 , the embodiment of the present application provides a flow chart of a battery cell defect detection method, which includes the following steps:
[0151] Step S210: Acquire a stretched image.
[0152] The stretched image here refers to the stretched image obtained using the aforementioned image processing method. It is understood that the device executing the aforementioned image processing method and the device executing the defect detection method here may be different devices, but they can also be the same device. If they are different devices, the defect detection device can obtain the stretched image from the image processing device and then perform defect detection on the stretched image. In other implementations, after obtaining the stretched image, the image processing device can also transmit the stretched image to another device for storage, such as the cloud. In this case, the defect detection device can obtain the stretched image from the cloud and then perform defect detection.
[0153] Step S220: performing defect detection on the battery cell according to the stretched image.
[0154] The defect types of battery cells may include: wrinkling, overlapping or metal leakage of the anode and cathode plates, whether the cathode ending is correct, whether the distance between the anode and cathode is qualified, whether the length of the anode compared to the cathode is qualified, the alignment of the anode and cathode, etc. In actual applications, there may be more than one specific defect type that needs to be detected.
[0155] Defect detection can be achieved using algorithms from related technologies, such as contrast enhancement or edge detection algorithms, to identify areas where cell thickness changes dramatically. Alternatively, a neural network model can be used to detect defects and their types in stretched images. The detailed implementation process is described in related technologies and is not detailed here.
[0156] In the above embodiment, in order to realize online nonlinear stretching processing and defect detection of the cell area image, the image processing equipment and the defect detection equipment can be deployed online. For example, in the cell production process, the image processing equipment and the defect detection equipment are deployed online. The flow chart of the cell production can be shown in Figure 7. After the cell undergoes hot pressing and shaping, the image can be collected by X-ray. At this time, the collected cell image can be processed by the image processing equipment for nonlinear stretching to obtain a stretched image (the data preprocessing is the nonlinear stretching process in this solution). The stretching process is shown in Figure 8, where the lightweight AI model in Figures 7 and 8 is the neural network model for defect detection, and the Sigmoid function in Figure 8 can refer to the nonlinear stretching function in the above embodiment. The stretched image is then passed through the defect detection equipment for defect detection, so that online defect detection can be realized. The solution of the present application can perform defect detection after "hot pressing and shaping", which is more real-time. If a defect is found at this time, the subsequent production process can be suspended, and there is no need to continue the subsequent useless processing, thereby improving production efficiency.
[0157] Please refer to Figure 9, which is a block diagram of an image processing device 300 provided in an embodiment of the present application. The device 300 may be a module, program segment, or code on an electronic device. It should be understood that the device 300 corresponds to the method embodiment of Figure 1 above and is capable of performing each step involved in the method embodiment of Figure 1. The specific functions of the device 300 can be found in the description above. To avoid repetition, the detailed description is omitted here.
[0158] Optionally, the apparatus 300 includes:
[0159] A cell image acquisition module 310 is used to acquire a cell image of a cell;
[0160] A region image acquisition module 320 is configured to extract a cell region image containing the cell from the cell image;
[0161] The image processing module 330 is used to perform nonlinear stretching processing on the battery cell area image using a nonlinear stretching formula constructed using an exponential function to obtain a stretched image, wherein the nonlinear stretching formula is constructed based on stretching parameters, and the stretching parameters include a contrast stretching coefficient and / or a pixel enhancement coefficient, and the contrast stretching coefficient and the pixel enhancement coefficient are determined based on the pixel variance value of the battery cell area image.
[0162] Optionally, the image processing module 330 is used to obtain the maximum pixel value, the minimum pixel value and the stretching parameter in the battery cell area image; based on the maximum pixel value, the minimum pixel value and the stretching parameter, a nonlinear stretching formula constructed using an exponential function is used to calculate the pixel value of each pixel point after nonlinear stretching of the battery cell area image to obtain a stretched image.
[0163] Optionally, the image processing module 330 is configured to obtain a pixel variance value in the cell region image; and determine the contrast stretching coefficient and / or pixel enhancement coefficient according to the pixel variance value and a preset variance threshold.
[0164] Optionally, if the stretching parameters include a contrast stretching coefficient and a pixel enhancement coefficient, a nonlinear stretching formula constructed using an exponential function is expressed as follows:
[0165] Wherein, f(x, y) represents the pixel value of the pixel after nonlinear stretching, G represents the pixel value of the pixel in the cell area image, δ represents the contrast stretching coefficient, τ represents the pixel enhancement coefficient, G min Indicates the minimum value of the pixel, G max Indicates the maximum value of the pixel.
[0166] Optionally, the image processing module 330 is used to determine the convolution window size; traverse the battery cell area image according to the convolution window size to obtain the pixel maximum value, pixel minimum value and stretching parameter of the image area corresponding to the convolution window; calculate the pixel value of the corresponding pixel point in the corresponding image area after nonlinear stretching of the battery cell area image according to the pixel maximum value, the pixel minimum value and the stretching parameter of the corresponding image area using a nonlinear stretching formula constructed by an exponential function, until the pixel value of each pixel point after nonlinear stretching is obtained to obtain a stretched image.
[0167] Optionally, the image processing module 330 is used to obtain the thickness of the anode and cathode electrodes of the battery cell; and determine the convolution window size according to the thickness.
[0168] Optionally, the region image acquisition module 320 is configured to perform histogram statistics on the battery cell image to determine an image segmentation threshold; and segment a battery cell region image containing the battery cell from the battery cell image using the image segmentation threshold.
[0169] Optionally, the image processing module 330 is configured to perform nonlinear stretching processing on the corresponding pixel point in the cell region image to obtain a stretched image if the pixel value of the corresponding pixel point in the cell region image is less than or equal to a stretching threshold.
[0170] Optionally, the cell area image is an image obtained based on X-ray photography.
[0171] Optionally, the apparatus 300 further includes:
[0172] The transformation module is used to perform logarithmic transformation on the battery cell region image to obtain a transformed battery cell region image.
[0173] Please refer to Figure 10, which is a block diagram of a battery cell defect detection device 400 provided in an embodiment of the present application. Device 400 may be a module, program segment, or code on an electronic device. It should be understood that device 400 corresponds to the method embodiment of Figure 6 above and is capable of executing each step involved in the method embodiment of Figure 6. The specific functions of device 400 can be found in the description above, and detailed descriptions are omitted here to avoid repetition.
[0174] Optionally, the apparatus 400 includes:
[0175] A stretched image acquisition module 410 is configured to acquire a stretched image, wherein the stretched image is obtained according to the image processing method in the above embodiment;
[0176] The defect detection module 420 is configured to perform defect detection on the battery cell according to the stretched image.
[0177] It should be noted that those skilled in the art can clearly understand that for the convenience and brevity of description, the specific working process of the device described above can refer to the corresponding process in the aforementioned method embodiment and will not be repeated here.
[0178] Please refer to Figure 11, which is a schematic diagram of the structure of an electronic device for performing an image processing method or a battery cell defect detection method provided in an embodiment of the present application. If it is used to perform the image processing method, the electronic device can be the above-mentioned image processing device. If it is used to perform the battery cell defect detection method, the electronic device can be the above-mentioned defect detection device. The electronic device may include: at least one processor 510, such as a CPU, at least one communication interface 520, at least one memory 530, and at least one communication bus 540. Among them, the communication bus 540 is used to achieve connection and communication between these components. Among them, the communication interface 520 of the device in the embodiment of the present application is used to communicate signaling or data with other node devices. The memory 530 can be a high-speed RAM memory or a non-volatile memory (non-volatile memory), such as at least one disk storage. The memory 530 can also optionally be at least one storage device located away from the aforementioned processor. The memory 530 stores computer-readable instructions. When the computer-readable instructions are executed by the processor 510, the electronic device performs the method process shown in Figure 1 or Figure 6 above.
[0179] It is understood that the structure shown in Figure 11 is merely illustrative, and the electronic device may include more or fewer components than shown in Figure 11, or have a configuration different from that shown in Figure 11. Each component shown in Figure 11 may be implemented using hardware, software, or a combination thereof.
[0180] An embodiment of the present application provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the method process executed by the electronic device in the method embodiment shown in FIG. 1 or FIG. 6 is executed.
[0181] This embodiment discloses a computer program product, which includes a computer program stored on a non-transitory computer-readable storage medium. The computer program includes program instructions. When the program instructions are executed by a computer, the computer can perform the methods provided in the above method embodiments, for example, including:
[0182] Acquire a cell image of the battery cell;
[0183] Extracting a cell region image containing the cell from the cell image;
[0184] The cell area image is subjected to nonlinear stretching processing using a nonlinear stretching formula constructed using an exponential function to obtain a stretched image, wherein the nonlinear stretching formula is constructed based on stretching parameters, and the stretching parameters include a contrast stretching coefficient and / or a pixel enhancement coefficient, and the contrast stretching coefficient and the pixel enhancement coefficient are determined based on the pixel variance value of the cell area image.
[0185] In summary, the embodiments of the present application provide an image processing method, a battery cell defect detection method, an apparatus and a device, which obtain a stretched image by performing nonlinear stretching processing on the battery cell area image of the battery cell. In this way, the pixels in the area where the battery cell is located can be subjected to targeted nonlinear stretching processing, and after processing, the contrast between the various layers of the anode and cathode of the battery cell in the battery cell area image can be improved, thereby improving the imaging effect. The nonlinear stretching formula adopts an exponential function, which can expand the grayscale interval in the battery cell area image, highlight the detail features, and improve the stretching effect, thereby providing a clearer image for subsequent defect detection of the battery cell, thereby improving the accuracy of battery cell defect detection.
[0186] In the embodiments provided in this application, it should be understood that the disclosed devices and methods can be implemented in other ways. The device embodiments described above are merely illustrative. For example, the division of the units is merely a logical function division. In actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed may be through some communication interface, and the indirect coupling or communication connection of the devices or units may be electrical, mechanical or other forms.
[0187] In addition, the units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0188] Furthermore, the functional modules in each embodiment of the present application can be integrated together to form an independent part, or each module can exist independently, or two or more modules can be integrated to form an independent part.
[0189] In this document, relational terms such as first and second, etc. are used merely to distinguish one entity or operation from another entity or operation, but do not necessarily require or imply any actual relationship or order between these entities or operations.
[0190] The above description is merely an embodiment of the present application and is not intended to limit the scope of protection of the present application. For those skilled in the art, various modifications and variations of the present application are possible. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application shall be included in the scope of protection of the present application.
Claims
1. An image processing method, characterized in that: The method comprises: Acquire a cell image of the battery cell; Extracting a cell region image containing the cell from the cell image; The cell area image is subjected to nonlinear stretching processing using a nonlinear stretching formula constructed using an exponential function to obtain a stretched image, wherein the nonlinear stretching formula is constructed based on stretching parameters, and the stretching parameters include a contrast stretching coefficient and / or a pixel enhancement coefficient, and the contrast stretching coefficient and the pixel enhancement coefficient are determined based on the pixel variance value of the cell area image.
2. The method according to claim 1, characterized in that The nonlinear stretching formula constructed by using an exponential function is used to perform nonlinear stretching processing on the cell region image to obtain a stretched image, including: Obtaining the maximum pixel value, the minimum pixel value, and the stretching parameter in the cell area image; According to the maximum pixel value, the minimum pixel value and the stretching parameter, a nonlinear stretching formula constructed using an exponential function is used to calculate the pixel value of each pixel point after nonlinear stretching of the cell area image to obtain a stretched image.
3. The method according to claim 2, characterized in that The stretching parameters are obtained in the following way: Obtaining pixel variance values in the cell area image; The contrast stretching coefficient and / or the pixel enhancement coefficient are determined according to the pixel variance value and a preset variance threshold.
4. The method according to claim 2, characterized in that If the stretching parameters include a contrast stretching coefficient and a pixel enhancement coefficient, the nonlinear stretching formula constructed using an exponential function is expressed as follows: Wherein, f(x, y) represents the pixel value of the pixel after nonlinear stretching, G represents the pixel value of the pixel in the cell area image, δ represents the contrast stretching coefficient, τ represents the pixel enhancement coefficient, G min Represents the minimum value of the pixel, G max Indicates the maximum value of the pixel.
5. The method according to claim 2, characterized in that The obtaining of the maximum pixel value, the minimum pixel value, and the stretching parameter in the cell area image includes: Determine the convolution window size; Traversing the cell area image according to the convolution window size, obtaining the maximum pixel value, the minimum pixel value, and the stretching parameter of the image area corresponding to the convolution window; The step of calculating the pixel value of each pixel point after nonlinear stretching of the cell area image using a nonlinear stretching formula constructed by an exponential function according to the maximum pixel value, the minimum pixel value, and the stretching parameter to obtain a stretched image includes: According to the maximum pixel value of the corresponding image area, the minimum pixel value and the stretching parameter, a nonlinear stretching formula constructed using an exponential function is used to calculate the pixel value of the corresponding pixel point in the corresponding image area after nonlinear stretching of the battery cell area image, until the pixel value of each pixel point after nonlinear stretching is obtained to obtain a stretched image.
6. The method according to claim 5, characterized in that Determining the convolution window size includes: Obtaining the thickness of the cathode and anode electrodes of the battery cell; The convolution window size is determined according to the thickness.
7. The method according to any one of claims 1 to 6, characterized in that: The nonlinear stretching formula constructed by using an exponential function is used to perform nonlinear stretching processing on the cell region image to obtain a stretched image, including: If the pixel value of the corresponding pixel point in the cell region image is less than or equal to the stretching threshold, the cell region image is subjected to nonlinear stretching processing using a nonlinear stretching formula constructed using an exponential function to obtain a stretched image.
8. The method according to any one of claims 1 to 7, characterized in that: The cell area image is an image obtained based on X-ray photography.
9. The method according to claim 8, characterized in that After extracting the cell region image containing the cell from the cell image, and performing nonlinear stretching processing on the cell region image using the nonlinear stretching formula constructed by the exponential function, before obtaining the stretched image, the method further includes: Performing logarithmic transformation on the battery cell region image to obtain a transformed battery cell region image.
10. A method for detecting defects in a battery cell, characterized in that: The method comprises: Acquire a stretched image, where the stretched image is obtained by the method according to any one of claims 1 to 9; Defect detection is performed on the battery cell according to the stretched image.
11. An image processing device, characterized in that: The device comprises: A cell image acquisition module, used to acquire a cell image of a cell; A region image acquisition module, configured to extract a cell region image containing the cell from the cell image; An image processing module is used to perform nonlinear stretching processing on the battery cell area image using a nonlinear stretching formula constructed using an exponential function to obtain a stretched image, wherein the nonlinear stretching formula is constructed based on stretching parameters, and the stretching parameters include a contrast stretching coefficient and / or a pixel enhancement coefficient, and the contrast stretching coefficient and the pixel enhancement coefficient are determined based on the pixel variance value of the battery cell area image.
12. A battery cell defect detection device, characterized in that: The device comprises: a stretched image acquisition module, configured to acquire a stretched image, wherein the stretched image is obtained by the method according to any one of claims 1 to 9; A defect detection module is used to perform defect detection on the battery cell according to the stretched image.
13. An electronic device, characterized in that: The method comprises a processor and a memory, wherein the memory stores computer-readable instructions. When the computer-readable instructions are executed by the processor, the method according to any one of claims 1 to 10 is executed.
14. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 10 is executed.
15. A computer program product, characterized in that The method comprises computer program instructions, and when the computer program instructions are read and executed by a processor, the method according to any one of claims 1 to 10 is executed.
Citation Information
Patent Citations
Uncooled infrared thermal image self-adaptive mapping method based on homomorphic filtering
CN110020999A
X-Ray image enhancement method based on gray stretching and local enhancement
CN114298916A
Method, device and system for detecting defects of cathode pole piece of composite material belt
CN115829906A
Environment-friendly and energy-saving aluminum silicate plate quality detection method
CN116168039A
Image processing method, cell defect detection method, device and equipment
CN117853319A
Cited By
Small sample underwater fish identification and detection system based on image identification
CN121527606A