Broken gate defect detection method and device, terminal and computer readable storage medium

By performing grayscale processing and affine transformation on the color images of the photovoltaic cell surface, combined with caliper measurement methods, the problem of poor positioning accuracy of the interrupt gate defect in the prior art is solved, and the precise positioning and length measurement of the interrupt gate is realized, and detection is improved. Accuracy.

CN119251140APending Publication Date: 2025-01-03ZHEJIANG HUARAY TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411116596.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-14
Publication Date
2025-01-03

AI Technical Summary

Technical Problem

The prior art is difficult to accurately detect gate breaking defects of photovoltaic cells, especially because the gate breaking width is small and the color difference from the background is small, resulting in poor positioning accuracy and inability to accurately output gate breaking length.

Method used

By acquiring the color image of the cell surface, performing grayscale processing and affine transformation, combining caliper measurement methods and contrast threshold comparison, the starting point and end point of the breaking gate are determined, thereby calculating the breaking length.

Benefits of technology

It realizes accurate positioning of the gate break and accurate output of the length, improves the detection accuracy and reduces the cost of manual quality inspection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119251140A_ABST
    Figure CN119251140A_ABST
Patent Text Reader

Abstract

The invention provides a broken gate defect detection method and device, a terminal and a computer readable storage medium, and the method comprises the steps: obtaining a color image of the surface of a battery piece, and enabling the surface of the battery piece to be provided with a grid line; the color image has a corresponding grayscale image; performing broken gate defect detection on the color image to obtain a region image containing a broken gate; determining two breaking points of the broken gate based on the gray value of each pixel in the gray image corresponding to the regional image; and based on the two breakpoints corresponding to the broken gate, determining the fracture length of the broken gate in the regional image. According to the invention, a deep learning method is used to carry out broken gate defect detection on a color image, and coarse positioning of a broken gate is realized; two breaking points of the broken gate are determined based on the gray value of each pixel in the gray image corresponding to the regional image, and accurate positioning of the broken gate is realized; the fracture length of the broken gate can be accurately output through the accurately positioned position information of the two breaking points of the broken gate, so that the defect grade of the battery piece can be conveniently graded, and the detection accuracy is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of photovoltaic cell detection, and in particular to a method, device, terminal and computer-readable storage medium for detecting a broken gate defect. Background Art

[0002] The photovoltaic cell field has been booming in recent years. How to achieve high-precision and rapid detection of various defects in the production process and improve the product qualification rate has become the biggest challenge facing the production process. At present, the more obvious scratches, hidden cracks, black spots, cold solder joints, pollution, cracks, broken corners and other defects of photovoltaic cells can be detected by manual detection and traditional computer vision methods. However, photovoltaic broken grid defects cannot be well identified and detected due to their small defect width and small color difference with the background of the photovoltaic cell. Therefore, a method for detecting broken grid defects in photovoltaic cells is urgently needed. Summary of the invention

[0003] The main technical problem solved by the present invention is to provide a method, device, terminal and computer-readable storage medium for detecting broken gate defects, so as to solve the problem in the prior art that the positioning accuracy of broken gate defects is poor and the length of the broken gate cannot be accurately output.

[0004] In order to solve the above technical problems, the first technical solution adopted by the present invention is: to provide a method for detecting a broken gate defect, the method for detecting a broken gate defect comprising:

[0005] Acquire a color image of a cell surface, the cell surface having grid lines; the color image has a corresponding grayscale image;

[0006] Performing broken gate defect detection on the color image to obtain an area image containing the broken gate;

[0007] Based on the grayscale value of each pixel in the grayscale image corresponding to the regional image, determine the starting point and the end point corresponding to the broken gate;

[0008] The breaking length of the broken grid in the regional image is determined based on the starting point and the end point corresponding to the broken grid.

[0009] The method for determining the grayscale image corresponding to the color image includes:

[0010] Grayscale the color image to obtain an initial grayscale image;

[0011] Affine transformation is performed on the initial grayscale image to obtain a grayscale image of the color image; the grid lines in the grayscale image are in a preset direction.

[0012] Wherein, based on the grayscale value of each pixel in the grayscale image corresponding to the regional image, determining the starting point and the end point corresponding to the broken gate includes:

[0013] Based on the position of the regional image in the color image, determine the target detection frame corresponding to the regional image in the grayscale image;

[0014] The grid lines in the target detection frame are detected along the direction of the grid lines by using a caliper measurement method to obtain coordinate data and contrast data corresponding to each grid line edge point corresponding to the grid lines;

[0015] The edge points of the grid lines are screened based on the contrast data of the edge points of the grid lines to obtain candidate mutation points corresponding to the grid lines;

[0016] The contrast data of the candidate mutation point is compared with the second contrast threshold to determine the starting point and the end point corresponding to the broken gate.

[0017] Wherein, the grid lines in the target detection frame are detected along the direction of the grid lines by using a caliper measurement method to obtain coordinate data and contrast data corresponding to each grid line edge point corresponding to the grid lines, including:

[0018] Perform position detection on the grid lines in the target detection frame to obtain the coordinate values ​​corresponding to the grid lines in the extension direction of the grid lines;

[0019] The coordinate value of the grid line is used as the center of the caliper detection frame, and grid line detection is performed on the target detection frame along the extension direction of the grid line to obtain the coordinate data and contrast data corresponding to each grid line edge point corresponding to the grid line; the data in the coordinate data of each grid line edge point in the extension direction of the grid line are all coordinate values.

[0020] Wherein, the edge points of the gate lines are screened based on the contrast data of the edge points of the gate lines to obtain candidate mutation points corresponding to the gate lines, including:

[0021] Performing mean filtering on the contrast data of each grid line edge point corresponding to the grid line to obtain filtered contrast data corresponding to each grid line edge point;

[0022] Determining updated contrast data of the grid line edge point based on a difference between the contrast data corresponding to the grid line edge point and the filtered contrast data;

[0023] Based on the updated contrast data of the gate line edge point, it is determined whether the gate line edge point is used as a candidate mutation point corresponding to the gate line.

[0024] Wherein, determining whether the gate line edge point is used as a candidate mutation point corresponding to the gate line based on the updated contrast data of the gate line edge point includes:

[0025] In response to the updated contrast data of the grid line edge point being greater than the first contrast threshold, the grid line edge point is taken as a candidate mutation point.

[0026] The step of comparing the contrast data of the candidate mutation point with the second contrast threshold to determine the starting point and the end point corresponding to the broken gate includes:

[0027] In response to the contrast data of the candidate mutation point being less than the second contrast threshold, and the contrast data of the previous gate line edge point adjacent to the candidate mutation point being greater than the second contrast threshold, the candidate mutation point is used as the starting point of the gate break;

[0028] Comparing the contrast data of each grid line edge point after the starting point of the broken grid with the second contrast threshold in sequence;

[0029] In response to the contrast data of the current gate line edge point being less than the second contrast threshold, and the contrast data of the next gate line edge point adjacent to the current gate line edge point being greater than the second contrast threshold, the current gate line edge point is taken as the end point of the broken gate; the contrast data of each gate line edge point between the starting point and the end point of the broken gate are all less than the second contrast threshold.

[0030] The step of comparing the contrast data of the candidate mutation point with the second contrast threshold to determine the starting point and the end point corresponding to the broken gate includes:

[0031] Sort the candidate mutation points in sequence according to the coordinate data;

[0032] The first candidate mutation point is used as the first starting point of the gate line;

[0033] Comparing the contrast data of each grid line edge point after the first starting point with the second contrast threshold in sequence;

[0034] In response to the contrast data of the current gate line edge point being greater than the second contrast threshold, and the contrast data of the adjacent previous gate line edge point of the current gate line edge point being less than the second contrast threshold, the adjacent previous gate line edge point of the contrast data of the current gate line edge point is taken as the first end point; wherein the contrast data of the gate line edge points between the first starting point and the first end point are all less than the second contrast threshold.

[0035] The method of comparing the contrast data of the candidate mutation point with the second contrast threshold to determine the starting point and the end point corresponding to the broken gate also includes:

[0036] Comparing the contrast data of each grid line edge point after the first end point with the second contrast threshold in sequence;

[0037] In response to the contrast data of the current gate line edge point being less than the second contrast threshold, and the contrast data of the previous gate line edge point adjacent to the current gate line edge point being greater than the second contrast threshold, the current gate line edge point is taken as the second starting point, and the contrast data of the gate line edge points between the second starting point and the first end point are all greater than the second contrast threshold.

[0038] In order to solve the above technical problems, the second technical solution adopted by the present invention is: to provide a detection device for broken gate defects, the detection device for broken gate defects comprising:

[0039] An acquisition module is used to acquire a color image of a surface of a battery cell, where the surface of the battery cell has grid lines; the color image has a corresponding grayscale image;

[0040] A detection module, used for performing a broken grid defect detection on the color image to obtain an image of a region containing the broken grid;

[0041] An analysis module, used for determining the starting point and the end point corresponding to the broken gate based on the grayscale value of each pixel in the grayscale image corresponding to the regional image;

[0042] The processing module is used to determine the break length of the broken grid in the regional image based on the starting point and the end point corresponding to the broken grid.

[0043] In order to solve the above technical problems, the third technical solution adopted by the present invention is: to provide a terminal, the terminal includes a memory, a processor and a computer program stored in the memory and running on the processor, the processor is used to execute the program data to implement the steps in the above-mentioned broken gate defect detection method.

[0044] In order to solve the above technical problems, the fourth technical solution adopted by the present invention is: providing a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the steps in the above-mentioned method for detecting broken gate defects are implemented.

[0045] The beneficial effects of the present invention are as follows: different from the prior art, a method, device, terminal and computer-readable storage medium for detecting broken gate defects are provided. The method for detecting broken gate defects obtains a color image of the surface of a battery cell, and the surface of the battery cell has a gate line; the color image has a corresponding grayscale image; the color image is detected for broken gate defects to obtain a regional image containing the broken gate; based on the grayscale values ​​of each pixel in the grayscale image corresponding to the regional image, the starting point and end point corresponding to the broken gate are determined; based on the starting point and end point corresponding to the broken gate, the broken length of the broken gate in the regional image is determined. The present application realizes the rough positioning of the broken gate by performing broken gate defect detection on the color image; based on the grayscale values ​​of each pixel in the grayscale image corresponding to the regional image, the two breakpoints of the broken gate are determined to realize the precise positioning of the broken gate; the position information of the two breakpoints of the broken gate can be accurately output through the position information of the precisely located two breakpoints of the broken gate, so as to facilitate the classification of the defect level of the battery cell, improve the detection accuracy, and reduce the cost of manual quality inspection. BRIEF DESCRIPTION OF THE DRAWINGS

[0046] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings required for use in the description of the embodiments will be 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 creative work.

[0047] Figure 1 It is a schematic flow chart of a method for detecting broken gate defects provided by the present invention;

[0048] Figure 2 yes Figure 1 A schematic flow chart of a specific embodiment of step S1 in the provided method for detecting broken gate defects;

[0049] Figure 3 It is a grayscale image of the cell surface;

[0050] Figure 4 yes Figure 1 A schematic flow chart of a specific embodiment of step S3 in the provided method for detecting broken gate defects;

[0051] Figure 5 yes Figure 4 A schematic flow chart of a specific embodiment of step S32 in the provided method for detecting broken gate defects;

[0052] Figure 6 It is a schematic diagram of the position structure of the interruption grid in the caliper detection frame and the target detection frame;

[0053] Figure 7 It is a schematic diagram of the grid line pixels and background pixels in the target detection frame;

[0054] Figure 8 It is a schematic diagram of the framework of an embodiment of a detection device for broken gate defects provided by the present invention;

[0055] Fig. 9 It is a schematic diagram of the framework of a terminal embodiment provided by the present invention;

[0056] Fig.10 It is a schematic diagram of a framework of an embodiment of a computer-readable storage medium provided by the present invention. DETAILED DESCRIPTION

[0057] The scheme of the embodiment of the present application is described in detail below in conjunction with the drawings of the specification.

[0058] In the following description, for the purpose of explanation rather than limitation, specific details such as specific system structures, interfaces, and technologies are provided to facilitate a thorough understanding of the present application.

[0059] The term "and / or" in this article is only a description of the association relationship of the 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, the character " / " in this article generally indicates that the associated objects before and after are in an "or" relationship. In addition, "many" in this article means two or more than two.

[0060] In order to enable those skilled in the art to better understand the technical solution of the present invention, a method for detecting a broken gate defect provided by the present invention is further described in detail below in conjunction with the accompanying drawings and specific implementation methods.

[0061] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which this application belongs. The terms used herein are only for the purpose of describing the embodiments of this application and are not intended to limit this application.

[0062] Before further describing the embodiments of the present application in detail, the nouns and terms involved in the embodiments of the present application are explained. The nouns and terms involved in the embodiments of the present application are subject to the following interpretations.

[0063] The caliper measurement method is a widely used algorithm tool in the field of machine vision, which is used to accurately locate the edge position in the image. Specifically, the caliper measurement method selects the area of ​​interest by using a caliper detection frame, and then projects the area of ​​interest in the caliper detection frame to project the image pixels of the area of ​​interest in the caliper detection frame into a one-dimensional projection mapping image. Among them, the caliper detection frame is a rectangular frame. The rectangular frame includes a long side and a short side, and the projection direction is parallel to the short side direction of the rectangular frame. The image pixels in the area of ​​interest are scanned along the long side direction of the rectangular frame to obtain the grayscale value of each pixel in the one-dimensional projection mapping image. After obtaining the one-dimensional projection image, the peak value of the one-dimensional projection image is obtained by a one-dimensional filtering method (for example, Gaussian first-order derivative filtering). The peak position is the position required by the caliper measurement method, that is, the edge position located by the caliper measurement method. The caliper measurement method will output the edge contrast data at the located edge. Among them, the edge contrast data is the grayscale difference between the two sides of the edge, which is actually the result value of the projection mapping image after one-dimensional filtering.

[0064] The battery cell is printed with main grids and fine grids that are staggered horizontally and vertically. The pixel width of the main grid is wider, and the pixel width of the fine grid is narrower. The main grid and the fine grid are perpendicular to each other.

[0065] Broken gate refers to the breakage of gate lines, and some serious virtual printing can also be classified as broken gate defects.

[0066] Contrast data refers to the difference between the grayscale value of a pixel and the grayscale value of its surrounding pixels.

[0067] Defect grading refers to determining the quality grade of a cell based on the length of broken grids and the number of broken grids in a single cell.

[0068] Affine Transformation is a linear transformation from two-dimensional coordinates to two-dimensional coordinates, which maintains the "straightness" and "parallelism" of two-dimensional graphics. Straightness means that after the transformation, a straight line will still be a straight line without bending, and an arc will still be an arc. Parallelism means that the relative position relationship between two-dimensional graphics remains unchanged, parallel lines remain parallel lines, and the intersection angle of intersecting straight lines remains unchanged.

[0069] The method for detecting broken gate defects provided in the embodiments of the present application can be implemented by a server or a terminal alone, or by a server and a terminal in collaboration. In some embodiments, the terminal or server can implement the method for detecting broken gate defects provided in the embodiments of the present application by running a computer program. For example, the computer program can be a native program or software module in the operating system; it can be a native application (APP, Application), that is, a program that needs to be installed in the operating system to run, such as a client that supports virtual scenes, such as a game APP; it can also be a small program, that is, a program that only needs to be downloaded to a browser environment to run; it can also be a small program that can be embedded in any APP. In short, the above-mentioned computer program can be an application, module or plug-in in any form.

[0070] In the production process of photovoltaic cells, it is necessary to detect and locate the broken grid defects of the grid lines, and to grade the product quality according to the broken length of the grid lines and the number of broken grids. Different grades of products correspond to different defect standards. The following embodiment mainly introduces the location of the broken grid defects, the number of broken grids and the broken length of the broken grids.

[0071] The following uses a server implementation as an example to illustrate the method for detecting broken gate defects provided in an embodiment of the present application.

[0072] See also Figure 1 , Figure 1 It is a schematic flow chart of the method for detecting broken gate defects provided by the present invention.

[0073] The present embodiment provides a method for detecting a broken gate defect, and the method for detecting a broken gate defect includes the following steps.

[0074] S1: Acquire a color image of the surface of a cell, where the surface of the cell has grid lines; the color image has a corresponding grayscale image.

[0075] S2: Perform broken grid defect detection on the color image to obtain a region image containing the broken grid.

[0076] S3: Determine the starting point and the end point corresponding to the broken gate based on the grayscale value of each pixel in the grayscale image corresponding to the regional image.

[0077] S4: Determine the break length of the broken grid in the regional image based on the start point and the end point corresponding to the broken grid.

[0078] Specifically, the specific implementation of obtaining the corresponding grayscale image of the color image in step S1 is as follows.

[0079] See also Figure 2 and Figure 3 , Figure 2 yes Figure 1 A schematic flow chart of a specific embodiment of step S1 in the provided method for detecting broken gate defects; Figure 3 It is a grayscale image of the cell surface.

[0080] S11: Acquire a color image of the surface of the battery cell.

[0081] Specifically, an industrial camera is used to collect images of the surface of the cell to obtain a color image of the surface of the cell. In this embodiment, the color image of the surface of the cell is an RGB color image. The surface of the cell has a main grid and a fine grid, and the main grid and the fine grid are perpendicular to each other.

[0082] S12: grayscale the color image to obtain an initial grayscale image.

[0083] Specifically, the color image of the cell surface is preprocessed to obtain an initial grayscale image of the cell surface, wherein the preprocessing includes grayscale processing.

[0084] S13: performing affine transformation processing on the initial grayscale image to obtain a grayscale image of the color image; the grid lines in the grayscale image are in a preset direction.

[0085] Specifically, due to the different postures of the cells, the directions of the main grid and fine grid on the cell surface collected in the color image are different. In order to facilitate detection, the initial grayscale image is affine transformed to correct the direction of the grid lines in the initial grayscale image so that the grid lines in the initial grayscale image are in a preset direction. The preset direction includes the horizontal direction and the vertical direction, such as Figure 3 .

[0086] In one embodiment, the main grid in the cell is placed in the horizontal direction and the fine grid is placed in the vertical direction through affine transformation processing; the main grid in the cell can also be placed in the vertical direction and the fine grid is placed in the horizontal direction. In the following embodiments, the main grid is placed in the vertical direction and the fine grid is placed in the horizontal direction as an example for specific description.

[0087] Specifically, in step S2, the broken gate defect detection is performed on the color image to obtain the region image containing the broken gate, as shown in the following specific implementation.

[0088] In one embodiment, a color image of the surface of the battery cell is input into a pre-trained broken gate defect detection model or a segmentation network model to obtain a broken gate detection frame and position information of each broken gate detection frame. The image in the broken gate detection frame is extracted as a regional image of the broken gate. The broken gate defect detection model may be a YOLO network model, etc.; the segmentation network model may be a U-Net network model. In this embodiment, the regional image of the broken gate is a rectangle.

[0089] Specifically, in step S3, based on the grayscale value of each pixel in the grayscale image corresponding to the regional image, a specific implementation method for determining the starting point and the end point corresponding to the broken gate is as follows.

[0090] See also Figure 4 , Figure 4 yes Figure 1 A flowchart of a specific embodiment of step S3 in a method for detecting broken gate defects is provided.

[0091] S31: Based on the position of the regional image in the color image, determine the target detection frame corresponding to the regional image in the grayscale image.

[0092] Specifically, since the size of the color image and the grayscale image is the same, based on the position information of the regional image in the color image, the target detection frame corresponding to the regional image in the grayscale image is determined. The target detection frame is a rectangular frame, and the long side of the target detection frame is parallel to the grid lines contained in the target detection frame.

[0093] S32: Using a caliper measurement method to detect the grid lines in the target detection frame along the direction of the grid lines, and obtaining coordinate data and contrast data corresponding to each grid line edge point corresponding to the grid lines.

[0094] See also Figure 5 , Figure 5 yes Figure 4 A flowchart of a specific embodiment of step S32 in a method for detecting a broken gate defect is provided.

[0095] S321: Perform position detection on the grid lines in the target detection frame to obtain coordinate values ​​corresponding to the grid lines in the extension direction of the grid lines.

[0096] In a specific embodiment, in response to the target detection frame including a fine grid set in the horizontal direction, the caliper detection frame is set on the short side of the target detection frame, and the caliper detection frame selects the fine grid. The length of the long side of the caliper detection frame can be consistent with the length of the short side of the target detection frame. Among them, the length direction of the caliper detection frame and the setting direction of the fine grid are perpendicular to each other. The projection direction of the caliper detection frame is parallel to the short side of the caliper detection frame, so that the regional image in the caliper detection frame is projected and compressed into a one-dimensional projection image, and the grayscale values ​​of the pixels on the corresponding row are compressed to obtain the grayscale values ​​of each pixel in the one-dimensional projection image. The grayscale value of each pixel in the one-dimensional projection image is subjected to one-dimensional filtering to obtain the peak value of the one-dimensional projection image, and the position of the peak value is the coordinate data of the fine grid edge point in the target detection frame. The difference between the grayscale value at the coordinate data of the fine grid edge point and the grayscale value on both sides of the fine grid is used as the contrast data of the fine grid edge point. In an embodiment, there can be two caliper detection frames, and the caliper detection frames are respectively set on the two short sides of the target detection frame to select the fine grid. Specifically, when there are at least two contrast data of a fine grid edge point, the average value of the at least two contrast data can be used as the contrast data of the fine grid edge point. The ordinate of the fine grid is used as the coordinate value of the fine grid.

[0097] In a specific embodiment, in response to the target detection frame including a main grid set in the vertical direction, the caliper detection frame is set on the short side of the target detection frame, and the caliper detection frame selects the main grid. The length of the long side of the caliper detection frame can be consistent with the length of the short side of the target detection frame. Among them, the length direction of the caliper detection frame is perpendicular to the setting direction of the main grid. The projection direction of the caliper detection frame is parallel to the short side of the caliper detection frame, so that the regional image projection in the caliper detection frame is compressed into a one-dimensional projection image, and the grayscale values ​​of the pixels on the corresponding row are compressed to obtain the grayscale values ​​of each pixel in the one-dimensional projection image. The grayscale values ​​of each pixel in the one-dimensional projection image are subjected to one-dimensional filtering to obtain the peak value of the one-dimensional projection image, and the position of the peak value is the coordinate data of the main grid edge point in the target detection frame. The difference between the grayscale value at the coordinate data of the main grid edge point and the grayscale value on both sides of the main grid is used as the contrast data of the main grid edge point. The horizontal coordinate of the main grid is used as the coordinate value of the main grid.

[0098] In this step, the projection length of the caliper detection frame can be set to 10 or 11, etc.

[0099] S322: Use the coordinate value of the grid line as the center of the caliper detection frame, and perform grid line detection on the target detection frame along the extension direction of the grid line to obtain the coordinate data and contrast data corresponding to each grid line edge point corresponding to the grid line; the data in the coordinate data of each grid line edge point in the extension direction of the grid line are all coordinate values.

[0100] See also Figure 6 , Figure 6It is a schematic diagram of the position structure of the interruption grid in the caliper detection frame and the target detection frame.

[0101] In one embodiment, in response to the target detection frame including a fine grid arranged in the horizontal direction, the straight line on the ordinate of the fine grid is used as the central axis of the caliper detection frame in the length direction. That is, the straight line on which the ordinate of the fine grid is located is perpendicular to the long side of the caliper detection frame, and the fine grid is the symmetry axis of the caliper detection frame in the horizontal direction. The detection range of the caliper detection frame is the range from one short side to the other short side of the target detection frame. Along the extension direction of the fine grid, the caliper detection frame is used to perform grid line detection on pixels column by column starting from the short side of one side of the target detection frame, and the coordinate data and contrast data corresponding to the fine grid edge points corresponding to each column of pixels are obtained. The coordinate data corresponding to the fine grid edge points corresponding to each column of pixels are composed into a coordinate data set. The contrast data of the fine grid edge points corresponding to each column of pixels are composed into a contrast data set.

[0102] In one embodiment, in response to the main grid set in the vertical direction included in the target detection frame, the straight line on the horizontal and vertical coordinates of the main grid is used as the central axis of the caliper detection frame in the length direction. That is, the straight line where the horizontal coordinate of the main grid is located is perpendicular to the long side of the caliper detection frame, and the main grid is the symmetry axis of the caliper detection frame in the vertical direction. The detection range of the caliper detection frame is the range from one short side to the other short side of the target detection frame. Along the extension direction of the main grid, the caliper detection frame is used to perform grid line detection on pixels row by row starting from the short side of one side of the target detection frame, and the coordinate data and contrast data corresponding to the main grid edge points corresponding to each row of pixels are obtained. The coordinate data of the main grid edge points corresponding to each row of pixels are composed into a coordinate data set. The contrast data of the main grid edge points corresponding to each row of pixels are composed into a contrast data set.

[0103] In this step, the projection length of the caliper detection frame can be set to 1 or 2, etc.

[0104] S33: Screening the edge points of the gate lines based on the contrast data of the edge points of the gate lines to obtain candidate mutation points corresponding to the gate lines.

[0105] In this embodiment, the local difference value is used to screen out the candidate edge coordinates of the broken grid.

[0106] Specifically, mean filtering is performed on the contrast data of all gate line edge points corresponding to the gate lines to obtain filtered contrast data corresponding to each gate line edge point; based on the difference between the contrast data corresponding to the gate line edge point and the filtered contrast data, updated contrast data of the gate line edge point is determined; based on the updated contrast data of the gate line edge point, it is determined whether the gate line edge point is a candidate mutation point corresponding to the gate line.

[0107] In a specific embodiment, in response to the updated contrast data of the gate line edge point being greater than the first contrast threshold, the gate line edge point is used as a candidate mutation point. The first contrast threshold can be a set value or an empirical value, which is set according to actual conditions.

[0108] S34: Compare the contrast data of the candidate mutation point with the second contrast threshold to determine the starting point and the end point corresponding to the broken gate.

[0109] See also Figure 7 , Figure 7 It is a schematic diagram of the grid line pixels and background pixels in the target detection frame.

[0110] Since the grayscale value of the gate line pixel is greater than the grayscale value of the background pixel, the contrast data between the gate line pixel and the adjacent background pixel is greater than the contrast data between the background pixel and the adjacent background pixel, the starting point and the end point of the broken gate can be accurately determined by comparing the contrast data with the second contrast threshold. The second contrast threshold can be a set value or an empirical value, which is set according to actual conditions.

[0111] In one embodiment, in response to the contrast data of the candidate mutation point being less than the second contrast threshold, and the contrast data of the previous grid line edge point adjacent to the candidate mutation point being greater than the second contrast threshold, the candidate mutation point is used as the starting point of the grid break. The contrast data of each grid line edge point after the starting point of the grid break is sequentially compared with the second contrast threshold. In response to the contrast data of the current grid line edge point being less than the second contrast threshold, and the contrast data of the next grid line edge point adjacent to the current grid line edge point being greater than the second contrast threshold, the current grid line edge point is used as the end point of the grid break; the contrast data of each grid line edge point between the starting point of the grid break and the end point of the grid break are all less than the second contrast threshold.

[0112] The coordinate data of the starting point and the coordinate data of the end point in pairs corresponding to the broken grid can be obtained in the above manner.

[0113] In a specific embodiment, candidate mutation points are sorted in sequence according to coordinate data; the first candidate mutation point is used as the first starting point of the gate line; the contrast data of each gate line edge point after the first starting point is compared with the second contrast threshold in sequence; in response to the contrast data of the current gate line edge point being greater than the second contrast threshold, and the contrast data of the adjacent previous gate line edge point of the current gate line edge point being less than the second contrast threshold, the adjacent previous gate line edge point of the contrast data of the current gate line edge point is used as the first end point; wherein the contrast data of the gate line edge points between the first starting point and the first end point are all less than the second contrast threshold.

[0114] In a specific embodiment, the contrast data of each grid line edge point after the first end point is compared with the second contrast threshold in sequence; in response to the contrast data of the current grid line edge point being less than the second contrast threshold, and the contrast data of the previous grid line edge point adjacent to the current grid line edge point being greater than the second contrast threshold, the current grid line edge point is used as the second starting point, and the contrast data of the grid line edge points between the second starting point and the first end point are all greater than the second contrast threshold. The coordinate data of the second end point is obtained by the specific implementation method of obtaining the first end point in the above embodiment.

[0115] The first starting point and the first end point obtained through the above embodiment are a pair, and the second starting point and the second end point are a pair.

[0116] Through the above implementation, the coordinate data of the starting points and the coordinate data of the end points in pairs corresponding to all the fractured regions in the fracture grid can be obtained.

[0117] Specifically, the specific implementation of determining the break length of the broken grid in the regional image based on the two break points corresponding to the broken grid in step S4 is as follows.

[0118] In one embodiment, through the above steps, the coordinate data of the paired starting points and the coordinate data of the end points corresponding to all the broken areas on the broken grid in the target detection frame can be obtained, and the break length of the broken area corresponding to the starting point and the end point can be determined based on the coordinate information of the paired starting points and the coordinate information of the end points.

[0119] The fracture lengths of the fractured areas on the fractured grid in the target detection frame can be obtained through the above specific implementation manner.

[0120] The fracture length of the broken grid in the target detection frame is determined based on the sum of the fracture lengths of all fractured regions in the target detection frame.

[0121] The above method can be used to determine the broken length of the broken grid in each area image in the color image, so as to count the number of broken grids corresponding to the battery cell and the broken length of each broken grid, and then determine the grade of the battery cell.

[0122] The present embodiment provides a method for detecting a broken grid defect, by acquiring a color image of the surface of a battery cell, the surface of the battery cell having a grid line; the color image having a corresponding grayscale image; performing a broken grid defect detection on the color image to obtain a regional image containing a broken grid; determining the starting point and end point corresponding to the broken grid based on the grayscale value of each pixel in the grayscale image corresponding to the regional image; determining the broken length of the broken grid in the regional image based on the starting point and end point corresponding to the broken grid. The present application achieves a rough positioning of the broken grid by performing a broken grid defect detection on the color image; determines two breakpoints of the broken grid based on the grayscale value of each pixel in the grayscale image corresponding to the regional image, and achieves accurate positioning of the broken grid; the position information of the two breakpoints of the broken grid can accurately output the broken length of the broken grid through the position information of the accurately located two breakpoints of the broken grid, thereby achieving the detection of the broken grid defect on the surface of the battery cell.

[0123] See also Figure 8 , Figure 8 It is a schematic diagram of the framework of an embodiment of a detection device for broken gate defects provided by the present invention.

[0124] This embodiment provides a detection device 60 for broken gate defects. The detection device 60 for broken gate defects includes an acquisition module 61 , a detection module 62 , an analysis module 63 and a processing module 64 .

[0125] The acquisition module 61 is used to acquire a color image of the surface of the battery cell, where the surface of the battery cell has grid lines; the color image has a corresponding grayscale image.

[0126] The detection module 62 is used to perform a broken grid defect detection on the color image to obtain a region image containing the broken grid.

[0127] The analysis module 63 is used to determine the starting point and the end point corresponding to the broken gate based on the grayscale value of each pixel in the grayscale image corresponding to the regional image.

[0128] The processing module 64 is used to determine the break length of the broken grid in the regional image based on the start point and the end point corresponding to the broken grid.

[0129] In the detection device for broken gate defects provided in the present embodiment, broken gate defect detection is performed on a color image to achieve rough positioning of the broken gate; two breakpoints of the broken gate are determined based on the grayscale values ​​of each pixel in the grayscale image corresponding to the regional image to achieve precise positioning of the broken gate; the position information of the two breakpoints of the broken gate that are precisely located can accurately output the fracture length of the broken gate, thereby achieving detection of the broken gate defect on the surface of the battery cell.

[0130] See also Fig. 9 , Fig. 980 is a schematic diagram of a terminal embodiment provided by the present invention. The terminal 80 includes a memory 81 and a processor 82 coupled to each other, and the processor 82 is used to execute program instructions stored in the memory 81 to implement the steps of any of the above-mentioned broken gate defect detection method embodiments. In a specific implementation scenario, the terminal 80 may include but is not limited to: a microcomputer, a server, and in addition, the terminal 80 may also include a mobile device such as a laptop computer and a tablet computer, which is not limited here.

[0131] Specifically, the processor 82 is used to control itself and the memory 81 to implement the steps of any of the above-mentioned broken gate defect detection method embodiments. The processor 82 can also be called a CPU (Central Processing Unit). The processor 82 may be an integrated circuit chip with signal processing capabilities. The processor 82 can also be a general-purpose processor, a digital signal processor (Digital Signal Processor, DSP), an application-specific integrated circuit (Application Specific Integrated Circuit, ASIC), a field-programmable gate array (Field-Programmable Gate Array, FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor, etc. In addition, the processor 82 can be implemented by an integrated circuit chip.

[0132] In the above scheme, the method for detecting broken gate defects includes: obtaining a color image of the surface of the battery cell, the surface of the battery cell has a gate line; the color image has a corresponding grayscale image; performing broken gate defect detection on the color image to obtain a regional image containing the broken gate; determining the starting point and end point corresponding to the broken gate based on the grayscale value of each pixel in the grayscale image corresponding to the regional image; determining the broken length of the broken gate in the regional image based on the starting point and end point corresponding to the broken gate.

[0133] See also Fig.10 , Fig.10 The computer-readable storage medium 90 stores program instructions 901 that can be executed by a processor, and the program instructions 901 are used to implement the steps of any of the above-mentioned broken gate defect detection method embodiments.

[0134] In the above scheme, the method for detecting broken gate defects includes: obtaining a color image of the surface of the battery cell, the surface of the battery cell has a gate line; the color image has a corresponding grayscale image; performing broken gate defect detection on the color image to obtain a regional image containing the broken gate; determining the starting point and end point corresponding to the broken gate based on the grayscale value of each pixel in the grayscale image corresponding to the regional image; determining the broken length of the broken gate in the regional image based on the starting point and end point corresponding to the broken gate.

[0135] In some embodiments, the functions or modules included in the device provided by the embodiments of the present disclosure can be used to execute the method described in the above method embodiments. The specific implementation can refer to the description of the above method embodiments, and for the sake of brevity, it will not be repeated here.

[0136] The above description of various embodiments tends to emphasize the differences between the various embodiments. The same or similar aspects can be referenced to each other, and for the sake of brevity, they will not be repeated herein.

[0137] In the several embodiments provided in the present application, it should be understood that the disclosed methods and devices can be implemented in other ways. For example, the device implementation described above is only schematic. For example, the division of modules or units is only a logical function division. There may be other division methods in actual implementation, such as units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, and the indirect coupling or communication connection of devices or units can be electrical, mechanical or other forms.

[0138] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0139] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or all or 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 to enable a computer device (which can be a personal computer, server, or network device, etc.) or a processor (processor) to perform all or part of the steps of each implementation method of the present application. 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 code.

[0140] The above are only implementation modes of the present invention, and are not intended to limit the patent protection scope of the present invention. Any equivalent structure or equivalent process transformation made using the contents of the present invention specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present invention.

Claims

1. A method for detecting a broken gate defect, characterized in that: The method for detecting the broken gate defect comprises: Acquire a color image of a cell surface, wherein the cell surface has grid lines; the color image has a corresponding grayscale image; Performing a broken gate defect detection on the color image to obtain a region image containing the broken gate; Determine the starting point and the end point corresponding to the broken gate based on the grayscale value of each pixel in the grayscale image corresponding to the regional image; Based on the starting point and the end point corresponding to the broken grid, a breaking length of the broken grid in the regional image is determined.

2. The method for detecting broken gate defects according to claim 1, characterized in that: The method for determining the grayscale image corresponding to the color image includes: Performing grayscale processing on the color image to obtain an initial grayscale image; Affine transformation is performed on the initial grayscale image to obtain a grayscale image of the color image; the grid lines in the grayscale image are in a preset direction.

3. The method for detecting broken gate defects according to claim 1, characterized in that: The step of determining the starting point and the end point corresponding to the broken gate based on the grayscale value of each pixel in the grayscale image corresponding to the regional image comprises: Based on the position of the regional image in the color image, determining a target detection frame corresponding to the regional image in the grayscale image; Using a caliper measurement method to detect the grid lines in the target detection frame along the direction of the grid lines, and obtaining coordinate data and contrast data corresponding to each grid line edge point corresponding to the grid lines; Screening the edge points of the gate lines based on the contrast data of the edge points of the gate lines to obtain candidate mutation points corresponding to the gate lines; The contrast data of the candidate mutation point is compared with a second contrast threshold to determine the starting point and the end point corresponding to the broken gate.

4. The method for detecting broken gate defects according to claim 3, characterized in that: The method of using a caliper measurement method to detect the grid lines in the target detection frame along the direction of the grid lines to obtain coordinate data and contrast data corresponding to each grid line edge point corresponding to the grid lines includes: Performing position detection on the grid lines in the target detection frame to obtain coordinate values ​​of the grid lines corresponding to the extending directions of the grid lines; The coordinate value of the grid line is used as the center of the caliper detection frame, and grid line detection is performed on the target detection frame along the extension direction of the grid line to obtain the coordinate data and contrast data corresponding to each grid line edge point corresponding to the grid line; the data in the coordinate data of each grid line edge point in the extension direction of the grid line are all the coordinate values.

5. The method for detecting broken gate defects according to claim 3, characterized in that: The step of screening the gate line edge points based on the contrast data of the gate line edge points to obtain candidate mutation points corresponding to the gate lines comprises: Performing mean filtering on the contrast data of each of the grid line edge points corresponding to the grid line to obtain filtered contrast data corresponding to each of the grid line edge points; Determining updated contrast data of the gate line edge point based on a difference between the contrast data corresponding to the gate line edge point and the filtered contrast data; Based on the updated contrast data of the gate line edge point, it is determined whether the gate line edge point is used as a candidate mutation point corresponding to the gate line.

6. The method for detecting broken gate defects according to claim 5, characterized in that: The step of determining whether the gate line edge point is used as a candidate mutation point corresponding to the gate line based on the updated contrast data of the gate line edge point comprises: In response to the updated contrast data of the gate line edge point being greater than a first contrast threshold, the gate line edge point is used as the candidate mutation point.

7. The method for detecting broken gate defects according to claim 3, characterized in that: The step of comparing the contrast data of the candidate mutation point with a second contrast threshold to determine the starting point and the end point corresponding to the broken gate includes: In response to the contrast data of the candidate mutation point being less than the second contrast threshold, and the contrast data of the previous gate line edge point adjacent to the candidate mutation point being greater than the second contrast threshold, the candidate mutation point is used as the starting point of the gate break; Comparing the contrast data of each of the edge points of the gate line after the starting point of the gate break with the second contrast threshold in sequence; In response to the contrast data of the current gate line edge point being less than the second contrast threshold, and the contrast data of the next gate line edge point adjacent to the current gate line edge point being greater than the second contrast threshold, the current gate line edge point is taken as the end point of the broken gate; the contrast data of each gate line edge point between the starting point of the broken gate and the end point of the broken gate are all less than the second contrast threshold.

8. The method for detecting broken gate defects according to claim 3, characterized in that: The step of comparing the contrast data of the candidate mutation point with a second contrast threshold to determine the starting point and the end point corresponding to the broken gate includes: Sort the candidate mutation points in sequence according to the coordinate data; Taking the first candidate mutation point as the first starting point of the gate line; Comparing the contrast data of each of the grid line edge points after the first starting point with the second contrast threshold in sequence; In response to the contrast data of the current gate line edge point being greater than the second contrast threshold, and the contrast data of the adjacent previous gate line edge point of the current gate line edge point being less than the second contrast threshold, the adjacent previous gate line edge point of the contrast data of the current gate line edge point is taken as the first end point; wherein the contrast data of the gate line edge points between the first starting point and the first end point are all less than the second contrast threshold.

9. The method for detecting broken gate defects according to claim 8, characterized in that: The step of comparing the contrast data of the candidate mutation point with a second contrast threshold to determine the starting point and the end point corresponding to the broken gate further includes: Comparing the contrast data of each of the grid line edge points after the first end point with the second contrast threshold in sequence; In response to the contrast data of the current gate line edge point being less than the second contrast threshold, and the contrast data of the previous gate line edge point adjacent to the current gate line edge point being greater than the second contrast threshold, the current gate line edge point is taken as the second starting point, and the contrast data of the gate line edge points between the second starting point and the first end point are all greater than the second contrast threshold.

10. A detection device for broken gate defects, characterized in that: The detection device for broken gate defects comprises: An acquisition module, used to acquire a color image of a surface of a battery cell, wherein the surface of the battery cell has grid lines; the color image has a corresponding grayscale image; A detection module, used for performing a broken grid defect detection on the color image to obtain a region image containing the broken grid; An analysis module, used for determining a starting point and an end point corresponding to the broken gate based on the grayscale value of each pixel in the grayscale image corresponding to the regional image; A processing module is used to determine the fracture length of the broken grid in the regional image based on the starting point and the end point corresponding to the broken grid.

11. A terminal, characterized in that: The terminal includes a memory, a processor, and a computer program stored in the memory and running on the processor, wherein the processor is used to execute program data to implement the steps in the method for detecting broken gate defects according to any one of claims 1 to 9.

12. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps in the method for detecting broken gate defects according to any one of claims 1 to 9 are implemented.