A surface defect detection method for hard carbon negative electrode materials for sodium batteries
By analyzing the various regularities of the surface images of hard carbon negative electrode materials in sodium battery, the problem of excessive segmentation of the watershed algorithm in defect detection is solved, and more accurate surface defect detection and evaluation is achieved.
Patent Information
- Application Number
- CN202411720544.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-28
- Publication Date
- 2025-02-07
- Estimated Expiration
- 2044-11-28
AI Technical Summary
When the prior art uses a watershed algorithm to detect surface defects of sodium battery hard carbon negative electrode materials, it is easy to cause excessive segmentation due to the disorder of the material surface and the hollow structure, which reduces the accuracy of defect detection.
By acquiring the surface image of the material, analyzing its edge distribution rules, grayscale distribution rules, blocking rules and pixel rules, combining these rules to determine the final image regularity, thereby dividing the defect area and evaluating its surface defect degree.
The accuracy of the watershed algorithm in the detection of surface defects of hard carbon negative electrode materials is improved, and the surface defects of the material can be more accurately evaluated, and is suitable for hard carbon materials prepared by a variety of precursors.
Smart Images

Figure CN119205779B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of defect detection, and in particular to a surface defect detection method for a hard carbon negative electrode material of a sodium battery. Background Art
[0002] Sodium-ion batteries have the advantages of good low-temperature performance and high safety, so they have attracted widespread attention in the industry. Hard carbon has a rich disordered structure and a larger interlayer distance, which is very conducive to the intercalation of sodium ions and is one of the most promising negative electrode materials. The precursors for preparing hard carbon include bamboo, coconut shells, ganoderma lucidum residue, etc. Different biomasses will have obvious differences in microstructure, morphology, and defects after carbonization. In order to ensure good battery performance, it is often necessary to perform surface defect detection on hard carbon negative electrode materials.
[0003] The defects of hard carbon negative electrode materials for sodium batteries mainly include impurities caused by low-purity materials, vacancies and structural defects caused by process manufacturing, etc. The current method for surface defect detection uses a watershed algorithm to determine the missing area. However, since the surface of the material is disordered and has a normal pore structure, the use of the watershed algorithm usually results in over-segmentation, making the defect detection accuracy insufficient. In addition, the difference in precursors will lead to inconsistent detection processes, and there is a lack of a unified method for surface defect detection of hard carbon negative electrode materials. Summary of the invention
[0004] In order to solve the technical problem that the watershed algorithm usually causes over-segmentation, resulting in insufficient accuracy of defect detection, the purpose of the present invention is to provide a surface defect detection method for hard carbon negative electrode materials for sodium batteries. The technical solution adopted is as follows:
[0005] In a first aspect, an embodiment of the present invention provides a method for detecting surface defects of a hard carbon negative electrode material for a sodium battery, the method comprising:
[0006] Obtain material surface images of hard carbon negative electrode materials for sodium batteries;
[0007] Determining the overall regularity of the material surface image according to the edge distribution law and the grayscale distribution law of the material surface image;
[0008] Determining the block regularity of the material surface image according to the grayscale variation rules between local areas of different sizes in the material surface image;
[0009] Determine the pixel regularity of each pixel in the material surface image according to the number of times the pixel in the material surface image is submerged and the number of submerged pixels in the recursive process of the watershed algorithm;
[0010] Combining the overall regularity, the block regularity and the pixel regularity, determining the final regularity of the material surface image;
[0011] A defective area is divided from the material surface image based on the final regularity, and the surface defect degree of the defective area in the material surface image is determined.
[0012] Preferably, determining the overall regularity of the material surface image according to the edge distribution law and the grayscale distribution law of the material surface image comprises:
[0013] Analyzing the edge distribution regularity of the material surface image to determine the degree of edge distribution regularity of the material surface image;
[0014] Analyzing the grayscale distribution of the material surface image to determine the grayscale distribution of the material surface image;
[0015] The product of the edge distribution regularity and the grayscale distribution regularity is taken as the overall regularity of the material surface image.
[0016] Preferably, analyzing the edge distribution regularity of the material surface image and determining the degree of edge distribution regularity of the material surface image comprises:
[0017] Continuously adjusting the gradient threshold of the sobel operator during edge detection, performing multiple edge detections on the material surface image, and obtaining an edge image each time the adjustment is made; wherein the edge image includes edge lines and edge points on the edge lines;
[0018] For any edge image, a histogram of the edge point number interval-edge line number is constructed according to the number of edge points on the edge line;
[0019] For each edge line in any edge image, obtain the distance between each edge line and the corresponding nearest edge line, recorded as the first distance; and construct a first distance interval-edge line number histogram according to the first distance of the edge line;
[0020] The degree of edge distribution regularity of the material surface image is determined according to the distribution of the edge point quantity interval-edge line quantity histogram and the first distance interval-edge line quantity histogram of all edge images.
[0021] Preferably, analyzing the grayscale distribution regularity of the material surface image and determining the grayscale distribution regularity degree of the material surface image comprises:
[0022] According to different kernel sizes, the material surface image is expanded multiple times to obtain an expanded image with the smallest color difference among all color blocks in the expanded image as a target grayscale expanded image;
[0023] Taking any color block in the target grayscale dilation image as the target color block, obtaining the color blocks adjacent to the target color block, and recording them as the adjacent color blocks of the target color block; arranging the grayscale values of the adjacent color blocks of the target color block in descending order, and obtaining the neighborhood grayscale sequence of the target color block;
[0024] Taking any gray value of the target gray expansion image corresponding to the material surface image as the target gray value, calculate the sum of the edit distances of the neighborhood gray sequences of any two color blocks under the target gray value as the level regularity value of the target gray value;
[0025] The negatively correlated normalized values of the level regularity values of all grayscale values in the target grayscale expansion image corresponding to the material surface image are summed to obtain the grayscale distribution regularity degree of the material surface image.
[0026] Preferably, determining the block regularity of the material surface image according to the grayscale variation regularity between local areas of different sizes in the material surface image includes:
[0027] Increase the local window according to a certain ratio, obtain the number of pixel values of the pixel points in the local window area corresponding to the local window in different grayscale intervals, and construct a grayscale interval-pixel number sequence;
[0028] A local window of any size is used as a target local window, and the material surface image is divided by the target local window to obtain multiple local window areas; the mean of the edit distance of the grayscale interval-pixel number sequence corresponding to any two target local areas is obtained; the local window with the smallest mean of the edit distance is used as the structural window;
[0029] The block regularity of the material surface image is determined according to the grayscale variation regularity between the local areas corresponding to the structure windows in the material surface image.
[0030] Preferably, determining the block regularity of the material surface image according to the grayscale variation law between local areas corresponding to the structure windows in the material surface image comprises:
[0031] Calculate the mean of the edit distance of the grayscale interval-pixel number sequence of the local area corresponding to each two structure windows in the material surface image, recorded as the first mean;
[0032] Taking any structure window as the target structure window, calculating the mean value of the edit distance between the target structure window and each other structure window in the material surface image as the distance value of the target structure window;
[0033] The negative correlation normalized value of the difference between the distance value corresponding to the target structure window in the material surface image and the first mean is used as the block regularity of the material surface image.
[0034] Preferably, determining the pixel regularity of each pixel in the material surface image according to the number of times the pixel in the material surface image is submerged and the number of submerged pixels in the recursive process of the watershed algorithm comprises:
[0035] The gray value of the pixel in the material surface image is used as the altitude, and the pixel with the lowest altitude is recorded as the starting point;
[0036] Using the watershed algorithm from the starting point, taking any pixel as the target pixel, obtain the number of times the target pixel is submerged in the recursive process of the watershed algorithm, and the total number of pixels submerged from the starting point closest to the target pixel to the time when the target pixel is submerged;
[0037] The number of times the target pixel is submerged in the recursive process of the watershed algorithm is taken as the numerator, the total number of recursions of the watershed algorithm is taken as the denominator, and the ratio of the numerator and the denominator is taken as the first regularity;
[0038] The negative correlation mapping value of the total number of pixels submerged from the starting point closest to the target pixel to the target pixel when the pixel is submerged is taken as the second regularity;
[0039] The pixel regularity of the target pixel point is determined by combining the first regularity and the second regularity.
[0040] Preferably, combining the overall regularity, the block regularity and the pixel regularity to determine the final regularity of the material surface image includes:
[0041] The normalized value of the product of the overall regularity, the block regularity and the pixel regularity is used as the final regularity of the material surface image.
[0042] Preferably, dividing the defect area from the material surface image based on the final regularity includes:
[0043] Pixels whose final regularity is less than a preset regularity threshold are regarded as defective pixels, and the defective pixels constitute a defective area.
[0044] Preferably, determining the surface defect degree of the defective area in the material surface image comprises:
[0045] Taking any defect area as the target defect area, the product value of the negative correlation mapping value of the grayscale mean of the target defect area and the number of pixels in the target defect area is calculated as the regional defect degree of the target defect area; the normalized value of the sum of the regional defect degrees of all defect areas is taken as the surface defect degree of the defect area in the material surface image.
[0046] In a second aspect, a surface defect detection system for hard carbon negative electrode materials of sodium batteries is provided, the system comprising the following modules:
[0047] An image acquisition module, used to obtain a material surface image of a hard carbon negative electrode material of a sodium battery;
[0048] An overall analysis module, used to determine the overall regularity of the material surface image according to the edge distribution law and grayscale distribution law of the material surface image;
[0049] A block analysis module, used to determine the block regularity of the material surface image according to the grayscale variation rules between local areas of different sizes in the material surface image;
[0050] A pixel analysis module, used to determine the pixel regularity of each pixel in the material surface image according to the number of times the pixel in the material surface image is submerged and the number of submerged pixels in the recursive process of the watershed algorithm;
[0051] A regularity analysis module, used for combining the overall regularity, the block regularity and the pixel regularity to determine the final regularity of the material surface image;
[0052] The defect determination module is used to divide the defect area from the material surface image based on the final regularity and determine the surface defect degree of the defect area in the material surface image.
[0053] In a third aspect, an embodiment of the present invention provides an electronic device, including a memory and a processor, wherein the memory stores executable code, and when the processor executes the executable code, various possible embodiments of the first aspect are implemented.
[0054] In a fourth aspect, an embodiment of the present invention provides a computer program product, which includes: a computer program code, which, when executed on a computer, enables the computer to execute the method in the first aspect or any possible implementation of the first aspect.
[0055] In a fifth aspect, an embodiment of the present invention provides a computer-readable storage medium having a computer program stored thereon, which, when executed in a computer, enables the computer to execute various possible implementations of the first aspect.
[0056] The embodiments of the present invention have at least the following beneficial effects:
[0057] The present invention aims to solve the problem of easy over-segmentation due to the disorder and void structure of the material surface when using the watershed algorithm to detect the surface defects of hard carbon negative electrode materials. The present invention analyzes the material surface image, determines the defect performance of the image, area and pixel respectively from the overall material surface image to the structural area to the pixel level, and finally fuses them to obtain the degree of surface defects of the material, and accurately evaluates the surface defects of the material, which is beneficial to the surface defect detection of hard carbon negative electrode materials for sodium batteries. In addition, the present method does not analyze the structure of a specific material, but characterizes the material structure through characteristics such as grayscale distribution, so that hard carbon materials prepared from a variety of precursors can use the present method, which improves the applicability of surface defect detection of hard carbon negative electrode materials. The present invention improves the accuracy of defect detection using the watershed algorithm and improves the applicability of surface defect detection methods for hard carbon negative electrode materials prepared from a variety of precursors. BRIEF DESCRIPTION OF THE DRAWINGS
[0058] In order to more clearly illustrate the technical solutions and advantages in the embodiments of the present invention or the prior art, the drawings required for use in the embodiments or the prior art descriptions are briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0059] Figure 1 A method flow chart of a surface defect detection method for a hard carbon negative electrode material for a sodium battery provided by an embodiment of the present invention;
[0060] Figure 2 A scanning electron microscope image of a coconut shell-based hard carbon negative electrode material provided by one embodiment of the present invention;
[0061] Figure 3 A flowchart of the steps of obtaining the overall regularity of a material surface image provided by one embodiment of the present invention;
[0062] Figure 4 An embodiment of the present invention provides Figure 2 The dilated image after dilation with a 9×9 kernel. DETAILED DESCRIPTION
[0063] In order to further explain the technical means and effects adopted by the present invention to achieve the predetermined purpose of the invention, the surface defect detection method for hard carbon negative electrode materials of sodium batteries proposed by the present invention, its specific implementation method, structure, characteristics and effects are described in detail as follows in combination with the accompanying drawings and preferred embodiments.
[0064] In the following description, different "one embodiment" or "another embodiment" do not necessarily refer to the same embodiment. In addition, specific features, structures or characteristics in one or more embodiments may be combined in any suitable form.
[0065] Among them, in the description of the embodiments of the present invention, unless otherwise specified, " / " means or, for example, A / B can mean A or B: "and / or" in the text is only a way to describe the association relationship of associated objects, indicating that there can be three relationships, for example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. In addition, in the description of the embodiments of the present invention, "multiple" refers to two or more than two.
[0066] In the following, the terms "first" and "second" are used for descriptive purposes only and are not to be understood as suggesting or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of the features.
[0067] Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention belongs.
[0068] The embodiments of the present invention are described below in conjunction with the accompanying drawings. Those skilled in the art will appreciate that, with the development of technology and the emergence of new scenarios, the technical solutions provided by the embodiments of the present invention are also applicable to similar technical problems.
[0069] The embodiment of the present invention provides a specific implementation method for a surface defect detection method for a sodium battery hard carbon negative electrode material, which is applicable to the scenario of surface defect detection for a sodium battery hard carbon negative electrode material. It solves the problem of easy over-segmentation due to the disorder and void structure of the material surface when using the watershed algorithm to detect surface defects of hard carbon negative electrode materials. It improves the accuracy of defect detection using the watershed algorithm and improves the applicability of surface defect detection methods for preparing hard carbon negative electrode materials using a variety of precursors.
[0070] The following is a detailed description of a specific method for detecting surface defects of a hard carbon negative electrode material for a sodium battery provided by the present invention in conjunction with the accompanying drawings.
[0071] See also Figure 1 , which shows a flow chart of the steps of a surface defect detection method for a sodium battery hard carbon negative electrode material provided by an embodiment of the present invention, the method comprising the following steps:
[0072] Step S100, obtaining a material surface image of a sodium battery hard carbon negative electrode material.
[0073] The material surface of the sodium battery hard carbon negative electrode material is scanned using a scanning electron microscope to obtain a material surface image. The material surface image is a grayscale image. As a preferred embodiment of the present invention, after obtaining the material surface image, the image can also be preprocessed, such as denoising and other preprocessing operations.
[0074] The defects on the surface of the material are characterized by structural defects and impurities. Structural defects are regional anomalies. Under an electron microscope, structural defects are manifested as color blocks in the structural defect part that are different from those in the normal area. The normal area is randomly distributed by blocks of different grayscales, while the structural defect part is manifested as a single low-grayscale area. The structural defect part has significant differences in edge distribution and grayscale distribution from the normal area. Therefore, in the embodiment of the present invention, the overall regularity of the material surface image is determined by analyzing the edge distribution law and grayscale distribution law in the material surface image.
[0075] By analyzing the grayscale distribution and edge characteristics of the entire image, the regularity of the entire image can be quantified. Structural loss is a regional structural loss. By analyzing the similarity of the grayscale distribution of different regions, the smallest region that is most suitable for characterizing the surface structure of the material can be traversed. That is, the grayscale distribution of this smallest region can be used to obtain the structural characteristics of the entire material, and the regularity of the image segmentation can be obtained by determining whether the region conforms to the structural characteristics. Then, in order to make defect detection more accurate, pixel analysis should also be performed. The small impurities and structural missing pixels that are defects are more prominent in grayscale.
[0076] Step S200, determining the overall regularity of the material surface image according to the edge distribution regularity and grayscale distribution regularity of the material surface image.
[0077] See also Figure 2 , Figure 2 This is a scanning electron microscope image (SEM image) of coconut shell-based hard carbon negative electrode material. Coconut shell-based hard carbon has a well-developed pore structure, low ash content and low H / C and O / C ratios. It is an ideal negative electrode material, with an early industrialization progress and good performance.
[0078] See also Figure 2It can be found that the material surface image of the hard carbon negative electrode material of the sodium battery is disordered, there are irregularly distributed material particles, and the surface is uneven. Therefore, in order to make the overall grayscale distribution of the image more significant, the image can be expanded, and the grayscale distribution regularity of the overall image can be determined by the grayscale distribution of pixel blocks in the neighborhood of similar grayscale pixel blocks. In addition, the overall regularity of the material is also reflected in the relationship between edges during image edge detection. The threshold of edge detection can be traversed, and the overall edge distribution regularity of the image can be determined by the change of edges, the distance between edges, etc.
[0079] The grayscale distribution law can also be reflected by the grayscale distribution relationship and grayscale difference between grayscale blocks of the same grayscale and between adjacent grayscale blocks after the grayscale expansion of the image. The overall regularity of the material surface image can be determined by combining the edge distribution law and grayscale distribution law of the material surface image.
[0080] See also Figure 3 , Figure 3 A flowchart of the steps to obtain the overall regularity of the material surface image, specifically:
[0081] Step S210, analyzing the edge distribution regularity of the material surface image to determine the degree of edge distribution regularity of the material surface image.
[0082] (1) Continuously adjusting the gradient threshold of the Sobel operator during edge detection, performing multiple edge detections on the material surface image, and obtaining an edge image each time the adjustment is made; wherein the edge image includes edge lines and edge points on the edge lines.
[0083] In some embodiments, the Sobel operator is used, the initial threshold of the gradient is set to 255, the initial threshold of the gradient is decreased in steps of 8, and 0 is used as the final threshold. The threshold of the gradient of the Sobel operator during edge detection is continuously adjusted, and edge detection is performed on the material surface image to obtain several continuous edge images of the material surface image. It can be understood that each edge image contains at least one edge line. The number of pixels contained in several edges of any edge image and the coordinates of all pixels are obtained.
[0084] By analyzing the distance difference and the number of pixel points of each edge line on the continuously acquired edge images, the degree of edge distribution regularity of the material surface image is determined.
[0085] (2) For any edge image, a histogram of the number of edge points interval-number of edge lines is constructed based on the number of edge points on the edge line.
[0086] For any edge image, the coordinates of the central pixel point of any edge line are used as the coordinates of the edge line, and the distance between the coordinates of any two edge lines is obtained;
[0087] For any edge image, take every 5 pixels as an edge point number interval, obtain the number of edge lines in each edge point number interval, and establish a histogram of edge point number interval-edge line number; wherein the horizontal axis of the histogram of edge point number interval-edge line number is the edge point number interval, such as [1,5], [6,10], [11,15]; the vertical axis is the number of edge lines in the edge point number interval. For example, when the number of edge points on one edge line is 5 and the number of edge points on another edge line is 3, then these two edge lines belong to the first edge point number interval [1,5], and the corresponding number of edge lines in the edge point number interval is 2.
[0088] (3) For each edge line in any edge image, obtain the distance between the nearest edge lines corresponding to each edge line, recorded as the first distance; based on the first distance of the edge line, construct a first distance interval-edge line number histogram.
[0089] Take any edge line as the target edge line, record the edge line closest to the target edge line among all edge lines except the target edge line as the nearest edge line of the target edge line, and record the distance between each edge line and the corresponding nearest edge line as the first distance.
[0090] For any edge image, obtain the nearest edge line and the corresponding first distance of all edge lines, take every 5 values as a first distance interval, obtain the number of edges in any first distance interval, and establish a first distance interval-edge number histogram; wherein, the horizontal axis of the first distance interval-edge number histogram is the first distance interval, such as [1,5], [6,10], [11,15]; the vertical axis is the number of edge lines belonging to the first distance interval. For example, when the first distance corresponding to one edge line is 5 and the first distance corresponding to another edge line is 3, then these two edge lines belong to the first first distance interval [1,5], and the corresponding number of edge lines belonging to the first distance interval is 2.
[0091] (4) Determining the degree of edge distribution regularity of the material surface image based on the distribution of the edge point quantity interval-edge line quantity histogram and the first distance interval-edge line quantity histogram of all edge images.
[0092] Analyze the regularity of edge distribution of the material surface image. The more concentrated the edge number distribution of the edge point number interval-edge line number histogram and the first distance interval-edge line number histogram is, the stronger the regularity of edge distribution is. Obtain the maximum value point of the edge point number interval-edge line number histogram and the first distance interval-edge line number histogram. The value of the maximum value point is greater than the value corresponding to both the left adjacent interval and the right adjacent interval.
[0093] The calculation formula of the marginal distribution regularity degree G is: ; Wherein, J is the number of edge images; exp is an exponential function with a natural constant as the base; is the ratio of the edge point number interval of the j-th edge image to the edge line number histogram in which the edge point number interval is greater than 0; is the proportion of the first distance interval in which the number of edge lines is greater than 0 in the first distance interval-edge line number histogram of the j-th edge image; is the sum of the number of edge lines corresponding to all maximum values in the edge point number interval-edge line number histogram of the j-th edge image; is the sum of the number of edge lines corresponding to all the maximum values in the first distance interval-edge line number histogram of the j-th edge image; is the sum of the number of edge lines in the jth edge image.
[0094] The more concentrated the number of pixels and the first distance of the edge point number interval-edge line number histogram and the first distance interval-edge line number histogram, and the more edges corresponding to the maximum values, the more regular the edge distribution and the more regular the edge size changes.
[0095] Step S220, analyzing the grayscale distribution regularity of the material surface image to determine the degree of grayscale distribution regularity of the material surface image.
[0096] Analyze the grayscale distribution law of the material surface image, expand the grayscale of the image, and calculate the grayscale distribution relationship and grayscale difference between grayscale blocks of the same grayscale and adjacent grayscale blocks.
[0097] According to different kernel sizes, the material surface image is expanded multiple times to obtain the expanded image with the smallest color difference of all color blocks in the expanded image after expansion, which is used as the target grayscale expanded image. Specifically: set the kernel size, starting with 3×3, with 2 as the step size, and with 15×15 as the cutoff size, and perform grayscale expansion on the material surface image several times. Each grayscale expansion can obtain several color blocks of the same grayscale. Please refer to Figure 4 For Figure 2 The expanded image after expansion with a 9×9 kernel; calculate the variance of the number of pixels of all color blocks in any expanded image, record the kernel with the smallest variance as the target kernel, and record the expanded image corresponding to the target kernel as the target grayscale expanded image of the material surface image. The grayscale relationship between each grayscale color block and the neighboring color block in the target grayscale expanded image can reflect the overall grayscale distribution regularity of the material surface image. It can be understood that the variance is used here to reflect the color difference of all color blocks in the expanded image.
[0098] Take any color block in the target grayscale dilation image as the target color block, obtain the color blocks adjacent to the target color block, record them as the adjacent color blocks of the target color block, and understandably take the color blocks in the eight neighborhoods around the target color block as the adjacent color blocks of the target color block; arrange the grayscale values of the adjacent color blocks of the target color block in descending order to obtain the neighborhood grayscale sequence of the target color block. Calculate the edit distance of the neighborhood grayscale sequence between any two color blocks with the same grayscale value.
[0099] Taking any gray value of the target gray expansion image corresponding to the material surface image as the target gray value, the sum of the edit distances of the neighborhood gray sequences of any two color blocks under the target gray value is calculated as the level regularity value of the target gray value. Thus, the level regularity values corresponding to all gray values of the target gray expansion image corresponding to the material surface image are determined. The larger the level regularity value corresponding to the gray value, the greater the color difference of the color block under the same gray value, the smaller the color similarity of the color block, and the smaller the corresponding gray distribution regularity.
[0100] The negatively correlated normalized values of the level regularity values of all grayscale values in the target grayscale expansion image corresponding to the material surface image are summed to obtain the grayscale distribution regularity degree of the material surface image.
[0101] Taking the sth grayscale value as the target grayscale value, the calculation formula of the grayscale distribution regularity degree Q is: ; Where S is the number of grayscale values in the target grayscale expansion image; exp is an exponential function with a natural constant as the base; M is the number of pairwise combinations of color blocks corresponding to the sth grayscale value in the target grayscale expansion image; is the edit distance of the neighborhood grayscale sequence between the mth pair of two-by-two color blocks corresponding to the sth grayscale value in the target grayscale dilation image; is the level regularity value corresponding to the sth grayscale value in the target grayscale dilation image.
[0102] Step S230: taking the product of the edge distribution regularity and the grayscale distribution regularity as the overall regularity of the material surface image. The edge distribution regularity and the grayscale distribution regularity together constitute the overall regularity of the material surface image.
[0103] Step S300, determining the block regularity of the material surface image according to the grayscale variation regularity between local areas of different sizes in the material surface image.
[0104] Different precursors have different hard carbon structures, but they all have the basic structure of hard carbon materials, such as spherical, linear or porous. Please refer to Figure 2The basic structure of hard carbon materials is an irregular polygon, and each basic structure has a similar grayscale distribution, which is brighter at the edge and darker inside. Therefore, the similarity of grayscale distribution can be used as an indicator to measure the similarity between structures. If the grayscale distribution of a block of any structure is less similar to that of the other blocks, the regularity of the block is weaker. At the same time, the preset window, when the grayscale distribution of all windows of the image is most similar, the window can best represent the basic structure of the material.
[0105] Increase the local window at a certain ratio, obtain the number of pixel values of the pixels in the local window area corresponding to the local window in different grayscale intervals, and construct a grayscale interval-pixel number sequence. Preset the local window, start from 3*3, increase the window with a step size of 2, and use half of the image width as the cutoff window size; take 8 grayscale as a grayscale interval, obtain the number of pixels contained in each grayscale interval in any local window, and obtain the grayscale interval-pixel number sequence of any local window. If there is no pixel in the grayscale interval in the sequence, the value of the corresponding sequence number is recorded as 0 instead of not recording. It should be noted that the order of the elements in the grayscale interval-pixel number sequence is sorted according to the size of the grayscale interval, and the number of pixels in the grayscale interval can be sorted in the order of the grayscale value corresponding to the grayscale interval from small to large.
[0106] A local window of any size is used as the target local window, and the material surface image is divided by the target local window to obtain multiple local window areas; the mean of the edit distance of the grayscale interval-pixel number sequence corresponding to any two target local areas is obtained; and the local window with the smallest mean of the edit distance is used as the structural window.
[0107] According to the grayscale variation law between the local areas corresponding to the structure windows in the material surface image, the block regularity of the material surface image is determined. In some embodiments, the method for obtaining the block regularity is: calculating the mean of the edit distance of the grayscale interval-pixel number sequence of the local areas corresponding to the two structure windows in the material surface image, recorded as the first mean; taking any structure window as the target structure window, calculating the mean of the edit distance between the target structure window and each other structure window in the material surface image as the distance value of the target structure window; taking the negative correlation normalized value of the difference between the distance value corresponding to the target structure window in the material surface image and the first mean as the block regularity of the material surface image.
[0108] The average edit distance between the target structure window and the remaining structure windows is subtracted from the average edit distance between all structure windows to indicate the difference in the grayscale distribution interval between the target structure window and the remaining structure windows relative to the whole. The larger the value, the greater the abnormality of the target structure window and the worse the block regularity.
[0109] The calculation formula of the block regularity H is: ; Wherein, exp is an exponential function with a natural constant as the base; V is the number of structural windows of the material surface image; is the edit distance between the target structure window and the vth structure window; is the distance value of the target structure window; is the first mean value corresponding to the material surface image.
[0110] Step S400, determining the pixel regularity of each pixel in the material surface image according to the number of times the pixel in the material surface image is submerged and the number of submerged pixels in the recursive process of the watershed algorithm.
[0111] The regularity of pixel points is reflected in the degree to which the pixel points are not structural defects. The speed at which the pixel points come into contact with "water" when recursively "watering" in the watershed algorithm can be used to obtain the degree to which the pixel points are structurally missing. Therefore, we first analyze the regularity of the blocks to which the pixel points belong to obtain the pixel regularity of the pixel points.
[0112] The grayscale value of the pixel in the material surface image is used as the altitude, and the pixel with the lowest altitude is recorded as the starting point. The lower the grayscale, the lower the altitude, and the more it conforms to the local minimum point of the image in the watershed algorithm. Therefore, the pixel with the lowest altitude is recorded as the starting point, and the watershed algorithm is used from the starting point, and the pixels with the same altitude are injected with water at the same time.
[0113] Using the watershed algorithm from the starting point, taking any pixel as the target pixel, the number of times the target pixel is submerged in the recursive process of the watershed algorithm and the total number of pixels submerged from the starting point closest to the target pixel to the time when the target pixel is submerged are obtained.
[0114] The number of times the target pixel is submerged in the recursive process of the watershed algorithm is taken as the numerator, the total number of recursions of the watershed algorithm is taken as the denominator, and the ratio of the numerator and the denominator is taken as the first regularity;
[0115] The negative correlation mapping value of the total number of pixels submerged from the starting point closest to the target pixel to the target pixel when the pixel is submerged is taken as the second regularity;
[0116] The pixel regularity of the target pixel is determined by combining the first regularity and the second regularity. In some embodiments, the product of the first regularity and the second regularity is used as the pixel regularity of the material surface image.
[0117] The calculation formula of pixel regularity P is: ; Wherein, t is the number of times the target pixel is submerged in the recursive process of the watershed algorithm; T is the total number of recursions of the watershed algorithm; exp is an exponential function with a natural constant as the base; M is the total number of pixels submerged from the starting point closest to the target pixel to the time when the target pixel is submerged; is the first regularity; The second regularity.
[0118] The later the pixel is submerged and the fewer pixels are submerged from the nearest starting point, the smaller the possibility that the pixel is a defect and the stronger the regularity.
[0119] Step S500, combining the overall regularity, the block regularity and the pixel regularity to determine the final regularity of the material surface image.
[0120] The regularity of the image can be obtained by fusing the regularity of the block to which the pixel belongs, the regularity of the entire image, and the pixel regularity corresponding to the pixel. In some embodiments, the normalized value of the product of the overall regularity, the block regularity, and the pixel regularity is used as the final regularity of the material surface image.
[0121] Step S600: dividing a defect area from the material surface image based on the final regularity, and determining the surface defect degree of the defect area in the material surface image.
[0122] The distribution of pixel regularity of pixels is analyzed. The more concentrated and the greater the number of pixels with weaker regularity, the higher the degree of surface defects of the image.
[0123] The pixel points whose final regularity is less than the preset regularity threshold are regarded as defective pixel points, and the defective pixel points constitute a defective area. Specifically: adjacent defective pixel points are merged into a defective area to obtain a plurality of defective areas of the material surface image. In the embodiment of the present invention, the value of the preset regularity threshold is 0.5, and in other embodiments, the implementer adjusts the value according to the actual situation.
[0124] After the defective area is divided from the material surface image, the surface defect degree of the defective area in the material surface image is determined. The more defective areas in the material surface image, the larger the range of each defective area, and the lower the grayscale mean, the deeper and more serious the defects on the material surface.
[0125] Taking any defect area as the target defect area, the product value of the negative correlation mapping value of the grayscale mean of the target defect area and the number of pixels in the target defect area is calculated as the regional defect degree of the target defect area; the normalized value of the sum of the regional defect degrees of all defect areas is taken as the surface defect degree of the defect area in the material surface image.
[0126] Taking the ath area as the target defect area as an example, the calculation formula of the surface defect degree Z is: ; Where A is the number of defective areas; is the grayscale mean of the a-th defect area; is the number of pixels in the ath defect area; norm is the normalization function; is the regional defect degree of the ath defect area.
[0127] As a preferred embodiment of the present invention, whether the sodium battery hard carbon negative electrode material is qualified can be determined based on the surface defect degree of the material surface image. When the surface defect degree is greater than the preset defect threshold, the sodium battery hard carbon negative electrode material is considered unqualified. In the embodiment of the present invention, the preset defect threshold value is 0.6, and in other embodiments, the implementer can adjust the value according to actual conditions.
[0128] An embodiment of the present invention provides a surface defect detection system for a sodium battery hard carbon negative electrode material, the system comprising:
[0129] An image acquisition module, used to obtain a material surface image of a hard carbon negative electrode material of a sodium battery;
[0130] An overall analysis module, used to determine the overall regularity of the material surface image according to the edge distribution law and grayscale distribution law of the material surface image;
[0131] A block analysis module, used to determine the block regularity of the material surface image according to the grayscale variation rules between local areas of different sizes in the material surface image;
[0132] A pixel analysis module, used to determine the pixel regularity of each pixel in the material surface image according to the number of times the pixel in the material surface image is submerged and the number of submerged pixels in the recursive process of the watershed algorithm;
[0133] A regularity analysis module, used for combining the overall regularity, the block regularity and the pixel regularity to determine the final regularity of the material surface image;
[0134] The defect determination module is used to divide the defect area from the material surface image based on the final regularity and determine the surface defect degree of the defect area in the material surface image.
[0135] Optionally, the transmission medium may be a wired link, such as but not limited to coaxial cable, optical fiber, and digital subscriber line, or a wireless link, such as but not limited to Wireless Fidelity (WIFI), Bluetooth, and mobile device network.
[0136] It should be noted that the device provided in the above embodiment is only illustrated by the division of the above functional modules. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the computer device can be divided into different functional modules to complete all or part of the functions described above.
[0137] An embodiment of the present invention provides a computer device. Exemplarily, the computer device includes: a memory, a processor, and a computer program stored in the memory and running on the processor, wherein when the processor executes the computer program, the computer device can execute any of the surface defect detection methods for sodium battery hard carbon negative electrode materials described above.
[0138] In addition, an embodiment of the present invention also protects a device, which may include a memory and a processor, wherein the memory stores an executable program code, and the processor is used to call and execute the executable program code to execute a surface defect detection method for a hard carbon negative electrode material for a sodium battery provided in an embodiment of the present invention.
[0139] The embodiment of the present invention can divide the functional modules of the device according to the above method example. For example, each functional module can be corresponded, or two or more functions can be integrated into one processing module. The above integrated module can be implemented in the form of hardware. It should be noted that the division of modules in this embodiment is schematic and is only a logical function division. There may be other division methods in actual implementation.
[0140] In the case of dividing each module according to each function, the device may also include a signal uploading module, a determining module, an adjusting module, etc. It should be noted that all relevant contents of each step involved in the above method embodiment can be referred to the functional description of the corresponding functional module, which will not be repeated here.
[0141] It should be understood that the device provided in the embodiment of the present invention is used to perform the above-mentioned surface defect detection method for hard carbon negative electrode materials of sodium batteries, and thus can achieve the same effect as the above-mentioned implementation method.
[0142] In the case of an integrated unit, the device may include a processing module and a storage module. When the device is applied to a device, the processing module may be used to control and manage the actions of the device. The storage module may be used to support the device to execute mutual program codes, etc. The processing module may be a processor or a controller, which may implement or execute various exemplary logic blocks, modules and circuits described in conjunction with the disclosure of the present invention. The processor may also be a combination that implements a computing function, such as a combination of one or more microprocessors, a combination of digital signal processing (DSP) and a microprocessor, etc. The storage module may be a memory.
[0143] In addition, the device provided in an embodiment of the present invention may specifically be a chip, a component or a module, and the chip may include a connected processor and a memory; wherein the memory is used to store instructions, and when the processor calls and executes the instructions, the chip can execute a surface defect detection method for sodium battery hard carbon negative electrode materials provided in the above embodiment.
[0144] An embodiment of the present invention also provides a computer-readable storage medium, which stores a computer program code. When the computer program code runs on a computer, the computer executes the above-mentioned related method steps to implement a surface defect detection method for sodium battery hard carbon negative electrode materials provided in the above embodiment.
[0145] An embodiment of the present invention also provides a computer program product. When the computer program product is run on a computer, the computer executes the above-mentioned related steps to implement a surface defect detection method for a sodium battery hard carbon negative electrode material provided in the above embodiment.
[0146] Among them, the device, computer-readable storage medium, computer program product or chip provided in the embodiments of the present invention are all used to execute the corresponding methods provided above. Therefore, the beneficial effects that can be achieved can refer to the beneficial effects in the corresponding methods provided above, and will not be repeated here. Through the description of the above implementation methods, technicians in the relevant field can understand that for the convenience and simplicity of description, only the division of the above-mentioned functional modules is used as an example. In actual applications, the above-mentioned functions can be assigned to different functional modules as needed, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above. In the embodiments provided by the present invention, it should be understood that the disclosed devices and methods can be implemented in other ways.
[0147] The device embodiments described above are merely illustrative. For example, the division of modules or units is only a logical function division. There may be other divisions in actual implementation. For example, multiple units or components may be combined or integrated into another device, 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 interfaces, indirect coupling or communication connection of devices or units, which may be electrical, mechanical or other forms.
[0148] It should also be noted that, in this article, the terms "include", "comprises" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or terminal device including a series of elements includes not only those elements, but also includes other elements not explicitly listed, or also includes elements inherent to such process, method, article or terminal device. In the absence of further restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, article or terminal device including the elements.
[0149] It should be noted that the sequence of the above embodiments of the present invention is for description only and does not represent the advantages and disadvantages of the embodiments. The processes depicted in the accompanying drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0150] The various embodiments in this specification are described in a progressive manner, and the same or similar parts between the various embodiments can be referenced to each other, and each embodiment focuses on the differences from other embodiments.
[0151] The above contents are only specific implementation modes of the present invention, but the protection scope of the present invention is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed by the present invention, which should be covered within the protection scope of the present invention.
Claims
1. A surface defect detection method for sodium battery hard carbon negative electrode materials, characterized in that: The method comprises the following steps: Obtain material surface images of hard carbon negative electrode materials for sodium batteries; Determining the overall regularity of the material surface image according to the edge distribution law and the grayscale distribution law of the material surface image; Determining the block regularity of the material surface image according to the grayscale variation rules between local areas of different sizes in the material surface image; Determining the pixel regularity of each pixel in the material surface image according to the number of times the pixel in the material surface image is submerged and the number of submerged pixels in the recursive process of the watershed algorithm; Combining the overall regularity, the block regularity and the pixel regularity, determining the final regularity of the material surface image; Dividing a defect area from the material surface image based on the final regularity, and determining the surface defect degree of the defect area in the material surface image; The method for obtaining the final regularity of the material surface image is as follows: taking the normalized value of the product of the overall regularity, the block regularity and the pixel regularity as the final regularity of the material surface image; The method for dividing the defective area is as follows: taking pixels whose final regularity is less than a preset regularity threshold as defective pixels, and forming the defective area with the defective pixels; Among them, the method for determining the surface defect degree of the defect area in the material surface image is: taking any defect area as the target defect area, calculating the product value of the negative correlation mapping value of the grayscale mean of the target defect area and the number of pixels in the target defect area as the regional defect degree of the target defect area; and taking the normalized value of the sum of the regional defect degrees of all defect areas as the surface defect degree of the defect area in the material surface image.
2. The surface defect detection method for sodium battery hard carbon negative electrode material according to claim 1, characterized in that: Determining the overall regularity of the material surface image according to the edge distribution law and the grayscale distribution law of the material surface image includes: Analyzing the edge distribution regularity of the material surface image to determine the degree of edge distribution regularity of the material surface image; Analyzing the grayscale distribution of the material surface image to determine the grayscale distribution of the material surface image; The product of the edge distribution regularity and the grayscale distribution regularity is taken as the overall regularity of the material surface image.
3. The surface defect detection method for sodium battery hard carbon negative electrode material according to claim 2, characterized in that: The analyzing the edge distribution regularity of the material surface image to determine the degree of edge distribution regularity of the material surface image includes: Continuously adjusting the gradient threshold of the sobel operator during edge detection, performing multiple edge detections on the material surface image, and obtaining an edge image each time the adjustment is made; wherein the edge image includes edge lines and edge points on the edge lines; For any edge image, a histogram of the edge point number interval-edge line number is constructed according to the number of edge points on the edge line; For each edge line in any edge image, obtain the distance between each edge line and the corresponding nearest edge line, recorded as the first distance; and construct a first distance interval-edge line number histogram according to the first distance of the edge line; The degree of edge distribution regularity of the material surface image is determined according to the distribution of the edge point quantity interval-edge line quantity histogram and the first distance interval-edge line quantity histogram of all edge images.
4. The surface defect detection method for sodium battery hard carbon negative electrode material according to claim 2, characterized in that: The analyzing the grayscale distribution regularity of the material surface image to determine the grayscale distribution regularity degree of the material surface image includes: According to different kernel sizes, the material surface image is expanded multiple times to obtain an expanded image with the smallest color difference among all color blocks in the expanded image as a target grayscale expanded image; Taking any color block in the target grayscale dilation image as the target color block, obtaining the color blocks adjacent to the target color block, and recording them as the adjacent color blocks of the target color block; arranging the grayscale values of the adjacent color blocks of the target color block in descending order, and obtaining the neighborhood grayscale sequence of the target color block; Taking any gray value of the target gray expansion image corresponding to the material surface image as the target gray value, calculate the sum of the edit distances of the neighborhood gray sequences of any two color blocks under the target gray value as the level regularity value of the target gray value; The negatively correlated normalized values of the level regularity values of all grayscale values in the target grayscale expansion image corresponding to the material surface image are summed to obtain the grayscale distribution regularity degree of the material surface image.
5. The surface defect detection method for sodium battery hard carbon negative electrode material according to claim 1, characterized in that: Determining the block regularity of the material surface image according to the grayscale variation regularity between local areas of different sizes in the material surface image includes: Increase the local window according to a certain ratio, obtain the number of pixel values of the pixel points in the local window area corresponding to the local window in different grayscale intervals, and construct a grayscale interval-pixel number sequence; A local window of any size is used as a target local window, and the material surface image is divided by the target local window to obtain multiple local window areas; the mean of the edit distance of the grayscale interval-pixel number sequence corresponding to any two target local areas is obtained; the local window with the smallest mean of the edit distance is used as the structural window; The block regularity of the material surface image is determined according to the grayscale variation regularity between the local areas corresponding to the structure windows in the material surface image.
6. The surface defect detection method for sodium battery hard carbon negative electrode material according to claim 5, characterized in that: Determining the block regularity of the material surface image according to the grayscale variation law between the local areas corresponding to the structure windows in the material surface image includes: Calculate the mean of the edit distance of the grayscale interval-pixel number sequence of the local area corresponding to each two structural windows in the material surface image, recorded as the first mean; Taking any structure window as the target structure window, calculating the mean value of the edit distance between the target structure window and each other structure window in the material surface image as the distance value of the target structure window; The negative correlation normalized value of the difference between the distance value corresponding to the target structure window in the material surface image and the first mean is used as the block regularity of the material surface image.
7. The surface defect detection method for sodium battery hard carbon negative electrode material according to claim 1, characterized in that: Determining the pixel regularity of each pixel in the material surface image according to the number of times the pixel in the material surface image is submerged and the number of submerged pixels in the recursive process of the watershed algorithm includes: The gray value of the pixel in the material surface image is used as the altitude, and the pixel with the lowest altitude is recorded as the starting point; Using the watershed algorithm from the starting point, taking any pixel as the target pixel, obtain the number of times the target pixel is submerged in the recursive process of the watershed algorithm, and the total number of pixels submerged from the starting point closest to the target pixel to the time when the target pixel is submerged; The number of times the target pixel is submerged in the recursive process of the watershed algorithm is taken as the numerator, the total number of recursions of the watershed algorithm is taken as the denominator, and the ratio of the numerator and the denominator is taken as the first regularity; The negative correlation mapping value of the total number of pixels submerged from the starting point closest to the target pixel to the target pixel when the pixel is submerged is taken as the second regularity; The pixel regularity of the target pixel point is determined by combining the first regularity and the second regularity.
Citation Information
Patent Citations
Plastic mold surface defect analysis and detection method based on image processing
CN116934740A
Negative electrode material and preparation method thereof, negative electrode plate and secondary battery
CN116960325A