Lithium battery diaphragm defect detection method, system, computer equipment and storage medium
By determining the diaphragm area in the lithium battery diaphragm defect detection, generating distribution maps to obtain thresholds, performing fuzzy calculations and rule division of pixel communication domains, the problems of low detection accuracy and slow speed in the prior art are solved, and efficient and accurate defects are achieved Detection and parameter acquisition.
Patent Information
- Application Number
- CN202410456362.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-04-16
- Publication Date
- 2025-02-25
- Estimated Expiration
- 2044-04-16
AI Technical Summary
The existing lithium battery separator defect detection method based on machine vision has low detection accuracy and slow detection speed, so it is impossible to effectively obtain clear parameters of defect areas.
By determining the diaphragm region in the original image of the lithium battery separator, a distribution map is generated to obtain thresholds, a blur calculation is performed to determine the defective pixels, and a defective pixel region is divided based on the pixel connectivity domain rules to obtain the defect parameters.
It improves the accuracy and efficiency of defect detection of lithium battery separator, can clearly obtain parameters of defect areas, guide the next step of processing, and speed up the production and shipment process.
Smart Images

Figure CN118333972B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of lithium battery diaphragm defect detection and machine vision, and more specifically, to a lithium battery diaphragm defect detection method, system, computer equipment and storage medium. Background Art
[0002] With the rapid development of the new energy industry, the supply and quality requirements of lithium batteries are growing rapidly. As one of the key internal components of lithium batteries, the supply and quality requirements of diaphragms are also growing rapidly. The main function of diaphragms is to separate the positive and negative electrodes of lithium batteries to prevent the two electrodes from contacting and short-circuiting. In addition, diaphragms also have the function of allowing electrolyte ions to pass through.
[0003] In the production process of lithium battery separators, some defects are inevitable. Common types of defects include pinholes, transparency, dark spots, bright spots, black spots, bright spots, missing coating and stripes. If there are defects in lithium battery separators, it will directly affect the battery capacity, cycle life and safety performance. For example, the existence of pinhole defects will cause a conductive path to form between the positive and negative electrodes of the lithium battery, causing a short circuit and causing a safety accident; transparency and missing coating defects will reduce the cycle life of the lithium battery. Therefore, defect detection of lithium battery separators is of great significance to ensure the quality of the separators.
[0004] The traditional method of manually observing whether there are defects in lithium battery diaphragms to detect defects in lithium battery diaphragms has the disadvantages of high cost, low efficiency and easy to miss detection. The defect image detection method based on machine vision technology has extremely high detection efficiency, detection accuracy and super stability, which can greatly improve the efficiency of defect detection, improve the production quality of diaphragms, and save costs. At present, the threshold method is a commonly used defect image detection algorithm based on machine vision. Its basic idea is to calculate one or more grayscale thresholds based on the grayscale features of the image, and compare the grayscale value of each pixel in the image with the threshold. Finally, different areas are divided into image defect detection categories according to the pixel comparison results. It mainly includes full threshold algorithm, local threshold algorithm and Otsu threshold algorithm. Among them, the full threshold algorithm sets the pixels with grayscale values greater than the threshold to one color, and the pixels less than or equal to the threshold to another color. Therefore, the full threshold algorithm is limited by the fixedness of the threshold and can only distinguish images with obvious double peaks. The lithium battery diaphragm image is relatively complex and has many types of defects. The detection effect of this algorithm is poor. The local threshold algorithm determines the threshold at the pixel position based on the pixel value distribution of the pixel's neighborhood block. The threshold at each pixel position is determined by the distribution of its surrounding neighborhood pixels. The common local threshold uses the mean of the local neighborhood block or the Gaussian weighted sum of the local neighborhood block. The Otsu threshold algorithm is an image grayscale adaptive threshold segmentation algorithm. According to the distribution of grayscale values on the image, the image is divided into two parts: background and foreground. The foreground is the part segmented by the threshold. The dividing value between the background and foreground is the threshold. Different thresholds are traversed to calculate the intra-class variance between the background and foreground corresponding to different thresholds. When the intra-class variance reaches a maximum value, the corresponding threshold is the threshold required by the Otsu threshold algorithm. The above two algorithms have high computational complexity, slow defect detection speed, and low efficiency.
[0005] Moreover, in the actual production process of lithium battery diaphragms, there are many types of scattered defects. After determining the preliminary defect area according to the threshold, the above methods are unable to obtain clear defect parameters of the defect area, and the detection accuracy of diaphragm defects is low, which is not conducive to guiding the further processing of defects in the actual production process of lithium battery diaphragms and affects the production and shipment process of the diaphragms. Summary of the invention
[0006] One of the purposes of the present invention is to provide a lithium battery diaphragm defect detection method to solve the problems of low defect detection accuracy and slow detection speed of the current machine vision-based defect detection method; the second purpose is to provide a lithium battery diaphragm defect detection system to implement the lithium battery diaphragm defect detection method; the third purpose is to provide a computer device; the fourth purpose is to provide a computer-readable storage medium.
[0007] In order to achieve the above object, the technical solution adopted by the present invention is as follows:
[0008] In a first aspect, the present application provides a method for detecting defects in a lithium battery diaphragm, comprising the following steps: determining a diaphragm area in an original image based on a first numerical value of an original image of a lithium battery diaphragm; generating a first distribution map of the original image, and determining a second distribution map corresponding to the diaphragm area on the first distribution map; obtaining a first threshold value and a second threshold value of the diaphragm area based on the second distribution map corresponding to the diaphragm area; performing fuzzy calculation of diaphragm defects based on the first threshold value and the second threshold value, and determining defective pixels in the diaphragm area based on the fuzzy calculation result of the diaphragm defect; traversing the defective pixels, and dividing the defective pixel area based on the pixel connectivity domain rule; and obtaining defect parameter data based on the defective pixel area.
[0009] In the first aspect proposed in the present application, the original image of the lithium battery diaphragm can be obtained by using a CCD industrial camera. If the original image of the lithium battery diaphragm obtained is a grayscale image, the first numerical value represents the grayscale value of the original image of the lithium battery diaphragm, and the area composed of pixels whose grayscale values in the original image of the lithium battery diaphragm are greater than the grayscale preset value is determined as the diaphragm area. In addition, the original image of the lithium battery diaphragm obtained can also be a color image, and the first numerical value represents the pixel value of the original image of the lithium battery diaphragm. If the first numerical value is a pixel value, after converting the pixel value of the original image of the lithium battery diaphragm into a grayscale value, it can be directly compared with the grayscale preset value. Similarly, the area composed of pixels whose grayscale values are greater than the grayscale preset value is the diaphragm area; otherwise, it is not the diaphragm area.
[0010] Preferably, the first distribution diagram of the original image is generated by taking the number of columns of pixel points of the original image as the horizontal coordinate and taking the average first value of the pixel points in each column as the vertical coordinate.
[0011] In the first aspect of the present application, the first numerical value is the grayscale value of the original image (when the original image is a color image, the pixel value is converted to the grayscale value), and the area composed of pixels whose grayscale values are greater than the grayscale preset value can be determined as the diaphragm area, but the distribution of the pixels is uneven. Therefore, the sum of the grayscale values of each column of pixels in the original image is first determined, and then the average value is calculated to obtain the average grayscale value of each column of pixels. The number of columns of pixels in the original image is used as the horizontal coordinate, and the average first numerical value of each column of pixels is used as the vertical coordinate to form a first distribution map, that is, the first distribution map is an average grayscale distribution map formed with the number of columns of pixels in the original image as the horizontal coordinate and the average grayscale value as the vertical coordinate. According to the corresponding relationship in the figure, on the average grayscale distribution map, the second distribution map corresponding to the diaphragm area is further determined. The second distribution map is the average grayscale distribution map of the diaphragm area corresponding to the diaphragm area on the average grayscale distribution map. Finally, the first threshold value and the second threshold value of the diaphragm area are determined according to the upper and lower limits of the average grayscale value in the average grayscale distribution map of the diaphragm area.
[0012] Preferably, the process of performing fuzzy calculation of diaphragm defects according to the first threshold and the second threshold includes:
[0013] Construct pixel judgment function;
[0014] According to the first threshold and the second threshold, combined with the pixel judgment function, fuzzy calculation of the diaphragm defect is performed to obtain the fuzzy calculated pixel value of each pixel point in the diaphragm area.
[0015] Preferably, the calculation expression for fuzzy calculation of diaphragm defects is:
[0016]
[0017] Where d(x) represents the fuzzy calculated pixel value of each pixel in the diaphragm area after the fuzzy calculation of the diaphragm defect, x represents the pixel value of any pixel in the diaphragm area, High Th Indicates the first threshold of the diaphragm area obtained according to the second distribution map corresponding to the diaphragm area, Low Th represents the second threshold of the diaphragm area obtained according to the second distribution map corresponding to the diaphragm area; f(x) represents the constructed pixel judgment function;
[0018] Among them, the expression of f(x) is:
[0019]
[0020] Among them, x i,j represents the pixel at the i-th row and j-th column in the diaphragm area, x i-1,j represents the pixel at the i-1th row and jth column of the diaphragm area, x i+1,j represents the pixel at the i+1th row and jth column in the diaphragm area, x i,j-1 represents the pixel at the i-th row and j-1-th column of the diaphragm area, x i,j+1 The pixel representing the pixel at the i-th row and j+1-th column in the diaphragm region;
[0021] The pixel points in the diaphragm region whose fuzzy calculated pixel values are 255 are determined as defective pixels.
[0022] Preferably, traversing the defective pixels and dividing the defective pixel areas based on the pixel connected domain rule includes:
[0023] Traverse the pixels of the eight connected domains above, below, left, right, upper left, upper right, lower left, and lower right of each defective pixel;
[0024] The adjacent defective pixels in the eight-connected domain are merged into the same defective pixel region.
[0025] Preferably, the defect parameter data of each defective pixel area at least includes: the center position coordinates of the defective pixel area; the length of the defective pixel area; the width of the defective pixel area; the area of the defective pixel area; the aspect ratio of the defective pixel area; and the average first value of the defective pixel area.
[0026] Preferably, obtaining defect parameter data according to the defective pixel area includes:
[0027] Obtain the minimum bounding rectangle of each defective pixel area, and obtain the center position coordinates of each defective pixel area based on the minimum bounding rectangle;
[0028] The length of the minimum circumscribed rectangle is used as the length of each defective pixel area, and the width of the minimum circumscribed rectangle is used as the width of each defective pixel area. According to the length and the width, the aspect ratio of the defective pixel area is calculated;
[0029] The area of the minimum bounding rectangle is taken as the area of each defective pixel region.
[0030] According to a first aspect of the present application, the average first value of the defective pixel region is the grayscale value of the defective pixel region.
[0031] Preferably, the lithium battery separator defect detection method further comprises: classifying defects in the defective pixel area into grades according to the defect parameter data.
[0032] Preferably, the defects in the defective pixel area are classified into grades according to the defect parameter data, including:
[0033] Sorting the defective pixel regions according to their area values, and setting a plurality of area level preset values that increase in sequence, with the plurality of area level preset values respectively serving as level division boundaries;
[0034] According to the level division boundaries, the sorted defective pixel areas are divided into multiple levels;
[0035] Classifying the defects into pinholes and dark defects according to the size of the average first value of the defective pixel area;
[0036] On the basis of the defect being classified as a dark defect, if the area of the defective pixel region is greater than a first preset value, the defect is classified as a black spot; if the area of the defective pixel region is less than or equal to the first preset value, the defect is classified as a black dot;
[0037] The defect whose aspect ratio of the defective pixel region is greater than a second preset value is classified as a stripe.
[0038] Preferably, after the defects in the defective pixel area are classified into grade categories, the method further includes: traversing each defective pixel area, taking each defective pixel area as the center, and judging whether the defective pixel area overlaps with other defective pixel areas in a spatial area with a preset number of pixels expanding outward from the center; if so, merging the overlapping defective pixel areas, otherwise, not merging them.
[0039] In the second aspect, the present application provides a lithium battery diaphragm defect detection system, including: a first acquisition module, used to determine the diaphragm area in the original image according to the first numerical value of the lithium battery diaphragm original image; a second acquisition module, used to generate a first distribution map of the original image, and determine the second distribution map corresponding to the diaphragm area on the first distribution map; a third acquisition module, used to obtain a first threshold value and a second threshold value of the diaphragm area according to the second distribution map corresponding to the diaphragm area; a fuzzy calculation module, used to perform fuzzy calculation of diaphragm defects according to the first threshold value and the second threshold value, and determine the defective pixels in the diaphragm area according to the fuzzy calculation result of the diaphragm defect; a defective pixel area division module, used to traverse the defective pixels and divide the defective pixel area based on the pixel connectivity domain rule; a defect parameter acquisition module, used to obtain defect parameter data according to the defective pixel area.
[0040] The lithium battery diaphragm defect detection system provided in the present application corresponds to the lithium battery defect detection method provided in the first aspect.
[0041] Preferably, the system further comprises:
[0042] A defect level classification module is used to classify defects in defective pixel areas according to the defect parameter data;
[0043] The defective pixel region merging module is used to traverse each defective pixel region, take each defective pixel region as the center, and determine whether the defective pixel region overlaps with other defective pixel regions in the spatial region with a preset number of pixels extending outward from the center. If so, the overlapping defective pixel regions are merged, otherwise, they are not merged.
[0044] In a third aspect, the present application provides a computer device including a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor executes the lithium battery diaphragm defect detection method proposed in the first aspect of the present application.
[0045] In a fourth aspect, the present application provides a computer-readable storage medium having instructions stored thereon, and when the instructions are executed on a computer, the computer executes the lithium battery diaphragm defect detection method proposed in the first aspect of the present application.
[0046] Compared with the prior art, the technical solution of the present invention has the following beneficial effects:
[0047] The present invention proposes a lithium battery diaphragm defect detection method, system, computer equipment and storage medium. First, the diaphragm area in the original image is determined, and then a first distribution map of the original image is generated. The second distribution map corresponding to the diaphragm area is determined on the first distribution map. According to the second distribution map corresponding to the diaphragm area, the first threshold and the second threshold of the diaphragm area are obtained. The present invention is based on the first threshold and the second threshold, and then performs fuzzy calculation of the diaphragm defects to avoid the defect that traditional diaphragm defects are limited by the fixedness of the threshold. The defective pixels in the diaphragm area are determined without the need for complex calculations, and the detection efficiency is high. In the face of complex lithium battery diaphragm images, after the defective pixels in the diaphragm area are determined, clear defect parameters of the defective pixel area are obtained, which improves the defect detection effect and accuracy. At the same time, it is convenient to guide the staff to carry out the next step of processing the diaphragm defects and speed up the production and shipment process of the diaphragm. BRIEF DESCRIPTION OF THE DRAWINGS
[0048] Figure 1 A schematic diagram showing an implementation flow of a lithium battery separator defect detection method proposed in an embodiment of the present invention;
[0049] Figure 2 A schematic diagram showing an implementation flow of generating a first distribution map of an original image proposed in an embodiment of the present invention;
[0050] Figure 3 A graph showing the average grayscale distribution of an original image proposed in an embodiment of the present invention;
[0051] Figure 4 A schematic diagram showing an implementation flow of fuzzy calculation of diaphragm defects proposed in an embodiment of the present invention;
[0052] Figure 5 A schematic diagram showing an implementation flow of another lithium battery separator defect detection method proposed in an embodiment of the present invention;
[0053] Figure 6 A schematic diagram showing defect parameters and grade categories proposed in an embodiment of the present invention;
[0054] Figure 7 A structural diagram showing a lithium battery separator defect detection system proposed in an embodiment of the present invention;
[0055] Figure 8 A structural diagram showing another lithium battery separator defect detection system proposed in an embodiment of the present invention;
[0056] Fig. 9 A schematic diagram showing the structure of a computer device proposed in an embodiment of the present invention;
[0057] Fig.10 A schematic diagram showing an interface for real-time display of defect parameters proposed in an embodiment of the present invention;
[0058] Fig.11 A schematic diagram of an interface for displaying the history of defect parameters proposed in an embodiment of the present invention. DETAILED DESCRIPTION
[0059] The accompanying drawings are only used for illustrative purposes and are not to be construed as limiting the present application;
[0060] In order to better illustrate the present embodiment, some parts of the drawings may be omitted, enlarged or reduced, and do not represent the actual size;
[0061] It is understandable to those skilled in the art that descriptions of certain well-known contents in the drawings may be omitted.
[0062] The technical solution of the present invention is further described below in conjunction with the accompanying drawings and embodiments.
[0063] The positional relationships described in the drawings are only for illustrative purposes and should not be construed as limiting the present application;
[0064] The present application embodiment proposes a lithium battery diaphragm defect detection method, and its implementation flow chart is shown in Figure 1 , including the following steps:
[0065] S1: Determine a diaphragm region in the original image according to a first value of the original image of the lithium battery diaphragm.
[0066] In the embodiment of the present application, first, the original image of the lithium battery diaphragm can be obtained based on a visual inspection device of machine vision, such as using a CCD industrial camera to obtain the original image of the lithium battery diaphragm. The original image of the lithium battery diaphragm is generally a grayscale image, or a color image. Therefore, in this embodiment, the first value can be one of the following: the pixel value of the original image of the lithium battery diaphragm; the grayscale value of the original image of the lithium battery diaphragm. Of course, the first value of the original image is not limited to this, and other values of the original image can also be used as the first value.
[0067] Specifically, in this embodiment, the original image of the lithium battery diaphragm is a grayscale image, and the first numerical value of the original image of the lithium battery diaphragm is the grayscale value. Then, in the specific implementation process, the grayscale preset value is set to 100, and the bright area of the original image whose grayscale value is greater than the grayscale preset value 100 is determined as the diaphragm area, that is, the area composed of pixels whose grayscale value is greater than the grayscale preset value is the diaphragm area, and the dark area composed of pixels whose grayscale value is less than the grayscale preset value 100 is determined as other areas except the diaphragm area.
[0068] If the original image of the lithium battery diaphragm is a color image, the first value of the original image of the lithium battery diaphragm is the pixel value of the original image of the lithium battery diaphragm, and the pixel values of the R, G, and B channels of the color image are obtained. In specific implementation, the pixel value of any pixel point position of the original image can be obtained by using the pixels function in Python according to the coordinates of any position of the original image, or the impixel function can be used in Matlab to obtain the pixel value of any pixel point position of the original image. Of course, the method of obtaining the pixel value of any pixel point position of the original image is not limited to this, and other methods can also be used. Assume that the pixel value of each pixel point of the original image is represented as RGB (R, G, B), and the pixel value corresponds to the value of the three RGB channels. When determining the diaphragm area in the original image, in the column direction of the original image of the lithium battery diaphragm, the pixel value of the original image is traversed from front to back and from back to front. In the traversal process, according to the pixel value of the original image of the lithium battery diaphragm, the pixel value of any pixel point position of the original image can be converted into a grayscale value, such as using the following conversion formula:
[0069] Gray=R*0.299+G*0.587+B*0.114;
[0070] Or use the following conversion formula:
[0071] Gray=(R*30+G*59+B*11) / 100;
[0072] Or use the average conversion method:
[0073] Gray=(R+G+B) / 3;
[0074] Among them, Gray is the gray value of each pixel of the original image, and R, G, and B are the red, green, and blue channel component values of each pixel of the original image.
[0075] Then, similarly, in the specific implementation process, the grayscale preset value is set to 100. After the pixel values of the original image are converted into grayscale values, the bright area with a grayscale value greater than the grayscale preset value of 100 is determined as the diaphragm area, that is, the area composed of pixels with a grayscale value greater than the grayscale preset value is the diaphragm area, and the dark area composed of pixels with a grayscale value less than the grayscale preset value of 100 is determined as other areas except the diaphragm area.
[0076] In addition, when determining the diaphragm region in the original image, the pixel values of the original image are traversed in the column direction of the lithium battery diaphragm original image in two ways, from front to back and from back to front. During the traversal process, according to the pixel values of the lithium battery diaphragm original image, the pixel values of any pixel point position of the original image can be converted into single channel components of any channel of R, G, and B, and used as grayscale values, such as for the single channel component value of only the green G channel: Gray = G; or the single channel component value of only the red R channel: Gray = R; or the single channel component value of only the blue B channel: Gray = B. Similarly, at this time, in the specific implementation process, the grayscale preset value is set to 100, and after the pixel values of the original image are converted into grayscale values, the bright area composed of pixels with grayscale values greater than the grayscale preset value 100 is determined as the diaphragm region, and the dark area composed of pixels with grayscale values less than the grayscale preset value 100 is determined as other areas except the diaphragm region.
[0077] In this embodiment, according to the cutting order in the actual diaphragm production process, there are two modes for determining the diaphragm area. One mode is that the lithium battery diaphragm is positioned before cutting. Therefore, there is only one set of diaphragm area position information in this mode; the other mode is that the lithium battery diaphragm is positioned after cutting. In this mode, there may be multiple sets of diaphragm area position information, and the specific number can be determined based on the number of cutters defined by the user.
[0078] S2: Generate a first distribution map of the original image, and determine a second distribution map corresponding to the diaphragm area on the first distribution map.
[0079] In an embodiment of the present application, after the diaphragm area is determined by the aforementioned S1 method, the pixel points in the diaphragm area are unevenly distributed. If the diaphragm defect calculation is performed directly on the diaphragm area, the defect detection effect is not good. By introducing a graph, a first distribution map of the original image is generated, and combined with the corresponding relationship in the graph, a second distribution map corresponding to the diaphragm area is determined on the first distribution map.
[0080] In this embodiment, the first distribution diagram of the original image is generated by taking the number of columns of pixel points of the original image as the abscissa and taking the average first value of the pixel points in each column as the ordinate.
[0081] Specifically, in this embodiment, the first distribution diagram is an average grayscale distribution diagram, see Figure 2 ,The process of generating the average grayscale distribution map of the original image includes the following steps:
[0082] S201: Determine the sum of the grayscale values of each column of pixels in the original image, and then calculate the average value to obtain the average grayscale value of each column of pixels;
[0083] In S201, if the original image of the lithium battery diaphragm is considered to be a color image, the pixel value of the original image of the lithium battery diaphragm is first converted into a grayscale value, and the pixel value of each pixel of the original image is represented as RGB (R, G, B), and the pixel value corresponds to the value of the three RGB channels. The conversion method can adopt any of the conversion methods in the aforementioned embodiments, which will not be repeated here. Each pixel has a corresponding grayscale value, and the sum of the grayscale values of each column of pixels in the column direction of the original image can be calculated, and then the average value is calculated to obtain the average grayscale value of each column of pixels.
[0084] S202: Using the number of columns of pixels of the original image as the horizontal coordinate and the average grayscale value as the vertical coordinate, an average grayscale distribution map is obtained.
[0085] In S202, in the coordinate system formed by the horizontal coordinate and the vertical coordinate, an average grayscale distribution map of the original image is generated. In a specific implementation, the length of the original image (unit: mm) is considered, and the length of each column of pixels is divided. From the perspective of length division, each column where the pixel points of the original image are located corresponds to a certain length. The average grayscale distribution map of the original image can be formed by referring to Figure 3 ,exist Figure 3 In , the horizontal axis is represented by the position coordinates of the original image. Figure 3 It can be seen that the average grayscale value of each column of pixels is displayed on the vertical axis when the original image position coordinates are expanded in sequence, forming a grayscale value curve.
[0086] In this embodiment, the second distribution diagram is an average grayscale distribution diagram of the diaphragm corresponding to the diaphragm area determined on the above average grayscale distribution diagram. Figure 3 The average grayscale distribution map of the diaphragm corresponding to the diaphragm area is determined on the average grayscale distribution map shown. According to the average grayscale distribution map of the diaphragm corresponding to the diaphragm area, a grayscale value curve corresponding to the diaphragm area can be obtained.
[0087] S3: Acquire a first threshold and a second threshold of the diaphragm area according to a second distribution map corresponding to the diaphragm area.
[0088] Through the implementation of step S2, combined with the correspondence between the average grayscale distribution map of the diaphragm in the average grayscale distribution map, according to the upper and lower limits of the average grayscale value in the average grayscale distribution map of the diaphragm, the first threshold and the second threshold of the diaphragm area are determined. In this embodiment, the first threshold is the high grayscale threshold of the diaphragm area, and the second threshold is the low grayscale threshold of the diaphragm area. Specifically, the upper limit of the value of the ordinate in the grayscale value curve corresponding to the diaphragm area is used as the high grayscale threshold of the diaphragm area, and the lower limit of the value of the ordinate in the grayscale value curve is used as the low grayscale threshold of the diaphragm area.
[0089] S4: performing fuzzy calculation of the diaphragm defect according to the first threshold and the second threshold, and determining defective pixels in the diaphragm area according to the fuzzy calculation result of the diaphragm defect.
[0090] In this embodiment, the implementation flow chart of fuzzy calculation of diaphragm defects is shown in Figure 4 , including the following steps:
[0091] S401: Construct a pixel judgment function.
[0092] In this embodiment, the pixel judgment function is a pixel judgment function of the upper and lower neighbors and the left and right neighbors of the pixel point in the i-th row and j-th column in the diaphragm area.
[0093] S402: Perform fuzzy calculation of the diaphragm defect according to the first threshold and the second threshold in combination with the pixel judgment function to obtain a fuzzy calculated pixel value of each pixel point in the diaphragm area.
[0094] Specifically, the calculation expression for fuzzy calculation of diaphragm defects is:
[0095]
[0096] Where d(x) represents the fuzzy calculated pixel value of each pixel in the diaphragm area after the fuzzy calculation of the diaphragm defect, x represents the pixel value of any pixel in the diaphragm area, High Th Indicates the first threshold of the diaphragm area obtained according to the second distribution map corresponding to the diaphragm area, Low Th represents the second threshold of the diaphragm area obtained according to the second distribution map corresponding to the diaphragm area; f(x) represents the constructed pixel judgment function;
[0097] Among them, the expression of f(x) is:
[0098]
[0099] Among them, x i,j represents the pixel at the i-th row and j-th column in the diaphragm area, x i-1,j represents the pixel at the i-1th row and jth column of the diaphragm area, x i+1,j represents the pixel at the i+1th row and jth column in the diaphragm area, x i,j-1 represents the pixel at the i-th row and j-1-th column of the diaphragm area, x i,j+1 The pixel representing the pixel at the i-th row and j+1-th column in the diaphragm region;
[0100] The pixel points in the diaphragm region whose fuzzy calculated pixel values are 255 are determined as defective pixels.
[0101] Through the above process, firstly, under the dual constraints of the first threshold of the diaphragm area and the "large window" of the second threshold of the diaphragm area, a window is provided for x, and different color levels are configured for it. The color level is assigned to the pixel value of any pixel point in the diaphragm area to avoid the defect that the traditional defect threshold is limited by the fixedness of the threshold. In this process, the constructed pixel judgment function is introduced. If it satisfies:
[0102] Low th -20 <x<Low th or High th <x<High th +20
[0103] After the fuzzy calculation of the diaphragm defect is performed, the fuzzy calculation pixel value d(x) of each pixel in the diaphragm area is taken as f(x), and then by traversing x i,j , x i-1,j , x i+1,j , x i,j-1 and x i,j+1 , obtain the final fuzzy calculated pixel value of each pixel in the diaphragm area, and then determine the pixel whose fuzzy calculated pixel value is 255 in the diaphragm area as a defective pixel. In this embodiment, the constraint values under different conditions can be obtained through experiments. Further, considering the pixel relationship between multiple neighborhoods of the pixel point, the color scale value is more flexibly configured, and no complex calculation is required, and the defect area detection efficiency is high.
[0104] S5: traverse the defective pixels and divide the defective pixel areas based on the pixel connected domain rule.
[0105] In this embodiment, the pixel connected domain rule may be a four-connected domain rule or an eight-connected domain rule. Of course, the pixel connected domain rule is not limited thereto, and other pixel connected domain rules may also be used. In this embodiment, considering the accuracy of defective pixel area division, the eight-connected domain rule is used to obtain the connected domain of the defective pixel. The eight-connected domain refers to the upper, lower, left, right, upper left, upper right, lower left, and lower right positions of the pixel point, a total of 8 directions, which are the pixel point positions adjacent to the pixel point and the pixel point positions adjacent to the pixel point in an oblique direction.
[0106] In the specific implementation process, the pixels of the eight connected domains above, below, left, right, upper left, upper right, lower left and lower right of each defective pixel are traversed, and the adjacent defective pixels in the eight connected domains are merged into the same defective pixel area to realize the division of the defective pixel area.
[0107] S6: Acquire defect parameter data according to the defective pixel area.
[0108] In this embodiment, the defect parameter data of each defective pixel area at least includes: the coordinates of the center position of the defective pixel area; the length of the defective pixel area; the width of the defective pixel area; the area of the defective pixel area; the aspect ratio of the defective pixel area; and the average first value of the defective pixel area. In this embodiment, the average first value of the defective pixel area is the average grayscale value of the defective pixel area, which is the sum of the grayscale values of all pixels in the defective pixel area. The average grayscale value of the defective pixel area is the ratio of the sum of the grayscale values to the number of pixels. Of course, the defect parameter data of the defective pixel area is not limited to this, and may also include other defect parameter data.
[0109] The process of obtaining the defect parameter data in each defective pixel area can be calculated by the following method, including:
[0110] The minimum bounding rectangle of each defective pixel area is obtained, and the center position coordinates of each defective pixel area are obtained according to the minimum bounding rectangle. In the specific implementation process, the rotation caliper is used to perform the following operations to obtain the minimum bounding rectangle of each defective pixel area:
[0111] (1) Input multiple vertices of a defective pixel region in clockwise order, find the four endpoints of the region, and perform the following operations:
[0112] (2) Construct four tangent lines through the four endpoints to determine two "card" sets;
[0113] (3) If one (or two) lines approximately coincide with the edge of the defective pixel area, then the area of the rectangle determined by the four lines is calculated and saved as the current minimum value; otherwise, the current minimum value is defined as infinity;
[0114] (4) Rotate the lines clockwise until one of them approximately coincides with an edge of the defective pixel area.
[0115] (5) Calculate the area of the new rectangle and compare it with the current minimum value. If it is less than the current minimum value, update and save the rectangle information that determines the minimum value.
[0116] (6) Repeat (4) and (5) until the line is rotated by an angle greater than 90 degrees and output the circumscribed rectangle.
[0117] Of course, obtaining the minimum bounding rectangle of each defective pixel area is not limited to this. The defective area can be directly operated by programming to obtain the minimum bounding rectangle. According to the minimum bounding rectangle, the center position coordinates of each defective pixel area can be obtained.
[0118] Then, the length of the minimum circumscribed rectangle is used as the length of each defective pixel region, the width of the minimum circumscribed rectangle is used as the width of each defective pixel region, and the aspect ratio of the defective pixel region is calculated according to the length and the width; and the area of the minimum circumscribed rectangle is used as the area of each defective pixel region;
[0119] Finally, the grayscale value of the defective pixel area is obtained, and the brightness of the defective pixel area is measured by the grayscale value of the defective pixel area.
[0120] By obtaining defect parameter data using the method proposed in this embodiment, users can intuitively understand the center position coordinates, length, width, area, aspect ratio and grayscale value of each defective pixel area, and the defect detection accuracy is higher.
[0121] In another embodiment, another lithium battery separator defect detection method is proposed, such as Figure 5 The specific implementation process shown is the same as S1 to S6 in the implementation process proposed in the aforementioned lithium battery separator defect detection method, and also includes:
[0122] S7: Classifying the defects in the defective pixel area into different levels according to the defect parameter data.
[0123] In this embodiment, the process of classifying defects in the defective pixel area into different levels includes:
[0124] The defective pixel regions are sorted according to their area values, and a plurality of area level preset values which increase in sequence are set, and the plurality of area level preset values are used as level division boundaries respectively.
[0125] The sorted defective pixel areas are divided into multiple levels according to the level division boundaries.
[0126] For example, in the specific implementation process, three preset area level values which increase in sequence are set: S1, S2, and S3, among which S1 < S2 < S3. S1, S2, and S3 are used as level division boundaries respectively. The defective pixel area when the area value is less than S1 is divided into the first level, the defective pixel area with an area value between S1 and S2 is divided into the second level, the defective pixel area when the area value is less than S3 and greater than S2 is divided into the third level, and the defective pixel area when the area value is greater than S4 is divided into the fourth level. In actual production, the larger the area value, the more timely processing is required by the staff, so as to realize the level division of the defective pixel area, which is convenient for the staff to handle the defects according to the level.
[0127] In addition, according to the size of the average grayscale value of the defective pixel area, the defects are classified into pinholes and dark defects; for example, defects with an average grayscale value greater than 250 are classified as pinholes; defects with an average grayscale value less than 128 are classified as dark defects. On the basis of the defect being classified as a dark defect, if the area of the defective pixel area is greater than a first preset value (which can be set according to actual needs), the defect is classified as a black spot; if the area of the defective pixel area is less than or equal to the first preset value, the defect is classified as a black spot.
[0128] Defects whose aspect ratio of the defective pixel region is greater than a second preset value (which can be set according to actual needs) are classified as stripes.
[0129] This embodiment uses Figure 6 Taking the two defects shown in the figure as an example, the defect parameter data mentioned in the above process are further explained. Figure 6 As shown, two types of defects are displayed from left to right. Among them, the defect type with defect number "4" is a pinhole, the level is the first level, the center position coordinates are (65.701mm, 0.23m), the length is 0.17mm, the width is 0.25mm, and the area is 0.04mm 2 , the aspect ratio is 1. The defect type of the defect number "5" is a circle, the level is the first level, the center position coordinates are (57.827mm, 0.5m), the length is 10.41mm, the width is 10.24mm, and the area is 85.12mm 2 , the aspect ratio is 0, making the defect detection results more intuitive.
[0130] After the defects in the defective pixel area are classified into grades, it also includes:
[0131] S8: Traverse each defective pixel area, take each defective pixel area as the center, and determine whether the defective pixel area overlaps with other defective pixel areas in a spatial area with a preset number of pixels (such as 50 pixels) expanding outward from the center. If so, merge the overlapping defective pixel areas, otherwise, do not merge them, so that the defective pixel areas are clearer.
[0132] like Figure 7 As shown, in order to better implement the above method, in another embodiment of the present invention, a lithium battery diaphragm defect detection system is provided, including: a first acquisition module 201, a second acquisition module 202, a third acquisition module 203, a fuzzy calculation module 204, a defective pixel area division module 205, and a defect parameter acquisition module 206.
[0133] The first acquisition module 201 is used to determine the diaphragm area in the original image according to the first value of the original image of the lithium battery diaphragm.
[0134] In the embodiment, first, the acquisition of the original image of the lithium battery diaphragm can be acquired based on the visual inspection equipment of the machine vision. The first acquisition module 201 includes a CCD industrial camera, and the original image of the lithium battery diaphragm is acquired by the CCD industrial camera. For the original image of the lithium battery diaphragm that has been collected, the original image of the lithium battery diaphragm can be a color image or a grayscale image. Therefore, in this embodiment, the first value can be one of the following: the pixel value of the original image of the lithium battery diaphragm; the grayscale value of the original image of the lithium battery diaphragm. Of course, the first value of the original image is not limited to this, and other values of the original image can also be used as the first value.
[0135] Specifically, in this embodiment, if the original image of the lithium battery diaphragm is a color image, the first value of the original image of the lithium battery diaphragm is a pixel value; if the original image of the lithium battery diaphragm is a grayscale image, the first value of the original image of the lithium battery diaphragm is a grayscale value. Determining the diaphragm area in the original image corresponds to the implementation process of the lithium battery diaphragm defect detection method in the aforementioned embodiment, which will not be repeated here.
[0136] The second acquisition module 202 is used to generate a first distribution map of the original image, and determine a second distribution map corresponding to the diaphragm area on the first distribution map. In specific implementation, the first distribution map is an average grayscale distribution map, and the second distribution map is an average grayscale distribution map of the diaphragm corresponding to the diaphragm area determined on the average grayscale distribution map, which corresponds to the implementation process in the lithium battery diaphragm defect detection method in the aforementioned embodiment, and will not be repeated here.
[0137] The third acquisition module 203 is used to obtain the first threshold and the second threshold of the diaphragm area according to the second distribution map corresponding to the diaphragm area. The specific execution process of the third acquisition module 203 corresponds to the implementation process in the lithium battery diaphragm defect detection method in the aforementioned embodiment, and will not be repeated here.
[0138] The fuzzy calculation module 204 is used to perform fuzzy calculation of the diaphragm defects according to the first threshold and the second threshold, and determine the defective pixels in the diaphragm area according to the fuzzy calculation results of the diaphragm defects. The specific execution process of the fuzzy calculation module 204 corresponds to the implementation process in the lithium battery diaphragm defect detection method in the aforementioned embodiment, and will not be repeated here.
[0139] The defective pixel region division module 205 is used to traverse the defective pixels and divide the defective pixel regions based on the pixel connected domain rule. The specific execution process of the defective pixel region division module 205 corresponds to the implementation process of the lithium battery diaphragm defect detection method in the aforementioned embodiment, and will not be repeated here.
[0140] The defect parameter acquisition module 206 is used to acquire defect parameter data according to the defect pixel area. The specific execution process of the defect parameter acquisition module 206 corresponds to the implementation process of the lithium battery diaphragm defect detection method in the above embodiment, and will not be repeated here.
[0141] like Figure 8 As shown, the present embodiment proposes yet another lithium battery diaphragm defect detection system, which, in addition to the system structure components proposed in the aforementioned embodiments: a first acquisition module 201, a second acquisition module 202, a third acquisition module 203, a fuzzy calculation module 204, a defective pixel area division module 205, and a defect parameter acquisition module 206, also includes: a defect level category division module 207 and a defective pixel area merging module 208.
[0142] The defect level classification module 207 is used to classify defects in the defective pixel area according to the defect parameter data;
[0143] The defective pixel area merging module 208 is used to traverse each defective pixel area, and with each defective pixel area as the center, determine whether the defective pixel area overlaps with other defective pixel areas in a spatial area with a preset number of pixel points (such as 50) expanding outward from the center. If so, the overlapping defective pixel areas are merged, otherwise, they are not merged.
[0144] This embodiment also proposes a computer device, see Fig. 9 The computer device includes a memory 101, a processor 102, and a computer program stored in the memory 101 and running on the processor 102, wherein when the processor 102 executes the computer program, the following steps are implemented: according to the first value of the original image of the lithium battery diaphragm, the diaphragm area in the original image is determined; a first distribution map of the original image is generated, and a second distribution map corresponding to the diaphragm area is determined on the first distribution map; according to the second distribution map corresponding to the diaphragm area, a first threshold and a second threshold of the diaphragm area are obtained; according to the first threshold and the second threshold, a fuzzy calculation of the diaphragm defect is performed, and according to the fuzzy calculation result of the diaphragm defect, the defective pixels in the diaphragm area are determined; the defective pixels are traversed, and the defective pixel area is divided based on the pixel connected domain rule; according to the defective pixel area, defect parameter data is obtained.
[0145] Specifically, in this embodiment, the processor 102 may include a central processing unit (CPU) equipped with a host computer software. The host computer software collects the original image on the current lithium battery diaphragm production line in real time, obtains the grayscale distribution information of the original diaphragm image and the high and low thresholds of the diaphragm defects, segments the diaphragm defects and the background according to the threshold fuzzy calculation method, outputs the defect parameter information using the image eight-connected domain rule, and classifies and grades the defects and performs adjacent merging processing, and finally displays the defect data in real time on the host computer software interface. Fig.10 A schematic diagram showing the real-time data display of defect parameters on the upper computer software interface, which can be uploaded to the database for storage, making it easy to view historical data. Fig.11 A schematic diagram showing the display of historical data of defect parameters proposed in an embodiment of the present invention on a host computer software interface. The processor 102 may also be a graphics processing unit (GPU), an image signal processor (ISP), a controller, a video codec, etc. equipped with a host computer and software.
[0146] The memory 101 may include a large capacity memory for data or instructions. It may include a hard disk drive (HDD), a floppy disk drive, a flash memory, an optical disk, a magneto-optical disk, a magnetic tape, or a universal serial bus (USB) drive or a combination of two or more of these. In appropriate cases, the memory 101 may include a removable or non-removable (or fixed) medium. In appropriate cases, the memory 101 may be inside or outside the integrated gateway disaster recovery device. In a specific embodiment, the memory 101 is a non-volatile solid-state memory.
[0147] The controller can generate operation control signals according to the instruction operation code and timing signal to complete the control of instruction fetching and execution.
[0148] The memory 101 may include a read-only memory (ROM), a random access memory (RAM), a disk storage medium device, an optical storage medium device, a flash memory device, an electrical, optical or other physical / tangible memory storage device. Therefore, generally, the memory includes one or more tangible (non-transitory) computer-readable storage media (e.g., a memory device) encoded with software including computer executable instructions, and when the software is executed (e.g., by one or more processors), it is operable to perform the steps of implementing the diaphragm defect detection method provided in the present application. It is understood that the structural composition illustrated in the embodiment of the present invention does not constitute a specific limitation on the structure of the computer device.
[0149] Obviously, the above embodiments of the present invention are only examples for clearly illustrating the present invention, and are not intended to limit the embodiments of the present invention. For those skilled in the art, other different forms of changes or modifications can be made based on the above description. It is not necessary and impossible to list all the embodiments here. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the protection scope of the claims of the present invention.
Claims
1. A method for detecting defects in a lithium battery separator, characterized in that: The following steps are involved: Determine a diaphragm region in the original image according to a first value of the original image of the lithium battery diaphragm; Generate a first distribution map of the original image, and determine a second distribution map corresponding to the diaphragm area on the first distribution map; use the number of columns of pixel points of the original image as the abscissa and the average first value of each column of pixel points as the ordinate to generate the first distribution map of the original image; According to the second distribution map corresponding to the diaphragm area, a first threshold value and a second threshold value of the diaphragm area are obtained; wherein the first distribution map is an average grayscale distribution map, the second distribution map is an average grayscale distribution map of the diaphragm corresponding to the diaphragm area determined on the average grayscale distribution map, the first threshold value is a high grayscale threshold value on the average grayscale distribution map of the diaphragm corresponding to the diaphragm area, and the second threshold value is a low grayscale threshold value on the average grayscale distribution map of the diaphragm corresponding to the diaphragm area; Performing fuzzy calculation of the diaphragm defect according to the first threshold value and the second threshold value, and determining defective pixels in the diaphragm area according to the fuzzy calculation result of the diaphragm defect; Traversing the defective pixels, and dividing the defective pixel areas based on a pixel connected domain rule; Defect parameter data is obtained according to the defective pixel area.
2. The lithium battery separator defect detection method according to claim 1, characterized in that: The process of performing fuzzy calculation of the diaphragm defect according to the first threshold and the second threshold includes: Construct pixel judgment function; According to the first threshold and the second threshold, combined with the pixel judgment function, fuzzy calculation of the diaphragm defect is performed to obtain the fuzzy calculated pixel value of each pixel point in the diaphragm area.
3. The lithium battery separator defect detection method according to claim 2, characterized in that: The calculation expression for fuzzy calculation of diaphragm defects is: Where d(x) represents the fuzzy calculated pixel value of each pixel in the diaphragm area after the fuzzy calculation of the diaphragm defect, x represents the pixel value of any pixel in the diaphragm area, High Th Indicates the first threshold of the diaphragm area obtained according to the second distribution map corresponding to the diaphragm area, Low Th represents the second threshold of the diaphragm area obtained according to the second distribution map corresponding to the diaphragm area; f(x) represents the constructed pixel judgment function; Among them, the expression of f(x) is: Among them, x i,j represents the pixel at the i-th row and j-th column in the diaphragm area, x i-1,j represents the pixel at the i-1th row and jth column of the diaphragm area, x i+1,j represents the pixel at the i+1th row and jth column in the diaphragm area, x i,j-1 represents the pixel at the i-th row and j-1-th column of the diaphragm area, x i,j+1 The pixel representing the pixel at the i-th row and j+1-th column in the diaphragm region; The pixel points in the diaphragm region whose fuzzy calculated pixel values are 255 are determined as defective pixels.
4. The lithium battery separator defect detection method according to claim 1, characterized in that: Traversing the defective pixels and dividing the defective pixel area based on the pixel connected domain rule, including: Traverse the pixels of the eight connected domains above, below, left, right, upper left, upper right, lower left, and lower right of each defective pixel; The adjacent defective pixels in the eight-connected domain are merged into the same defective pixel region.
5. The lithium battery separator defect detection method according to claim 4, characterized in that: The defect parameter data of each defective pixel area at least includes: the center position coordinates of the defective pixel area; the length of the defective pixel area; the width of the defective pixel area; the area of the defective pixel area; the aspect ratio of the defective pixel area; and the average first value of the defective pixel area.
6. The lithium battery separator defect detection method according to claim 5, characterized in that: According to the defective pixel area, the process of obtaining defect parameter data includes: Obtain the minimum bounding rectangle of each defective pixel area, and obtain the center position coordinates of each defective pixel area based on the minimum bounding rectangle; The length of the minimum circumscribed rectangle is used as the length of each defective pixel area, and the width of the minimum circumscribed rectangle is used as the width of each defective pixel area. According to the length and the width, the aspect ratio of the defective pixel area is calculated; The area of the minimum bounding rectangle is taken as the area of each defective pixel region.
7. The lithium battery separator defect detection method according to claim 1, characterized in that: The lithium battery separator defect detection method further includes: classifying defects in the defective pixel area into grade categories according to the defect parameter data; The process of classifying the defects in the defective pixel area according to the defect parameter data includes: Sorting the defective pixel regions according to their area values, and setting a plurality of area level preset values that increase in sequence, with the plurality of area level preset values respectively serving as level division boundaries; According to the level division boundaries, the sorted defective pixel areas are divided into multiple levels; Classifying the defects into pinholes and dark defects according to the size of the average first value of the defective pixel area; On the basis of the defect being classified as a dark defect, if the area of the defective pixel region is greater than a first preset value, the defect is classified as a black spot; if the area of the defective pixel region is less than or equal to the first preset value, the defect is classified as a black dot; The defect whose aspect ratio of the defective pixel region is greater than a second preset value is classified as a stripe.
8. The lithium battery separator defect detection method according to claim 7, characterized in that: After the defects in the defective pixel area are classified into grade categories, the method further includes: traversing each defective pixel area, taking each defective pixel area as the center, and judging whether the defective pixel area overlaps with other defective pixel areas in a spatial area with a preset number of pixel points expanding outward from the center; if so, merging the overlapping defective pixel areas, otherwise, not merging them.
9. A lithium battery diaphragm defect detection system, characterized in that: include: A first acquisition module, used to determine the diaphragm area in the original image according to the first value of the original image of the lithium battery diaphragm; A second acquisition module is used to generate a first distribution map of the original image, and determine a second distribution map corresponding to the diaphragm area on the first distribution map; the first distribution map of the original image is generated by taking the number of columns of pixel points of the original image as the horizontal coordinate and the average first value of the pixel points in each column as the vertical coordinate; A third acquisition module is used to acquire a first threshold value and a second threshold value of the diaphragm area according to a second distribution map corresponding to the diaphragm area; wherein the first distribution map is an average grayscale distribution map, the second distribution map is an average grayscale distribution map of the diaphragm corresponding to the diaphragm area determined on the average grayscale distribution map, the first threshold value is a high grayscale threshold value on the average grayscale distribution map of the diaphragm corresponding to the diaphragm area, and the second threshold value is a low grayscale threshold value on the average grayscale distribution map of the diaphragm corresponding to the diaphragm area; A fuzzy calculation module, used for performing fuzzy calculation of the diaphragm defect according to the first threshold value and the second threshold value, and determining defective pixels in the diaphragm area according to the fuzzy calculation result of the diaphragm defect; A defective pixel region division module is used to traverse the defective pixels and divide the defective pixel regions based on the pixel connected domain rule; The defect parameter acquisition module is used to acquire defect parameter data according to the defect pixel area.
10. The lithium battery separator defect detection system according to claim 9, characterized in that: The system further comprises: A defect level classification module is used to classify defects in defective pixel areas according to the defect parameter data; The defective pixel area merging module is used to traverse each defective pixel area, take each defective pixel area as the center, and determine whether the defective pixel area overlaps with other defective pixel areas in a spatial area with a preset number of pixel points expanding outward from the center. If so, the overlapping defective pixel areas are merged, otherwise, they are not merged.
11. A computer device, characterized in that: The method comprises a memory and a processor, wherein a computer program is stored in the memory, and when the computer program is executed by the processor, the processor executes the method according to any one of claims 1 to 8.
12. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores instructions, and when the instructions are executed on a computer, the computer executes the method according to any one of claims 1 to 8.
Citation Information
Patent Citations
Battery diaphragm surface defect detection method and system
CN113030093A
Cloth area defect identification method
CN115330770A
Diaphragm defect detection method and system
CN117557544A