A battery pole surface defect detection method, device, equipment and product

In the detection of surface defects of the battery pole sheet, the image to be detected is converted into a single-channel grayscale image, the denoising gradient image is extracted and filtered, and non-maximum value suppression and cluster detection are performed, the inefficiency and inefficiency in the prior art are solved. The problem of low accuracy achieves efficient and stable battery pole defect detection.

CN115035050BActive Publication Date: 2024-11-08GUANGDONG INST OF ARTIFICIAL INTELLIGENCE & ADVANCED COMPUTING +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202210568474.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-05-23
Publication Date
2024-11-08
Estimated Expiration
2042-05-23

AI Technical Summary

Technical Problem

The existing battery pole surface defect detection methods have low operating efficiency on edge devices, delayed time, and decreased recognition accuracy when environmental changes, so they cannot effectively use edge devices to accelerate their operation.

Method used

By converting the image to be detected into a single-channel grayscale image, extracting and filtering the denoising gradient image, performing non-maximum suppression processing, obtaining a binarized image, and performing clustering defects based on the class distance between the cluster center and edge points Detection to achieve efficient surface defect detection.

Benefits of technology

Improve the accuracy and efficiency of surface defect detection of battery pole sheets, reduce impurity information, design an efficient and lossless computing structure, which can identify the quality of battery pole sheets during high-speed operation, and assist in sorting and parameter optimization to achieve Stable detection scheme.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115035050B_ABST
    Figure CN115035050B_ABST
Patent Text Reader

Abstract

The present invention provides a method, device, equipment and product for detecting surface defects of battery pole pieces, and relates to the technical field of industrial defect detection. The method comprises the following steps: obtaining an image to be detected containing a battery pole piece, and converting the image to be detected into a single-channel grayscale image; extracting the image edge of the grayscale image to obtain a gradient image; filtering and denoising the gradient image to remove noise points in the gradient image; performing non-maximum suppression processing on the gradient image after filtering and denoising to obtain a binary image; clustering defect detection on the binary image according to the cluster center of each group of clusters and the class distance of the edge points adjacent to it, and obtaining the surface defect result of the image to be detected. The present invention can adjust the rate and optimize various parameters through a control system such as a host computer, so as to form an efficient and stable battery pole piece defect detection and processing scheme.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of industrial defect detection, and in particular to a method, device, equipment and product for detecting surface defects of battery pole pieces. Background Art

[0002] With the development of deep learning and artificial intelligence, the use of deep learning in industrial production has also increased greatly, which can improve industrial production efficiency and enhance the robustness and accuracy of recognition. In the past, industrial defect detection such as battery electrode surface defect detection often used threshold segmentation and region growing methods to segment each area of ​​the image and then detect the corresponding position. However, these methods cannot effectively use the current edge devices for accelerated operation, and these methods cause time lags through multiple Gaussian iterations. The image processing time is far behind the running time of the mechanical part, the production efficiency will be reduced, and there is a problem that the recognition accuracy will drop significantly under conditions such as environmental changes. Summary of the invention

[0003] The present invention provides a battery pole piece surface defect detection method, device, equipment and product, which are used to solve the defects of low production efficiency and low accuracy in the prior art, and realize the formation of an efficient and stable battery pole piece defect detection solution.

[0004] The present invention provides a method for detecting surface defects of a battery electrode, comprising the following steps:

[0005] Acquire an image to be detected containing a battery electrode, and convert the image to be detected into a single-channel grayscale image;

[0006] Extracting the image edge of the grayscale image to obtain a gradient image;

[0007] Filtering and denoising the gradient image to remove noise points in the gradient image;

[0008] Performing non-maximum suppression processing on the gradient image after filtering and denoising to obtain a binary image; wherein the non-edge points in the binary image have a first grayscale value, and the edge points have a second grayscale value;

[0009] According to the cluster center of each cluster group and the cluster distance of the edge points adjacent to it, cluster defect detection is performed on the binary image to obtain the surface defect result of the image to be detected.

[0010] According to a battery electrode surface defect detection method provided by the present invention, the image edge of the grayscale image is extracted to obtain a gradient image, which specifically includes the following steps:

[0011] Performing a first edge detection process on the grayscale image to obtain a first gradient amplitude and a first gradient direction corresponding to each pixel point of the grayscale image; wherein the first edge detection process is based on a Scharr operator and is performed using a difference of a first-order partial derivative of a neighborhood of a first preset size;

[0012] The grayscale image that has undergone the first edge detection processing is subjected to a second edge detection processing to obtain a second gradient amplitude and a second gradient direction corresponding to each pixel point of the grayscale image, as well as the gradient image; wherein the second edge detection processing is based on a Canny operator and uses a second-order norm for processing.

[0013] According to a battery pole piece surface defect detection method provided by the present invention, the non-maximum suppression processing is performed on the gradient image after filtering and denoising to obtain a binary image, which specifically includes the following steps:

[0014] Using a second preset size, interpolating the second amplitude gradient along the second gradient direction for all pixel points of the second gradient amplitude array in a neighborhood including a preset number of directions;

[0015] Determine the relationship between the second gradient amplitude of the neighborhood center point and two adjacent interpolation values ​​in the second gradient direction;

[0016] If the second gradient magnitude of the neighborhood center point is greater than two adjacent interpolation values ​​in the second gradient direction, the neighborhood center point is taken as a candidate edge point;

[0017] If the second gradient amplitude of the neighborhood center point is not greater than two adjacent interpolation values ​​in the second gradient direction, assigning a first grayscale value to the grayscale value of the neighborhood center point;

[0018] Obtaining a relationship between the second gradient amplitude of the candidate edge point and a first threshold and a second threshold; wherein the first threshold is greater than the second threshold;

[0019] If the second gradient amplitude of the candidate edge point is greater than the first threshold, the candidate edge point is used as an edge point, and a second grayscale value is assigned to the grayscale value of the edge point;

[0020] If the second gradient magnitude of the candidate edge point is less than the second threshold, assigning a first grayscale value to the grayscale value of the candidate edge point;

[0021] If the second gradient magnitude of the candidate edge point is between the first threshold and the second threshold, determining the relationship between the second gradient magnitude of the adjacent pixel point of the candidate edge point and the first threshold and the second threshold;

[0022] If there is an adjacent pixel point whose second gradient amplitude is greater than the first threshold, the adjacent pixel point is regarded as the edge point, and the grayscale value of the edge point is assigned a second grayscale value.

[0023] According to a battery pole piece surface defect detection method provided by the present invention, cluster defect detection is performed on the binary image according to the cluster center of each cluster group and the cluster distance of the edge point adjacent to it, so as to obtain the surface defect result of the image to be detected, which specifically includes the following steps:

[0024] Combining a discrete edge point triplet of the edge point into an edge point structure; wherein the discrete edge point triplet includes the edge point, the second gradient amplitude of the edge point, and the second gradient direction of the edge point;

[0025] Divide the edge point structure into a number of clusters, and randomly select one edge point in each cluster as the cluster center; wherein the cluster point set in the initial state of the cluster is an empty set;

[0026] Determine whether the cluster center and the edge point adjacent to the cluster center are within a preset distance;

[0027] If the distance is within the preset distance, the adjacent edge points are included in the cluster group to which the cluster center belongs;

[0028] If it is not within the preset distance, determining whether there is an edge point in the cluster to which the cluster center belongs, so that the cluster distances between the edge point and all the edge points included in the cluster are within the preset distance;

[0029] If the edge point exists, the edge point is updated as the cluster center of the cluster group, and the adjacent edge points are included in the cluster group to which the cluster center belongs;

[0030] If the edge point does not exist, deleting the cluster and all the edge points included in the cluster;

[0031] The clusters that do not meet the preset area are deleted to obtain the surface defect result of the image to be detected.

[0032] According to a battery pole piece surface defect detection method provided by the present invention, the acquisition of an image to be detected containing a battery pole ear and the conversion of the image to be detected into a single-channel grayscale image specifically include the following steps:

[0033] Get the original image containing the battery;

[0034] Input the original image into an image segmentation model to obtain an image segmentation result output by the image segmentation model; wherein the image segmentation model is trained based on sample images containing batteries, and the image segmentation result includes an image of a battery pole region, an image of a pole lug region, and an image of a background region;

[0035] Performing a thinning process on the image segmentation result to obtain the image to be detected; wherein the thinning process is to dilate and erode the image segmentation result through image morphology;

[0036] The image to be detected is converted into the grayscale image of a single channel.

[0037] According to a battery pole piece surface defect detection method provided by the present invention, the method further comprises the following steps before the step of inputting the original image into the image segmentation model to obtain the image segmentation result output by the image segmentation model:

[0038] The original image is preprocessed; wherein the preprocessing is to standardize the original image and store each pixel in the original image in a buffer.

[0039] The present invention also provides a battery electrode surface defect detection device, comprising:

[0040] An acquisition module, used for acquiring an image to be detected containing a battery electrode, and converting the image to be detected into a single-channel grayscale image;

[0041] An edge extraction module is used to extract the image edge of the grayscale image to obtain a gradient image;

[0042] A filtering and denoising module, used for filtering and denoising the gradient image to remove noise points in the gradient image;

[0043] A binarization module is used to perform non-maximum suppression processing on the gradient image after filtering and denoising to obtain a binarized image; wherein the non-edge points in the binarized image have a first grayscale value, and the edge points have a second grayscale value;

[0044] The cluster processing module is used to perform cluster defect detection on the binary image according to the cluster center of each cluster group and the cluster distance of the edge points adjacent to it, so as to obtain the surface defect result of the image to be detected.

[0045] The present invention also provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the steps of any of the above-mentioned methods for detecting surface defects of battery pole pieces are implemented.

[0046] The present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the steps of any of the above-mentioned methods for detecting surface defects of battery pole pieces are implemented.

[0047] The present invention also provides a computer program product, comprising a computer program, wherein when the computer program is executed by a processor, the steps of any of the above-mentioned methods for detecting surface defects of battery pole pieces are implemented.

[0048] The battery pole piece surface defect detection method, device, equipment and product provided by the present invention perform channel conversion processing on the acquired image to be detected containing the battery pole piece portion to obtain a grayscale image of the image to be detected, and then extract and gradient bulge the edge points of the grayscale image, which can not only detect more accurate image edges, but also make the detected impurity information less, which is beneficial to the subsequent clustering defect detection. Finally, based on the clustering algorithm, the surface defect results of the image to be detected are obtained, and then an efficient and lossless computing structure is designed, which can still identify the battery pole piece during high-speed operation and judge the quality of the pole piece according to the surface defect results, assist related equipment to sort the batteries, and can adjust the rate and optimize various parameters through a control system such as a host computer, so as to form an efficient and stable battery pole piece defect detection and processing solution. BRIEF DESCRIPTION OF THE DRAWINGS

[0049] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are 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.

[0050] Figure 1 It is a schematic flow chart of the battery pole piece surface defect detection method provided by the present invention;

[0051] Figure 2 It is a schematic diagram of a specific process of extracting edge modules in the battery pole piece surface defect detection method provided by the present invention;

[0052] Figure 3 It is a specific flow chart of step S400 in the battery pole piece surface defect detection method provided by the present invention;

[0053] Figure 4 It is a specific flow chart of step S500 in the battery pole piece surface defect detection method provided by the present invention;

[0054] Figure 5 This is one of the specific flow charts of step S100 in the battery electrode surface defect detection method provided by the present invention;

[0055] Figure 6 This is the second specific flow chart of step S100 in the battery electrode surface defect detection method provided by the present invention;

[0056] Figure 7 It is a schematic structural diagram of a battery pole piece surface defect detection device provided by the present invention;

[0057] Figure 8 It is a specific structural schematic diagram of the edge extraction module in the battery pole piece surface defect detection device provided by the present invention;

[0058] Fig. 9 It is a specific structural schematic diagram of a binarization module in the battery pole piece surface defect detection device provided by the present invention;

[0059] Fig.10 It is a specific structural schematic diagram of the group processing module in the battery electrode surface defect detection device provided by the present invention;

[0060] Fig.11 It is one of the specific structural schematic diagrams of the acquisition module in the battery pole piece surface defect detection device provided by the present invention;

[0061] Fig.12 This is the second specific structural schematic diagram of the acquisition module in the battery pole piece surface defect detection device provided by the present invention;

[0062] Fig.13 It is a structural schematic diagram of the electronic device provided by the present invention. DETAILED DESCRIPTION

[0063] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the drawings of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0064] Combine the following Figure 1 The present invention describes a method for detecting surface defects of a battery electrode sheet, the method comprising the following steps:

[0065] S100, obtaining an image to be inspected including a battery electrode. In order to improve the accuracy of subsequent clustering defect detection, the three-channel optical three primary colors (RGB) image to be inspected is converted into a single-channel grayscale (Gray) image. The grayscale image can be binarized to better highlight the edge points of the image, that is, better perform edge detection.

[0066] S200, extracting the image edge of the grayscale image to obtain a gradient image.

[0067] S300, filtering and denoising the gradient image to remove noise points in the gradient image. Step S300 is used to smooth and denoise the image.

[0068] In this embodiment, the Gaussian function of formula (1) is used, and the first-order directional derivative of the two-dimensional Gaussian function in any direction is used as a noise filter. By convolving with the gradient image obtained in step S200, filtering and denoising are performed. Formula (1) is:

[0069]

[0070] Among them, x and y are the neighborhood relative coordinates of a pixel in the gradient image, respectively. σ is the noise filter parameter of the Gaussian function. σ controls the degree of smoothing of the Gaussian function. The larger σ is, the sharper the image is and the more it can retain the image edge, but the denoising effect is not good. The smaller σ is, the less the image can retain the edge information, and the better the denoising effect is.

[0071] Therefore, by convolving the gradient image f(x,y) by rows and columns using formula (1), a smooth image I(i,j) is obtained. Specifically:

[0072] I(i,j)=G(x,y)*f(x,y)

[0073] S400, non-maximum suppression processing is performed on the gradient image after filtering and denoising to obtain a binary image. Image binarization is the process of setting the grayscale value of the pixel points on the image to 0 (black) or 255 (white), that is, the process of presenting the entire image with an obvious black and white effect. In digital image processing, binary images occupy a very important position. The binarization of the image greatly reduces the amount of data in the image, thereby highlighting the outline and edge points of the target. In this embodiment, the non-edge points in the binary image obtained in step S400 are the first grayscale value, and the edge points are the second grayscale value. Step S400 is used to perform non-maximum suppression on the obtained gradient image and gradient amplitude to retain the local gradient maximum value.

[0074] S500, cluster defect detection is performed on the binary image according to the cluster center of each cluster group and the cluster distance of the edge points adjacent to it, and the surface defect result of the image to be detected is obtained. The defect type can be obtained according to the surface defect result, and then the good or bad result of the battery-level chip is obtained, and the result is fed back to the control system such as the Programmable Logic Controller (PLC) system through the serial port and other interfaces. The control system then generates and transmits the corresponding control instructions to the relevant sorting equipment to perform the corresponding sorting operation.

[0075] The battery pole piece surface defect detection method of the present invention performs channel conversion processing on the acquired image to be detected containing the battery pole piece portion to obtain a grayscale image of the image to be detected, and then extracts and gradiently protrudes the edge points of the grayscale image, which can not only detect more accurate image edges, but also make the detected impurity information less, which is beneficial to the subsequent clustering defect detection. Finally, based on the clustering algorithm, the surface defect results of the image to be detected are obtained, and then an efficient and lossless computing structure is designed, which can still identify the battery pole piece during high-speed operation and judge the quality of the pole piece according to the surface defect results, assist related equipment to sort the batteries, and can adjust the rate and optimize various parameters through a control system such as a host computer, so as to form an efficient and stable battery pole piece defect detection and processing solution.

[0076] Combine the following Figure 2 The battery electrode surface defect detection method of the present invention is described, and step S200 specifically includes the following steps:

[0077] S210, performing a first edge detection process on the grayscale image to obtain a first gradient magnitude and a first gradient direction corresponding to each pixel of the grayscale image. In this embodiment, the first edge detection process is based on a Scharr operator and is performed using a difference of a first-order partial derivative of a neighborhood of a first preset size. Preferably, the first preset size is 5×5.

[0078] Specifically, based on the Scharr operator, a kernel operator with a 5×5 size neighborhood is used. The first gradient magnitude M(i, j) and the first gradient direction α(i, j) are calculated and obtained by calculating the difference of the first-order partial derivatives in the x direction, y direction, 45° direction and 135° direction in the neighborhood of pixel 15. The calculation formula of the first gradient magnitude M(i, j) is (2), and the calculation formula of the first gradient direction α(i, j) is (3). Formulas (2) and (3) are respectively:

[0079]

[0080]

[0081] Among them, E x (i, j) is the partial derivative of the point (i, j) in the x direction based on the Scharr operator; E y (i, j) is the partial derivative of the point (i, j) in the y direction based on the Scharr operator.

[0082] S220, performing a second edge detection process on the grayscale image after the first edge detection process, and obtaining a second gradient amplitude and a second gradient direction corresponding to each pixel point of the grayscale image, and a gradient image. In this embodiment, the second edge detection process is based on the Canny operator and uses a second-order norm for processing.

[0083] Specifically, the calculation formula of the second gradient amplitude G(i, j) is (4), and the calculation formula of the second gradient direction θ(i, j) is (5). Formula (4) and formula (5) are respectively:

[0084]

[0085]

[0086] Among them, G x (i, j) is the partial derivative of the point (i, j) in the x direction based on the Canny operator; G y (i, j) is the partial derivative of the point (i, j) in the y direction based on the Canny operator.

[0087] Combine the following Figure 3 The battery electrode surface defect detection method of the present invention is described, and step S400 specifically includes the following steps:

[0088] S410, using a second preset size, interpolate the second amplitude gradient G(i,j) along the second gradient direction θ(i,j) for all pixel points of the second gradient amplitude array in a neighborhood containing a preset number of directions. Preferably, the preset number is 8.

[0089] After processing from step S200 to step S300, in the gradient image for extracting a single-pixel wide edge, a multi-point phenomenon is formed near the extreme value position of G(i,j) in formula (4), so it is necessary to refine the edge position with a single pixel point, that is, only retain the point with the largest local amplitude change, that is, non-maximum suppression processing. Preferably, the second preset size is a size of 3×3.

[0090] S420, determining the relationship between the second gradient amplitude G(i, j) of the neighborhood center point and two adjacent interpolation values ​​in the second gradient direction θ(i, j).

[0091] S430: If the second gradient amplitude G(i, j) of the neighborhood center point is greater than two adjacent interpolation values ​​in the second gradient direction θ(i, j), the neighborhood center point is taken as a candidate edge point.

[0092] S440. If the second gradient amplitude G(i,j) of the neighborhood center point is not greater than the two adjacent interpolation values ​​on the second gradient direction θ(i,j), the neighborhood center point is a non-edge point, and the grayscale value of the neighborhood center point is assigned a first grayscale value, which is 255.

[0093] After the non-maximum suppression process, the Canny operator will also use the double threshold method to segment the image obtained after the non-maximum suppression process to obtain two threshold edge images T h and T l , where T h Represents the high threshold, i.e., the first threshold, T l Indicates the low threshold, i.e., the second threshold. Further edge detection and edge connection are performed using the dual threshold method.

[0094] S450, obtaining the second gradient magnitude G(i, j) and the first threshold T of the candidate edge point h , the second threshold T l relationship.

[0095] S460: If the second gradient magnitude G(i,j) of the candidate edge point is greater than the first threshold T h , then the edge candidate point is taken as the edge point, and the gray value of the edge point is assigned the second gray value, and the first gray value is 0.

[0096] S470: If the second gradient magnitude G(i,j) of the candidate edge point is less than the second threshold T l , then the neighborhood center point is a non-edge point, and the grayscale value of the candidate edge point is assigned the first grayscale value.

[0097] S480: If the second gradient magnitude G(i,j) of the candidate edge point is between the first threshold T h and the second threshold T l That is, not less than the second threshold T l and is not greater than the first threshold T h , determine the second gradient amplitude G(i,j) of the adjacent pixel points of the candidate edge point and the first threshold T h , the second threshold T l Relationship

[0098] S490: If there is an adjacent pixel whose second gradient amplitude is greater than the first threshold value T h , then the adjacent pixel point is regarded as an edge point, and similarly, the grayscale value of the edge point is assigned a second grayscale value.

[0099] Combine the following Figure 4 The battery electrode surface defect detection method of the present invention is described, and step S500 specifically includes the following steps:

[0100] S510, forming an edge point structure from discrete edge point triplets of edge points, wherein the discrete edge point triplets include edge points, second gradient amplitudes of edge points, and second gradient directions of edge points, i.e. <(i,j), G(i,j), θ(i,j)>.

[0101] S520, the edge point structure is equally divided into several clusters to obtain M clusters, for example, the edge point structure is equally divided into M segments according to the x-axis, the edge points are also equally divided into M groups, the clusters with the same number correspond to the divided edge points one by one, and at the same time, an edge point is randomly selected from each cluster as the cluster center of the cluster growth The cluster point set in the initial state of the cluster group is an empty set, so step S520 needs to initialize the cluster point set of the cluster group to an empty set.

[0102] S530, determine cluster center With the cluster center The neighboring edge point q i Whether the cluster distance is within the preset distance v, the cluster center is calculated and obtained by formula (6) With the cluster center The neighboring edge point q i Finally, the calculation result of formula (6) is compared with the preset distance v. Formula (6) is:

[0103] α*abs(θ p -θ q )+β*abs(G p -G q ) (6) Where α is the first adjustment coefficient, β is the second adjustment coefficient, θ p is the cluster center The second gradient direction, θ q is the neighboring edge point q i The second gradient direction, G p is the cluster center The second gradient amplitude, G q is the neighboring edge point q i The second gradient amplitude.

[0104] S540: If the distance is within the preset distance ε, the adjacent edge point q i Included in the cluster center The current cluster to which it belongs is used as the cluster point of this cluster.

[0105] S550: If it is not within the preset distance ε, determine the cluster center Whether there is an edge point in the cluster to which it belongs, such that the cluster distances between the edge point and all the edge points included in the cluster are within the preset distance ε, and the calculation method is also formula (6).

[0106] S560: If such an edge point exists, update the edge point to the cluster center of the cluster group. And the adjacent edge point q i Included in the cluster center The current cluster to which it belongs is used as the cluster point of this cluster.

[0107] S570: If there is no such edge point, the clustering work of the cluster is completed, and the cluster and all edge points included in the cluster are deleted.

[0108] Repeat the above steps S530 to S570 to cluster the remaining edge points of the current cluster until the edge points in the current cluster are an empty set.

[0109] S580, after all the clusters in the group have completed the above clustering algorithm, the iteration ends, and the clusters that do not meet the preset area are deleted, i.e., filtered out, to obtain the surface defect results of the image to be detected. Preferably, the preset area is greater than or equal to 10 and less than or equal to 10000, so it is necessary to filter out the clusters (frames) with an area less than 10 or an area greater than 10000.

[0110] Combine the following Figure 5 The battery electrode surface defect detection method of the present invention is described, and step S100 specifically includes the following steps:

[0111] S110, obtain the original image containing the battery. For example, through the infrared sensor's reflection effect, it can detect whether the pole piece at a specific position exists to determine whether there is material (battery). If the pole piece completely covers the infrared reflection, it will emit a signal that the battery exceeds the height of the tray, indicating that too many batteries are placed. The corresponding program is started, and the conveyor belt is ready to reach the field of view of the industrial camera according to the number of pulses sent by the servo motor. At the same time as the program is started, the industrial camera is initialized; the industrial camera receives the serial port signal of the PLC controller, triggers the industrial camera to take pictures, obtains the original image containing the battery from the cache stream and saves it to the memory of the TX2 device.

[0112] S130, input the original image into the trained image segmentation model, obtain the image segmentation result output by the image segmentation model, and then segment the original image into three components. The image segmentation model is trained based on sample images containing batteries, and the image segmentation result includes the battery's pole area image, the pole ear area image, and the background area image.

[0113] S140, in order to refine the image edge, the image segmentation result is refined to obtain the image to be detected. In this embodiment, the refinement process is to expand and erode the image segmentation result through image morphology to obtain more accurate independent regions of the three components. In this embodiment, the strong corner point method and other methods can also be used to refine the pole ear area image. The image to be detected finally obtained is the pole piece area image.

[0114] S150, converting the image to be detected into a single-channel grayscale image.

[0115] Combine the following Figure 6 The battery electrode surface defect detection method of the present invention is described. Before step S130, the method further includes the following steps:

[0116] S120, preprocessing the original image. In this embodiment, the preprocessing is to standardize the original image and store each pixel in the original image in a buffer. It is understandable that before inputting the original image into the trained image segmentation model in step S130, the original image can also be scaled, and scaling can save time in calculation before deep learning.

[0117] The battery pole piece surface defect detection device provided by the present invention is described below. The battery pole piece surface defect detection device described below and the battery pole piece surface defect detection method described above can be referenced to each other.

[0118] Combine the following Figure 7 The battery pole piece surface defect detection device of the present invention is described, and the device comprises:

[0119] The acquisition module 100 is used to acquire the image to be detected containing the battery pole piece. In order to improve the accuracy of subsequent clustering defect detection, the three-channel optical three primary colors (RGB) image to be detected is converted into a single-channel grayscale (Gray) image. The grayscale image can be binarized to better highlight the edge points of the image, that is, better perform edge detection.

[0120] The edge extraction module 200 is used to extract the image edge of the grayscale image to obtain a gradient image.

[0121] The filtering and denoising module 300 is used to filter and denoise the gradient image to remove noise points in the gradient image. The filtering and denoising module 300 is used to smooth and denoise the image.

[0122] The binarization module 400 is used to perform non-maximum suppression processing on the gradient image after filtering and denoising to obtain a binarized image. Image binarization is to set the grayscale value of the pixel points on the image to 0 (black) or 255 (white), that is, the process of presenting an obvious black and white effect on the entire image. In digital image processing, the binarization image occupies a very important position. The binarization of the image greatly reduces the amount of data in the image, thereby highlighting the outline and edge points of the target. In this embodiment, the non-edge points in the binarized image obtained by the binarization module 400 are the first grayscale value, and the edge points are the second grayscale value. The binarization module 400 is used to perform non-maximum suppression on the obtained gradient image and gradient amplitude to retain the local gradient maximum value.

[0123] The cluster processing module 500 is used to perform cluster defect detection on the binary image according to the cluster center of each cluster group and the cluster distance of the edge point adjacent to it, and obtain the surface defect result of the image to be detected. The defect type can be obtained according to the surface defect result, and then the good or bad result of the battery-level chip can be obtained, and the result is fed back to the control system such as the PLC system through the serial port and other interfaces. The control system then generates and transmits the corresponding control instructions to the relevant sorting equipment to perform the corresponding sorting operation.

[0124] The battery pole piece surface defect detection device of the present invention performs channel conversion processing on the acquired image to be detected containing the battery pole piece portion to obtain a grayscale image of the image to be detected, and then extracts and gradient-protrudes the edge points of the grayscale image, which can not only detect more accurate image edges, but also make the detected impurity information less, which is beneficial to the subsequent clustering defect detection. Finally, based on the clustering algorithm, the surface defect results of the image to be detected are obtained, and then an efficient and lossless computing structure is designed, which can still identify the battery pole piece during high-speed operation and judge the quality of the pole piece according to the surface defect results, assist related equipment to sort the batteries, and can adjust the rate and optimize various parameters through a control system such as a host computer, so as to form an efficient and stable battery pole piece defect detection and processing solution.

[0125] Combine the following Figure 8 The battery electrode surface defect detection device of the present invention is described, and the edge extraction module 200 specifically includes:

[0126] The first extraction unit 210 is used to perform a first edge detection process on the grayscale image to obtain a first gradient magnitude and a first gradient direction corresponding to each pixel of the grayscale image. In this embodiment, the first edge detection process is based on the Scharr operator and uses the difference of the first-order partial derivative of a neighborhood of a first preset size for processing. Preferably, the first preset size is 5×5.

[0127] The second extraction unit 220 is used to perform a second edge detection process on the grayscale image that has undergone the first edge detection process, and obtain a second gradient amplitude and a second gradient direction corresponding to each pixel of the grayscale image, as well as a gradient image. In this embodiment, the second edge detection process is based on the Canny operator and uses a second-order norm for processing.

[0128] Combine the following Fig. 9 The battery electrode surface defect detection device of the present invention is described, and the binarization module 400 specifically includes:

[0129] The first processing unit 410 is used to interpolate the second amplitude gradient G(i,j) along the second gradient direction θ(i,j) for all pixel points of the second gradient amplitude array in a neighborhood including a preset number of directions using a second preset size.

[0130] Preferably, the second preset size is 3×3, and the preset number is 8.

[0131] The second processing unit 420 is used to determine the relationship between the second gradient amplitude G(i, j) of the neighborhood center point and two adjacent interpolation values ​​in the second gradient direction θ(i, j).

[0132] The third processing unit 430 is configured to take the neighborhood center point as a candidate edge point if the second gradient magnitude G(i, j) of the neighborhood center point is greater than two adjacent interpolation values ​​in the second gradient direction θ(i, j).

[0133] The fourth processing unit 440 is used to determine that if the second gradient amplitude G(i, j) of the neighborhood center point is not greater than the two adjacent interpolation values ​​in the second gradient direction θ(i, j), the neighborhood center point is a non-edge point, and the grayscale value of the neighborhood center point is assigned a first grayscale value of 255.

[0134] After the non-maximum suppression process, the Canny operator will also use the double threshold method to segment the image obtained after the non-maximum suppression process to obtain two threshold edge images T h and T l , where T h Represents the high threshold, i.e., the first threshold, T l Indicates the low threshold, i.e., the second threshold. Further edge detection and edge connection are performed using the dual threshold method.

[0135] The fifth processing unit 450 is used to obtain the second gradient amplitude G(i, j) of the candidate edge point and the first threshold T h , the second threshold T l relationship.

[0136] The sixth processing unit 460 is used to: if the second gradient magnitude G(i,j) of the candidate edge point is greater than the first threshold T h , then the edge candidate point is taken as the edge point, and the gray value of the edge point is assigned the second gray value, and the first gray value is 0.

[0137] The seventh processing unit 470 is used to: if the second gradient magnitude G(i,j) of the candidate edge point is less than the second threshold T l , then the neighborhood center point is a non-edge point, and the grayscale value of the candidate edge point is assigned the first grayscale value.

[0138] The eighth processing unit 480 is configured to: if the second gradient magnitude G(i, j) of the candidate edge point is between the first threshold T h and the second threshold T l That is, not less than the second threshold T l and is not greater than the first threshold T h , determine the second gradient amplitude G(i,j) of the adjacent pixel points of the candidate edge point and the first threshold T h , the second threshold T l Relationship

[0139] The ninth processing unit 490 is configured to: if there is an adjacent pixel point whose second gradient amplitude is greater than the first threshold value T h , then the adjacent pixel point is regarded as an edge point, and similarly, the grayscale value of the edge point is assigned a second grayscale value.

[0140] Combine the following Fig.10 The battery electrode surface defect detection device of the present invention is described, and the group processing module 500 specifically includes:

[0141] The creation unit 510 is used to form an edge point structure from discrete edge point triplets of edge points, wherein the discrete edge point triplets include edge points, second gradient amplitudes of edge points, and second gradient directions of edge points, i.e., <(i,j), G(i,j), θ(i,j)>.

[0142] The division unit 520 is used to divide the edge point structure into several groups to obtain M groups. For example, the edge point structure is divided into M groups according to the x-axis, and the edge points are also divided into M groups. The divided groups with the same number correspond to the divided edge points one by one, and an edge point is randomly selected from each group as the cluster center for group growth. The cluster point set in the initial state of the cluster group is an empty set, so step S520 needs to initialize the cluster point set of the cluster group to an empty set.

[0143] The first clustering unit 530 is used to determine the cluster center With the cluster center The neighboring edge point qi Whether the cluster distance is within the preset distance ε, the cluster center is calculated and obtained by formula (6) With the cluster center The neighboring edge point q i It is judged by the gradient direction difference.

[0144] The second grouping unit 540 is used to group the adjacent edge points q if they are within a preset distance ε. i Included in the cluster center The current cluster to which it belongs is used as the cluster point of this cluster.

[0145] The third clustering unit 550 is used to determine the cluster center if it is not within the preset distance ε. Whether there is an edge point in the cluster to which it belongs, such that the cluster distances between the edge point and all the edge points included in the cluster are within the preset distance ε, and the calculation method is also formula (6).

[0146] The fourth clustering unit 560 is used to update the edge point as the cluster center of the cluster if such an edge point exists. And the adjacent edge point q i Included in the cluster center The current cluster to which it belongs is used as the cluster point of this cluster.

[0147] The fifth clustering unit 570 is used for completing the clustering work if there is no such edge point, and deleting the cluster and all edge points included in the cluster.

[0148] The above-mentioned first clustering unit 530 to the fifth clustering unit 570 are repeated to cluster the remaining edge points of the current cluster until the edge points in the current cluster are an empty set.

[0149] The filtering unit 580 is used to filter out the clusters that do not meet the preset area after all the clusters in the group complete the above clustering algorithm, and the iteration ends, and the clusters that do not meet the preset area are deleted to obtain the surface defect results of the image to be detected. Preferably, the preset area is greater than or equal to 10 and less than or equal to 10000, so it is necessary to filter out the clusters (frames) with an area less than 10 or an area greater than 10000.

[0150] Combine the following Fig.11 The battery electrode surface defect detection device of the present invention is described, and the acquisition module 100 specifically includes:

[0151] The acquisition unit 110 is used to obtain the original image containing the battery. For example, through the infrared sensor's reflection effect, it can detect whether the pole piece at a specific position exists to determine whether there is material (battery). If the pole piece completely covers the infrared reflection, it will emit a battery that exceeds the height of the tray, indicating that too many batteries are placed. The corresponding program is started, and the conveyor belt is ready to reach the field of view of the industrial camera according to the number of pulses sent by the servo motor. At the same time as the program is started, the industrial camera is initialized; the industrial camera receives the serial port signal of the PLC controller, triggers the industrial camera to take pictures, obtains the original image containing the battery from the cache stream and saves it to the memory of the TX2 device.

[0152] The image segmentation unit 130 is used to input the original image into the trained image segmentation model to obtain the image segmentation result output by the image segmentation model, and then segment the original image into three components. The image segmentation model is trained based on sample images containing batteries, and the image segmentation result includes the battery's pole area image, the pole ear area image, and the background area image.

[0153] The refinement unit 140 is used to refine the image segmentation result in order to refine the image edge and obtain the image to be detected. In this embodiment, the refinement process is to expand and erode the image segmentation result through image morphology to obtain more accurate independent regions of the three components. In this embodiment, the strong corner point method and other methods can also be used to refine the pole ear area image. The image to be detected finally obtained is the pole piece area image.

[0154] The conversion unit 150 is used to convert the image to be detected into a single-channel grayscale image.

[0155] Combine the following Fig.12 The battery electrode surface defect detection device of the present invention is described. The device includes, before the image segmentation unit 130, the following:

[0156] The preprocessing unit 120 is used to preprocess the original image. In this embodiment, the preprocessing is to standardize the original image and store each pixel in the original image in a buffer. It can be understood that before inputting the original image into the trained image segmentation model in step S130, the original image can also be scaled, and scaling can save time in calculation before deep learning.

[0157] Fig.13 An example of a physical structure diagram of an electronic device is shown in FIG. Fig.13As shown, the electronic device may include: a processor 810, a communication interface 820, a memory 830 and a communication bus 840, wherein the processor 810, the communication interface 820 and the memory 830 communicate with each other through the communication bus 840. The processor 810 may call the logic instructions in the memory 830 to execute the battery electrode surface defect detection method, which includes the following steps:

[0158] S100, acquiring an image to be detected containing a battery electrode, and converting the image to be detected into a single-channel grayscale image;

[0159] S200, extracting the image edge of the grayscale image to obtain a gradient image;

[0160] S300, filtering and denoising the gradient image to remove noise points in the gradient image;

[0161] S400, performing non-maximum suppression processing on the gradient image after filtering and denoising to obtain a binary image; wherein the non-edge points in the binary image have a first gray value, and the edge points have a second gray value;

[0162] S500 , performing clustering defect detection on the binary image according to the cluster center of each cluster group and the cluster distance of the edge points adjacent to the cluster center, to obtain a surface defect result of the image to be detected.

[0163] In addition, the logic instructions in the above-mentioned memory 830 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program codes.

[0164] On the other hand, the present invention further provides a computer program product, the computer program product includes a computer program, the computer program can be stored in a non-transitory computer-readable storage medium, when the computer program is executed by a processor, the computer can execute the battery electrode surface defect detection method provided by the above methods, the method comprising the following steps:

[0165] S100, acquiring an image to be detected containing a battery electrode, and converting the image to be detected into a single-channel grayscale image;

[0166] S200, extracting the image edge of the grayscale image to obtain a gradient image;

[0167] S300, filtering and denoising the gradient image to remove noise points in the gradient image;

[0168] S400, performing non-maximum suppression processing on the gradient image after filtering and denoising to obtain a binary image; wherein the non-edge points in the binary image have a first gray value, and the edge points have a second gray value;

[0169] S500 , performing clustering defect detection on the binary image according to the cluster center of each cluster group and the cluster distance of the edge points adjacent to the cluster center, to obtain a surface defect result of the image to be detected.

[0170] In another aspect, the present invention further provides a non-transitory computer-readable storage medium having a computer program stored thereon, which is implemented when the computer program is executed by a processor to perform the battery electrode surface defect detection method provided by the above methods, the method comprising the following steps:

[0171] S100, acquiring an image to be detected containing a battery electrode, and converting the image to be detected into a single-channel grayscale image;

[0172] S200, extracting the image edge of the grayscale image to obtain a gradient image;

[0173] S300, filtering and denoising the gradient image to remove noise points in the gradient image;

[0174] S400, performing non-maximum suppression processing on the gradient image after filtering and denoising to obtain a binary image; wherein the non-edge points in the binary image have a first gray value, and the edge points have a second gray value;

[0175] S500 , performing clustering defect detection on the binary image according to the cluster center of each cluster group and the cluster distance of the edge points adjacent to the cluster center, to obtain a surface defect result of the image to be detected.

[0176] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.

[0177] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.

[0178] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A method for detecting surface defects of a battery electrode, characterized in that: The following steps are involved: Acquire an image to be detected containing a battery electrode, and convert the image to be detected into a single-channel grayscale image; Extracting the image edge of the grayscale image to obtain a gradient image; Filtering and denoising the gradient image to remove noise points in the gradient image; Performing non-maximum suppression processing on the gradient image after filtering and denoising to obtain a binary image; wherein the grayscale value of non-edge points in the binary image is a first grayscale value, and the grayscale value of edge points is a second grayscale value; Perform clustering defect detection on the binary image according to the cluster center of each cluster group and the cluster distance of the edge points adjacent to the cluster center, so as to obtain the surface defect result of the image to be detected; Extracting the image edge of the grayscale image to obtain a gradient image specifically comprises the following steps: Performing a first edge detection process on the grayscale image to obtain a first gradient amplitude and a first gradient direction corresponding to each pixel point of the grayscale image; wherein the first edge detection process is based on a Scharr operator and is performed using a difference of a first-order partial derivative of a neighborhood of a first preset size; The grayscale image that has undergone the first edge detection processing is subjected to a second edge detection processing to obtain a second gradient amplitude and a second gradient direction corresponding to each pixel point of the grayscale image, as well as the gradient image; wherein the second edge detection processing is based on a Canny operator and uses a second-order norm for processing.

2. The battery electrode surface defect detection method according to claim 1, characterized in that: The non-maximum suppression process is performed on the gradient image after filtering and denoising to obtain a binary image, which specifically includes the following steps: Using a second preset size, interpolating the second gradient amplitude along the second gradient direction for all pixel points of the second gradient amplitude array in a neighborhood including a preset number of directions; Determine the relationship between the second gradient amplitude of the neighborhood center point and two adjacent interpolation values ​​in the second gradient direction; If the second gradient magnitude of the neighborhood center point is greater than two adjacent interpolation values ​​in the second gradient direction, the neighborhood center point is taken as a candidate edge point; If the second gradient amplitude of the neighborhood center point is not greater than two adjacent interpolation values ​​in the second gradient direction, assigning a first grayscale value to the grayscale value of the neighborhood center point; Obtaining a relationship between the second gradient amplitude of the candidate edge point and a first threshold and a second threshold; wherein the first threshold is greater than the second threshold; If the second gradient amplitude of the candidate edge point is greater than the first threshold, the candidate edge point is used as an edge point, and a second grayscale value is assigned to the grayscale value of the edge point; If the second gradient magnitude of the candidate edge point is less than the second threshold, assigning a first grayscale value to the grayscale value of the candidate edge point; If the second gradient magnitude of the candidate edge point is between the first threshold and the second threshold, determining the relationship between the second gradient magnitude of the adjacent pixel point of the candidate edge point and the first threshold and the second threshold; If there is an adjacent pixel point whose second gradient amplitude is greater than the first threshold, the adjacent pixel point is regarded as the edge point, and the grayscale value of the edge point is assigned a second grayscale value.

3. The battery electrode surface defect detection method according to claim 2, characterized in that: The method of performing cluster defect detection on the binary image according to the cluster center of each cluster group and the cluster distance of the edge points adjacent to the cluster center to obtain the surface defect result of the image to be detected specifically includes the following steps: Combining a discrete edge point triplet of the edge point into an edge point structure; wherein the discrete edge point triplet includes the edge point, the second gradient amplitude of the edge point, and the second gradient direction of the edge point; Divide the edge point structure into a number of clusters, and randomly select one edge point in each cluster as the cluster center; wherein the cluster point set in the initial state of the cluster is an empty set; Determine whether the cluster center and the edge point adjacent to the cluster center are within a preset distance; If the distance is within the preset distance, the adjacent edge points are included in the cluster group to which the cluster center belongs; If it is not within the preset distance, determining whether there is an edge point in the cluster to which the cluster center belongs, so that the cluster distances between the edge point and all the edge points included in the cluster are within the preset distance; If the edge point exists, the edge point is updated as the cluster center of the cluster group, and the adjacent edge points are included in the cluster group to which the cluster center belongs; If the edge point does not exist, deleting the cluster and all the edge points included in the cluster; The clusters that do not meet the preset area are deleted to obtain the surface defect result of the image to be detected.

4. The battery electrode surface defect detection method according to claim 1, characterized in that: The step of acquiring the image to be detected including the battery tab and converting the image to be detected into a single-channel grayscale image specifically comprises the following steps: Get the original image containing the battery; Input the original image into an image segmentation model to obtain an image segmentation result output by the image segmentation model; wherein the image segmentation model is trained based on sample images containing batteries, and the image segmentation result includes an image of a battery pole region, an image of a pole lug region, and an image of a background region; Performing a thinning process on the image segmentation result to obtain the image to be detected; wherein the thinning process is to dilate and erode the image segmentation result through image morphology; The image to be detected is converted into the grayscale image of a single channel.

5. The battery pole piece surface defect detection method according to claim 4, characterized in that: The method further includes the following steps before the step of inputting the original image into the image segmentation model to obtain the image segmentation result output by the image segmentation model: The original image is preprocessed; wherein the preprocessing is to standardize the original image and store each pixel in the original image in a buffer.

6. A battery electrode surface defect detection device, characterized in that: include: An acquisition module, used for acquiring an image to be detected containing a battery electrode, and converting the image to be detected into a single-channel grayscale image; An edge extraction module is used to extract the image edge of the grayscale image to obtain a gradient image; A filtering and denoising module, used for filtering and denoising the gradient image to remove noise points in the gradient image; A binarization module is used to perform non-maximum suppression processing on the gradient image after filtering and denoising to obtain a binarized image; wherein the non-edge points in the binarized image have a first grayscale value, and the edge points have a second grayscale value; A cluster processing module, used for performing cluster defect detection on the binary image according to the cluster center of each cluster group and the cluster distance of the edge points adjacent to the cluster center, so as to obtain the surface defect result of the image to be detected; The edge extraction module specifically includes: A first extraction unit is used to perform a first edge detection process on the grayscale image to obtain a first gradient amplitude and a first gradient direction corresponding to each pixel point of the grayscale image, wherein the first edge detection process is based on a Scharr operator and is performed by using a difference of a first-order partial derivative of a neighborhood of a first preset size; The second extraction unit is used to perform a second edge detection process on the grayscale image that has undergone the first edge detection process to obtain a second gradient amplitude and a second gradient direction corresponding to each pixel point of the grayscale image, as well as a gradient image. The second edge detection process is based on a Canny operator and uses a second-order norm for processing.

7. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the program, the steps of the battery electrode surface defect detection method as described in any one of claims 1 to 5 are implemented.

8. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the battery electrode surface defect detection method as claimed in any one of claims 1 to 5 are implemented.

9. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the battery electrode surface defect detection method as claimed in any one of claims 1 to 5 are implemented.