Battery shell detection method, device, equipment, medium and product
By conducting curve fitting detection of the corner images of the battery case, the problem of corner burr detection of the battery case is solved, more accurate burr detection is achieved, and the safety of the battery is improved.
Patent Information
- Application Number
- CN202311728928.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-14
- Publication Date
- 2025-06-17
AI Technical Summary
The edges and corners of the battery case are prone to burrs during the stamping process, resulting in poor sealing of the battery and safety hazards. It is difficult for the prior art to effectively detect burrs at the edges and corners.
By obtaining the corner images of the battery case, the target edge profile of the curved part is extracted, and curve fitting is performed based on feature points to determine whether there are glitches on the corners.
It realizes more accurate detection of burrs at the corners of the battery case, improves the safety of the battery and reduces the risk of liquid leakage.
Smart Images

Figure CN120163756A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of visual detection technology, and particularly to a method, device, equipment, medium and product for detecting a battery housing. Background Art
[0002] Burrs are likely to appear at the edges and corners of the battery housing during the stamping process. The presence of burrs at the edges and corners of the battery housing will result in poor sealing of the battery, which may cause battery leakage and pose a safety hazard.
[0003] In order to improve the safety of the battery, it is necessary to detect whether there are burrs at the edges and corners of the battery housing. Therefore, a method for detecting whether there are burrs at the edges and corners of the battery housing is needed. Summary of the Invention
[0004] The present application provides a method, device, equipment, medium and product for detecting a battery housing, which can more accurately detect whether there are burrs at the edges and corners of the battery housing through curve fitting.
[0005] In a first aspect, the present application provides a method for detecting a battery housing, including: obtaining a first image of a first edge and corner of the battery housing, where the first edge and corner is a rounded corner; extracting a target edge contour of a curved portion of the first edge and corner in the first image; performing curve fitting based on feature points of the target edge contour to obtain a target curve; and determining whether there are burrs on the first edge and corner based on the target curve.
[0006] Thus, it is possible to obtain a first image of the first edge and corner of the battery housing, then extract the target edge contour of the curved portion of the first edge and corner in the first image, perform curve fitting based on the feature points of the target edge contour to obtain a target curve, and determine whether there are burrs on the first edge and corner based on the target curve. In this way, through curve fitting, it is possible to more accurately detect whether there are burrs at the edges and corners of the battery housing.
[0007] In some embodiments, performing curve fitting based on feature points of the target edge contour to obtain a target curve includes: performing circular fitting based on two end points of the target edge contour to obtain a target circle; determining whether there are burrs on the first edge and corner based on the target curve includes: calculating a difference between a distance from a point on the target edge contour to the center of the target circle and the radius of the target circle; and determining that there is a burr at the first point when there is a first point on the target edge contour corresponding to a difference greater than a first threshold.
[0008] In this way, by performing circular fitting based on two end points of the target edge contour and determining whether the difference between the distance from each point on the target edge contour to the center of the target circle and the radius of the target circle exceeds the first threshold, it is possible to accurately determine whether there are burrs on the first edge and corner.
[0009] In some embodiments, the method for detecting the battery housing further includes: when the difference corresponding to each point on the target edge contour is not greater than a first threshold, performing a quadratic curve fitting based on target points on the target edge contour to obtain a target quadratic curve, where the target points include at least three points; calculating the curvature of the target quadratic curve; and when the curvature is greater than a second threshold, determining that there are burrs on the edge contour segment corresponding to the target points.
[0010] In this way, since the curvature change can reflect the smoothness of the curve, determining that there are burrs on the edge contour segment based on the curvature of the target quadratic curve can further detect whether there are small and discontinuous burrs on the first corner.
[0011] In some embodiments, obtaining a first image of the first corner of the battery housing includes: obtaining a color image of the first corner of the battery housing; performing grayscale processing on the color image to obtain a second image; and performing binarization processing on the second image to obtain a first image.
[0012] In this way, through preprocessing such as grayscale and binarization of the directly obtained color image of the first corner, the first corner in the image can be highlighted, thereby facilitating more accurate burr detection of the first corner of the battery housing.
[0013] In some embodiments, extracting the edge contour of the bent portion of the first corner in the first image includes: performing edge detection on the first image to obtain a first edge contour of the first corner; removing the edge contour segments of the straight portions from the first edge contour to obtain a third image including a second edge contour, where the second edge contour is the edge contour of the bent portion of the first corner; and determining a target edge contour according to the connected components of different regions in the third image, where the target edge contour is the outer edge contour of the bent portion of the first corner.
[0014] In this way, the outer edge contour of the bent portion of the first corner can be accurately extracted through the above process, so that the first corner can be more accurately detected for burrs based on the outer edge contour of the bent portion of the first corner.
[0015] In some embodiments, removing the edge contour segments of the straight part from the first edge contour to obtain a third image including a second edge contour includes: cutting the first edge contour to obtain a plurality of straight line segments; determining, from the plurality of straight line segments, a plurality of first straight line segments with lengths greater than a third threshold; determining vertical line segments and horizontal line segments from the plurality of first straight line segments according to the abscissa difference and ordinate difference between the two end points respectively corresponding to each first straight line segment; determining a segmentation point according to each of the vertical line segments and the horizontal line segments to obtain two segmentation points; determining the edge contour segments of the first edge contour other than the edge contour segments between the two segmentation points as the edge contour segments of the straight part; and removing the edge contour segments of the straight part from the first edge contour to obtain a third image including a second edge contour.
[0016] In this way, based on information such as the length, abscissa difference, and ordinate difference of the straight line segments included in the first edge contour, the edge contour of the bent part of the first corner can be determined quickly and accurately.
[0017] In some embodiments, determining a segmentation point according to each of the vertical line segments and the horizontal line segments to obtain two segmentation points includes: determining a first segmentation point according to the ordinate of the overlapping part of the straight line where the vertical line segment is located and the first edge contour; determining a second segmentation point according to the abscissa of the overlapping part of the straight line where the horizontal line segment is located and the first edge contour; and determining the first segmentation point and the second segmentation point as the two segmentation points.
[0018] In this way, through the above process, the two segmentation points can be determined more accurately, so as to more accurately segment the edge contour of the bent part of the first corner.
[0019] In some embodiments, determining a target edge contour according to the connected components of different regions in the third image includes: sorting the connected components corresponding to different regions in the third image from largest to smallest to obtain a connected component sequence; and determining the region corresponding to the second connected component in the connected component sequence as the target edge contour.
[0020] In this way, by sorting the connected components corresponding to different regions in the third image from largest to smallest, the outer edge contour of the bent part of the first corner can be accurately determined.
[0021] In a second aspect, the present application provides a detection device for a battery housing, including: an acquisition module, configured to acquire a first image of a first corner of the battery housing, where the first corner is a rounded corner; an extraction module, configured to extract a target edge contour of the bent part of the first corner in the first image; a fitting module, configured to perform curve fitting based on the feature points of the target edge contour to obtain a target curve; and a determination module, configured to determine whether there are burrs on the first corner based on the target curve.
[0022] Thus, a first image of the first corner of the battery housing can be obtained, then the target edge contour of the bent portion of the first corner in the first image can be extracted, and then curve fitting can be performed based on the feature points of the target edge contour to obtain a target curve, and whether there are burrs on the first corner can be determined based on the target curve. In this way, through curve fitting, it is possible to more accurately detect whether there are burrs at the corners of the battery housing.
[0023] In a third aspect, the present application provides an electronic device, which includes: a processor and a memory storing computer program instructions;
[0024] When the processor executes the computer program instructions, the detection method of the battery housing shown in any one of the embodiments of the first aspect is implemented.
[0025] In a fourth aspect, the present application provides a computer storage medium, on which computer program instructions are stored, and when the computer program instructions are executed by a processor, the detection method of the battery housing shown in any one of the embodiments of the first aspect is implemented.
[0026] In a fifth aspect, an embodiment of the present application provides a computer program product, and when the instructions in the computer program product are executed by a processor of an electronic device, the electronic device is caused to execute the detection method of the battery housing shown in any one of the embodiments of the first aspect.
[0027] The above description is only an overview of the technical solution of the present application. In order to be able to understand the technical means of the present application more clearly, it can be implemented according to the content of the specification. And in order to make the above and other purposes, features and advantages of the present application more obvious and understandable, the specific embodiments of the present application are hereinafter specifically exemplified. Description of the Drawings
[0028] By reading the following detailed description of the preferred embodiments, various other advantages and benefits will become clear to those of ordinary skill in the art. The drawings are only for the purpose of showing the preferred embodiments and are not considered to be a limitation of the present application. And in all the drawings, the same reference numerals are used to represent the same components. In the drawings:
[0029] Figure 1 is one of the flow diagrams of a detection method for a battery housing provided in some embodiments of the present application;
[0030] Figure 2 is one of the schematic diagrams of a first image provided in some embodiments of the present application;
[0031] Figure 3 is another schematic diagram of a first image provided in some embodiments of the present application;
[0032] Figure 4Schematic diagram of a burr provided for some embodiments of the present application;
[0033] Figure 5 Second flowchart of a battery housing detection method provided for some embodiments of the present application;
[0034] Figure 6 Structural diagram of a battery housing detection device provided for some embodiments of the present application;
[0035] Figure 7 Structural diagram of an electronic device provided for some embodiments of the present application. Detailed implementation manners
[0036] The embodiments of the technical solutions of the present application will be described in detail below with reference to the accompanying drawings. The following embodiments are only used to illustrate the technical solutions of the present application more clearly, so they are only examples and cannot be used to limit the protection scope of the present application.
[0037] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by those of ordinary skill in the technical field to which this application belongs; the terms used herein are only for the purpose of describing specific embodiments and are not intended to limit this application; the terms "including" and "having" and any variations thereof in the specification and claims of this application and the above drawings are intended to cover non-exclusive inclusion.
[0038] In the description of the embodiments of this application, technical terms such as "first" and "second" are only used to distinguish different objects and cannot be understood as indicating or implying relative importance or implicitly indicating the quantity, specific order or primary-secondary relationship of the indicated technical features. In the description of the embodiments of this application, "a plurality of" means more than two unless otherwise specifically defined.
[0039] Referring to "embodiment" herein means that a specific feature, structure or characteristic described in connection with the embodiment may be included in at least one embodiment of this application. The phrase does not necessarily refer to the same embodiment at each occurrence in the specification, nor is it an independent or alternative embodiment mutually exclusive with other embodiments. Those skilled in the art will explicitly and implicitly understand that the embodiments described herein may be combined with other embodiments.
[0040] In the description of the embodiments of this application, the term " / and" is only a description of the association relationship of associated objects, indicating that there can be three relationships. For example, A and / or B can represent: A exists alone, A and B exist simultaneously, and B exists alone. In addition, the character " / " in this article generally represents an "or" relationship between the associated objects before and after.
[0041] In the description of the embodiments of the present application, the term "plurality" means two or more (including two). Similarly, "multiple groups" means two or more groups (including two groups), and "multiple pieces" means two or more pieces (including two pieces).
[0042] As described in the background art, in order to improve the safety of the battery, it is necessary to detect whether there are burrs at the corners of the battery housing.
[0043] In the related art, a deep learning model is usually used for detecting burrs on the electrode sheet. However, the method using the deep learning model depends on the labeled data of image burrs for training. When the amount of data is not large enough, the robustness of the obtained model is poor and it cannot be generalized to new data. And in actual situations, there are no large amounts of pictures labeled with burrs at the corners of the battery housing available for use. Therefore, the method using the deep learning model is applicable to the electrode sheet but not applicable to the corners of the battery housing.
[0044] Therefore, a method for detecting whether there are burrs at the corners of the battery housing is needed.
[0045] In view of the above technical problems, in the embodiments of the present application, the first image of the first corner of the battery housing can be obtained, then the target edge contour of the bent part of the first corner in the first image is extracted, and then curve fitting is performed based on the feature points of the target edge contour to obtain the target curve, and whether there are burrs on the first corner is determined based on the target curve. In this way, through curve fitting, it is possible to more accurately detect whether there are burrs at the corners of the battery housing.
[0046] First, in combination with Figure 1 a detailed description of the detection method of the battery housing provided by the embodiments of the present application is given.
[0047] Figure 1 FIG. shows a schematic flow chart of a detection method for a battery housing provided by an embodiment of the present application. It should be noted that this detection method for the battery housing can be applied to a detection device for the battery housing.
[0048] As Figure 1 shown, this detection method for the battery housing may include the following steps:
[0049] S110, obtaining a first image of the first corner of the battery housing;
[0050] S120, extracting the target edge contour of the bent part of the first corner in the first image;
[0051] S130, performing curve fitting based on the feature points of the target edge contour to obtain the target curve.
[0052] S140, determining whether there are burrs on the first corner based on the target curve.
[0053] Thus, a first image of the first corner of the battery housing can be obtained, and then the target edge contour of the bent portion of the first corner in the first image can be extracted. Then, curve fitting is performed based on the feature points of the target edge contour to obtain a target curve, and whether there are burrs on the first corner is determined based on the target curve. In this way, through curve fitting, it is possible to more accurately detect whether there are burrs at the corners of the battery housing.
[0054] Regarding S110, the first corner can be a rounded corner. Exemplarily, the first corner can be an R corner.
[0055] The battery housing includes a plurality of side plates and connecting plates between two adjacent side plates. The plurality of side plates are arranged circumferentially along the housing opening. The connecting plates are used to connect two adjacent side plates. At least a part of the outer surface of the connecting plate includes an arc surface. The outer surface of the connecting plate mentioned here refers to the surface of the connecting plate facing away from the electrode assembly. The outer surface of the connecting plate can be entirely an arc surface, or only partially an arc surface. The inner surface of the connecting plate can also include an arc surface, or it can also not include an arc surface. The arc surface of the connecting plate can be used to achieve a smooth transition between two adjacent side plates. The presence of the arc surface helps to improve the flatness of the outer surface of the battery housing and the appearance of the battery housing. The angle formed by this arc surface is the R corner. Burrs are likely to appear at the R corner of the battery housing during the stamping process.
[0056] Exemplarily, the first image can be as Figure 2 or Figure 3 shown.
[0057] In some embodiments, in order to more accurately detect burrs at the first corner of the battery housing, S110 may include:
[0058] Obtain a color image of the first corner of the battery housing;
[0059] Perform grayscale processing on the color image to obtain a second image;
[0060] Perform binarization processing on the second image to obtain a first image.
[0061] Here, the color image can be an RGB image. The second image can be a grayscale image.
[0062] Specifically, converting the color image into a grayscale image and then performing binarization processing on the grayscale image can highlight the first corner part.
[0063] Exemplarily, the pixel value at the R corner in the first image can be 1, and the pixel value at the background can be 0.
[0064] Thus, by performing preprocessing such as grayscale conversion and binarization on the directly obtained color image of the first corner, the first corner in the image can be highlighted, facilitating more accurate burr detection of the first corner of the battery housing.
[0065] Regarding S120, burr detection needs to be performed on the bent part here, so the target edge contour of the bent part needs to be extracted.
[0066] In some embodiments, to more accurately perform burr detection on the first corner of the battery housing, S120 may include:
[0067] Perform edge detection on the first image to obtain the first edge contour of the first corner;
[0068] Eliminate the edge contour segments of the straight part from the first edge contour to obtain a third image containing the second edge contour;
[0069] Determine the target edge contour according to the connected components in different regions of the third image.
[0070] Here, the second edge contour may be the edge contour of the bent part of the first corner. The target edge contour may be the outer edge contour of the bent part of the first corner.
[0071] Specifically, the Canny edge detection algorithm can be first used to perform edge detection on the first image to obtain the first edge contour of the first corner, and then the edge contour segments of the straight part are eliminated from the first edge contour to obtain the second edge contour.
[0072] The edge contour of the first corner has a certain width, so the edge contour of the first corner can include an inner edge contour and an outer edge contour. And the burrs of the first corner usually only appear on the outer edge contour, so the outer edge contour in the second edge contour can be further extracted, and burr detection is performed based on the outer edge contour. Therefore, the outer edge contour of the bent part of the first corner, that is, the target edge contour, can be determined according to the connected components in different regions of the third image containing the second edge contour.
[0073] Thus, through the above process, the outer edge contour of the bent part of the first corner can be accurately extracted, and thus the first corner can be more accurately burr-detected based on the outer edge contour of the bent part of the first corner.
[0074] In some embodiments, to more accurately extract the outer edge contour of the bent part of the first corner, the above determining the target edge contour according to the connected components in different regions of the third image may include:
[0075] Sort the connected components corresponding to different regions in the third image from large to small to obtain a connected component sequence;
[0076] Determine the area corresponding to the second connected component in the connected component sequence as the target edge contour.
[0077] Here, the different areas in the third image may include the outer edge contour of the curved part, the inner edge contour of the curved part, and the background area, and may also include some noise.
[0078] Among them, the number of pixels in the background area is usually the largest, so the connected component of the background area is the largest, and the number of pixels in the noise part is usually the smallest, so the connected component of the noise part is the smallest. And because the outer edge contour of the curved part is longer than the inner edge contour, the number of pixels in the outer edge contour is more than the number of pixels in the inner edge contour, and the connected component of the outer edge contour is also larger than the connected component of the inner edge contour.
[0079] Based on this, it can be known that the connected components corresponding to the different areas in the third image are sorted from largest to smallest as follows: the connected component of the background area > the connected component of the outer edge contour > the connected component of the inner edge contour > the connected component of the noise part.
[0080] Therefore, after sorting the connected components corresponding to the different areas in the third image from largest to smallest to obtain the connected component sequence, it can be determined that the area corresponding to the second connected component in the connected component sequence is the outer edge contour of the curved part, that is, the target edge contour.
[0081] In this way, by sorting the connected components corresponding to the different areas in the third image from largest to smallest, the outer edge contour of the curved part of the first corner can be accurately determined.
[0082] In some embodiments, in order to quickly and accurately determine the edge contour of the curved part of the first corner, the above-mentioned obtaining the third image including the second edge contour by removing the edge contour segments of the straight part from the first edge contour may include:
[0083] Cut the first edge contour to obtain multiple straight line segments;
[0084] Determine multiple first straight line segments with lengths greater than the third threshold from the multiple straight line segments;
[0085] According to the abscissa difference and ordinate difference between the two endpoints corresponding to each first straight line segment, determine the vertical line segments and horizontal line segments from the multiple first straight line segments;
[0086] Determine a segmentation point for each of the vertical line segment and the horizontal line segment to obtain two segmentation points;
[0087] Determine the edge contour segments other than the edge contour segments between the two segmentation points in the first edge contour as the edge contour segments of the straight part;
[0088] Remove the edge contour segments of the straight part from the first edge contour to obtain a third image including the second edge contour.
[0089] Here, the third threshold can be set according to actual requirements.
[0090] Specifically, the image where the first edge contour is located can be subjected to Hough transform to obtain the endpoint coordinates corresponding to multiple straight line segments, so as to cut the first edge contour to obtain multiple straight line segments.
[0091] Since the straight line segments obtained by cutting the curved part are very short, while the straight line segments obtained by cutting the straight part are relatively long, multiple first straight line segments with lengths greater than the third threshold among the multiple straight line segments can be determined as the straight part of the first corner.
[0092] The straight part of the first corner can include a horizontal part and a vertical part. Therefore, the multiple first straight line segments can include horizontal line segments and vertical line segments. For each first straight line segment, if the difference in abscissas of the two endpoints of the first straight line segment is less than the first preset difference and / or the difference in ordinates is greater than the second preset difference, for example, the difference in abscissas is 0 and / or the difference in ordinates is greater than 0, then it can be determined that the first straight line segment is a vertical line segment; if the difference in ordinates of the two endpoints of the first straight line segment is less than the first preset difference and / or the difference in abscissas is greater than the second preset difference, for example, the difference in ordinates is 0 and / or the difference in abscissas is greater than 0, then it can be determined that the first straight line segment is a horizontal line segment.
[0093] Among them, the first preset difference and the second preset difference can be set according to actual requirements.
[0094] Then, since generally the vertical part and the horizontal part in the first corner are located at both ends, and the curved part is sandwiched between the vertical part and the horizontal part, therefore, the segmentation points between the vertical part and the curved part, and the segmentation points between the horizontal part and the curved part can be determined first. The edge contour segment located between the two segmentation points is the edge contour segment of the curved part, that is, the second edge contour.
[0095] In this way, based on information such as the length, abscissa difference, and ordinate difference of the straight line segments included in the first edge contour, the edge contour of the curved part of the first corner can be determined quickly and accurately.
[0096] In some embodiments, in order to more accurately determine the two segmentation points, the above-mentioned determining one segmentation point according to each of the vertical line segment and the horizontal line segment to obtain two segmentation points may include:
[0097] Determine the first segmentation point according to the ordinate of the overlapping part of the straight line where the vertical line segment is located and the first edge contour;
[0098] Determine a second segmentation point according to the abscissa of the overlapping part of the straight line where the horizontal line segment is located and the first edge contour;
[0099] Determine the first segmentation point and the second segmentation point as the two segmentation points.
[0100] Here, if the vertical line segment is in the first direction of the curved part and the positive direction of the y-axis is the first direction, then the point where the minimum value of the ordinate of the overlapping part of the straight line where the vertical line segment is located and the first edge contour can be determined as the first segmentation point; if the vertical line segment is in the first direction of the curved part and the positive direction of the y-axis is the second direction, then the point where the maximum value of the ordinate of the overlapping part of the straight line where the vertical line segment is located and the first edge contour can be determined as the first segmentation point. The first direction and the second direction are opposite. For example, the first direction is up or down.
[0101] If the horizontal line segment is in the third direction of the curved part and the positive direction of the x-axis is the third direction, then the point where the minimum value of the abscissa of the overlapping part of the straight line where the horizontal line segment is located and the first edge contour can be determined as the second segmentation point; if the horizontal line segment is in the third direction of the curved part and the positive direction of the x-axis is the fourth direction, then the point where the maximum value of the abscissa of the overlapping part of the straight line where the horizontal line segment is located and the first edge contour can be determined as the second segmentation point. The third direction and the fourth direction are opposite. For example, the third direction is left or right.
[0102] In this way, through the above process, the two segmentation points can be determined more accurately, so as to more accurately segment the edge contour of the curved part of the first corner.
[0103] Regarding S130, curve fitting may include circular fitting and may also include quadratic curve fitting. The target curve may include a target circle and may also include a target quadratic curve.
[0104] In the related art, the shape of the corner of the battery case is usually approximately modeled as a straight line at an angle of 45°. Then, for each point on the outer edge of the corner, sampling is gradually performed in the direction of 45° to the lower left at a unit distance of 1 until the inner edge is sampled and stopped. The distance passed by the sampling is calculated, and this distance is used as the standard for judging whether there is a burr. If the distance passed by the sampling of a certain point on the outer edge is greater than the preset threshold, it is determined that there is a burr. If the distance passed by the sampling of each point on the outer edge is not greater than the preset threshold, it is determined that there is no burr. However, the processing speed of this method is very slow, and the processing time for each image is usually greater than 1 s. Moreover, using a straight line to fit the corner of the battery case will produce a large error and the detection is inaccurate. In addition, since the thickness of the corners of different battery cases is different, it is very difficult to set the above preset threshold.
[0105] It can be found through observation that the burrs at the corners of the battery housing usually only appear on the outer edge. Therefore, when detecting burrs at the corners of the battery housing, to determine whether there are burrs at the corners of the battery housing, only the shape of the outer edge of the corners needs to be considered. And the shape of the curved part of the corners of the battery housing is approximately a quarter circle. Therefore, in the embodiments of the present application, curve fitting is performed on the feature points of the target edge contour of the first corner, which significantly improves the accuracy of burr detection and reduces the missed killing rate. At the same time, since the detection method of the battery housing provided in the embodiments of the present application does not involve analog sampling but direct calculation, the detection efficiency is also significantly improved, and there is no need to set a preset threshold based on the thickness of the corners of the battery housing itself, so there is no problem of difficult preset threshold setting.
[0106] Regarding S140, it is possible to determine whether there are burrs on the first corner based on the target circle, and it is also possible to determine whether there are burrs on the first corner based on the target quadratic curve. If it is determined that there are burrs on the first corner based on any one of the target circle and the target quadratic curve, it can be determined that there are burrs on the first corner; if it is determined that there are no burrs on the first corner based on both the target circle and the target quadratic curve, it can be determined that there are no burrs on the first corner.
[0107] In some embodiments, in order to accurately determine whether there are burrs on the first corner, S130 may include:
[0108] Perform circular fitting based on the two endpoints of the target edge contour to obtain the target circle;
[0109] S140 may include:
[0110] Calculate the difference between the distance from the points on the target edge contour to the center of the target circle and the radius of the target circle;
[0111] In the case where there is a first point on the target edge contour corresponding to a difference greater than the first threshold, it is determined that there is a burr at the first point.
[0112] Here, the first threshold can be set according to actual needs. Exemplarily, the first threshold can be equal to 0.
[0113] In the related art, when performing circular fitting, usually three points are taken on the curve. Taking every two adjacent points among the three points as endpoints, two line segments can be formed. After determining the perpendicular bisectors corresponding to the two line segments respectively, the intersection point of the two perpendicular bisectors is the center of the circle.
[0114] In actual situations, it is very difficult to select three points. After selecting the two endpoints of the target edge contour, it is very difficult to determine the third point because it is not known in which direction the center of the circle is located on the target edge contour, and points cannot be randomly selected in the middle of the target edge contour. At the same time, if the distance between the third point and the two endpoints is too close, the calculation of the fitted circle will fail, and the calculation method is very unstable. Therefore, in order to stably calculate the approximate fitted circle of the first corner, the following assumptions can be made based on the actual distribution of the data: Assume that the first endpoint of the target edge contour is the uppermost point of the fitted circle, and assume that burrs do not appear at the two endpoints of the target edge contour. Based on these assumptions, only the two endpoints of the target edge contour need to be taken to determine the position of the center of the circle, thereby obtaining the target circle. This can provide the stability of the fitted circle calculation.
[0115] Specifically, when performing circular fitting, it can be assumed that among the two endpoints of the target edge contour, the first endpoint located above is the uppermost point in the target circle. Based on this, a vertical line passing through the first endpoint can be drawn, and then the point on this vertical line that is equidistant from the first endpoint and the second endpoint is determined as the center of the target circle, and the distance from the first endpoint to the center of the circle or the distance from the second endpoint to the center of the circle is determined as the radius of the target center, so that the target circle can be obtained. The second endpoint is the endpoint other than the first endpoint among the two endpoints of the target edge contour.
[0116] Then, it can be traversed whether the coordinates of each point on the target edge contour satisfy the following formula:
[0117]
[0118] where (x, y) are the coordinates of any point on the target edge contour, (x0, y0) is the center of the target circle, r is the radius of the target circle, and thresh1 is the first threshold.
[0119] If there is a first point on the target edge contour whose coordinates satisfy the above formula, it can be determined that there is a burr at the first point; if there is no point on the target edge contour whose coordinates satisfy the above formula, it can be determined that there is no burr on the first corner.
[0120] Exemplarily, the burr can be as shown Figure 4 within the dashed box.
[0121] In this way, by performing circular fitting based on the two endpoints of the target edge contour and determining whether the difference between the distance between each point on the target edge contour and the center of the target circle and the radius of the target circle exceeds the first threshold, it can be accurately determined whether there is a burr on the first corner.
[0122] In some embodiments, in order to further determine whether there is a burr on the first corner, the method may further include:
[0123] When the difference corresponding to each point on the target edge contour is not greater than the first threshold, quadratic curve fitting is performed based on the target points on the target edge contour to obtain the target quadratic curve;
[0124] Calculate the curvature of the target quadratic curve;
[0125] When the curvature is greater than the second threshold, it is determined that there are burrs on the edge contour segment corresponding to the target point.
[0126] Here, when the difference corresponding to each point on the target edge contour is not greater than the first threshold, it can be indicated that no burrs are detected on the target edge contour based on circular fitting.
[0127] The target points can include at least three points. Specifically, the target points can include at least three consecutive points. The second threshold can be set according to actual needs.
[0128] When the curvature is not greater than the second threshold, it can be determined that there are no burrs on the edge contour segment corresponding to the target point.
[0129] Specifically, each three consecutive points on the target edge contour can be traversed, and for any three consecutive points, quadratic curve fitting can be performed based on the following parametric equations:
[0130]
[0131] Specifically, the coordinates of the above three consecutive points can be respectively substituted into (x, y) in the above parametric equations, and the coefficients: a1, a2, a3, b1, b2, b3 and the time parameter t can be solved to obtain the target quadratic curve. The fitting calculation can be completed by matrix inversion.
[0132] Then, the curvature of the target quadratic curve can be calculated by the following formula:
[0133]
[0134] Among them, k is the curvature of the target quadratic curve, and thresh2 is the second threshold.
[0135] If κ > thresh2, it can be determined that there are burrs on the edge contour segment corresponding to the above three consecutive points; if κ ≥ thresh2, it can be determined that there are no burrs on the edge contour segment corresponding to the above three consecutive points.
[0136] After traversing each three consecutive points on the target edge contour, it can be determined whether there are burrs on the target edge contour.
[0137] Here, it is possible to first determine whether there are burrs on the first corner based on circular fitting. If it is determined based on circular fitting that there are burrs on the first corner, then there is no need to perform quadratic curve fitting anymore. If it is determined based on circular fitting that there are no burrs on the first corner, then quadratic curve fitting can be further performed to determine whether there are burrs on the first corner based on the quadratic curve fitting.
[0138] In this way, since the curvature change can reflect the smoothness of the curve, determining that there are burrs on the edge contour segment based on the curvature of the target quadratic curve can further detect whether there are small and discontinuous burrs on the first corner.
[0139] In addition, in some embodiments, it is also possible to first perform the fitting of the quadratic curve. If it is determined based on the fitting of the quadratic curve that there are burrs on the first corner, then there is no need to perform circular fitting anymore. If it is determined based on the fitting of the quadratic curve that there are no burrs on the first corner, then circular fitting can be further performed to determine whether there are burrs on the first corner based on the circular fitting.
[0140] To better describe the entire solution, based on the above embodiments, a specific example is given, such as Figure 5 As shown, the detection method of the battery case can include S501 - S520. Among them:
[0141] S501, obtain a color image of the first corner of the battery case.
[0142] S502, perform grayscale processing on the color image to obtain a second image.
[0143] S503, perform binarization processing on the second image to obtain a first image.
[0144] S504, perform edge detection on the first image to obtain the first edge contour of the first corner.
[0145] S505, cut the first edge contour to obtain multiple straight line segments.
[0146] S506, determine multiple first straight line segments with lengths greater than the third threshold from the multiple straight line segments.
[0147] S507, determine vertical line segments and horizontal line segments from the multiple first straight line segments according to the abscissa difference and ordinate difference between the two endpoints corresponding to each first straight line segment.
[0148] S508, determine the first division point according to the ordinate of the overlapping part of the straight line where the vertical line segment is located and the first edge contour, and determine the second division point according to the abscissa of the overlapping part of the straight line where the horizontal line segment is located and the first edge contour, to obtain two division points.
[0149] S509. Determine that the other edge contour segments in the first edge contour except for the edge contour segment between the two segmentation points are straight-edge contour segments.
[0150] S510. Remove the straight-edge contour segments from the first edge contour to obtain a third image containing the second edge contour.
[0151] S511. Sort the connected components corresponding to different regions in the third image from largest to smallest to obtain a connected component sequence.
[0152] S512. Determine that the region corresponding to the second connected component in the connected component sequence is the target edge contour.
[0153] S513. Perform circular fitting based on the two endpoints of the target edge contour to obtain a target circle.
[0154] S514. Calculate the difference between the distance from the points on the target edge contour to the center of the target circle and the radius of the target circle.
[0155] S515. Determine whether there is a first point on the target edge contour whose corresponding difference is greater than the first threshold.
[0156] If so, execute S519; if not, execute S516.
[0157] S516. Perform quadratic curve fitting based on every three consecutive points on the target edge contour to obtain multiple target quadratic curves.
[0158] S517. Calculate the curvature of each target quadratic curve respectively.
[0159] S518. Determine whether there is a curvature greater than the second threshold.
[0160] If so, execute S519; if not, execute S520.
[0161] S519. Determine that there is a burr on the first corner.
[0162] S520. Determine that there is no burr on the first corner.
[0163] Among them, the specific processes and meanings of each step can be referred to the above embodiments and will not be elaborated here.
[0164] The detection method of the battery housing provided by the embodiments of the present application can effectively improve the accuracy of burr detection, reduce the missed killing rate, and at the same time reduce the consumption of algorithm running time. Specifically, the detection method of the battery housing provided by the embodiments of the present application can perform two rounds of judgment. First, the circular fitting method is used to accurately detect larger obvious burr protrusions, and then the curvature calculation method is used to detect small burrs that are not obvious, greatly improving the accuracy and applicable range of burr detection, and the stability is also stronger.
[0165] Based on the same inventive concept, the embodiments of the present application also provide a detection device for a battery housing. The following will be combined with Figure 6 to describe in detail the detection device for the battery housing provided by the embodiments of the present application.
[0166] Figure 6 FIG. shows a schematic structural diagram of a detection device for a battery housing provided by an embodiment of the present application.
[0167] As Figure 6 shown, the detection device for the battery housing may include:
[0168] An acquisition module 601, configured to acquire a first image of a first corner of the battery housing, where the first corner is a rounded corner;
[0169] An extraction module 602, configured to extract a target edge contour of a bent portion of the first corner in the first image;
[0170] A fitting module 603, configured to perform curve fitting based on feature points of the target edge contour to obtain a target curve;
[0171] A determination module 604, configured to determine whether there is a burr on the first corner based on the target curve.
[0172] Thus, it is possible to acquire a first image of the first corner of the battery housing, then extract the target edge contour of the bent portion of the first corner in the first image, then perform curve fitting based on the feature points of the target edge contour to obtain a target curve, and determine whether there is a burr on the first corner based on the target curve. In this way, through curve fitting, it is possible to more accurately detect whether there is a burr at the corner of the battery housing.
[0173] In some embodiments, in order to accurately determine whether there is a burr on the first corner, the fitting module 603 may include:
[0174] A first fitting sub-module, configured to perform circular fitting based on two end points of the target edge contour to obtain a target circle;
[0175] The determination module 604 may include:
[0176] The first calculation sub-module is used to calculate the difference between the distance from a point on the target edge contour to the center of the target circle and the radius of the target circle.
[0177] The first determination sub-module is used to determine that there is a burr at the first point when the difference corresponding to the first point on the target edge contour is greater than the first threshold.
[0178] In some embodiments, in order to further determine whether there is a burr at the first corner, the detection device of the battery case may further include:
[0179] The second fitting sub-module is used to perform quadratic curve fitting on the target edge contour based on the target points on the target edge contour to obtain a target quadratic curve when the difference corresponding to each point on the target edge contour is not greater than the first threshold, and the target points include at least three points.
[0180] The second calculation sub-module is used to calculate the curvature of the target quadratic curve.
[0181] The second determination sub-module is used to determine that there is a burr on the edge contour segment corresponding to the target points when the curvature is greater than the second threshold.
[0182] In some embodiments, in order to more accurately detect burrs on the first corner of the battery case, the acquisition module 601 may include:
[0183] The acquisition sub-module is used to acquire a color image of the first corner of the battery case.
[0184] The grayscale sub-module is used to perform grayscale processing on the color image to obtain a second image.
[0185] The binarization sub-module is used to perform binarization processing on the second image to obtain a first image.
[0186] In some embodiments, in order to more accurately detect burrs on the first corner of the battery case, the extraction module 602 may include:
[0187] The edge detection sub-module is used to perform edge detection on the first image to obtain the first edge contour of the first corner.
[0188] The elimination sub-module is used to eliminate the edge contour segments of the straight part from the first edge contour to obtain a third image including a second edge contour, and the second edge contour is the edge contour of the curved part of the first corner.
[0189] The third determination sub-module is used to determine the target edge contour according to the connected components of different regions in the third image, and the target edge contour is the outer edge contour of the curved part of the first corner.
[0190] In some embodiments, in order to quickly and accurately determine the edge contour of the curved portion of the first corner, the elimination submodule may include:
[0191] A cutting unit, used for cutting the first edge contour to obtain a plurality of straight line segments;
[0192] A first determining unit, configured to determine, from the plurality of straight line segments, a plurality of first straight line segments whose lengths are greater than a third threshold;
[0193] A second determining unit, configured to determine a vertical line segment and a horizontal line segment from the plurality of first line segments according to a difference in abscissas and a difference in ordinates between two endpoints respectively corresponding to each first line segment;
[0194] A third determining unit is used to determine a segmentation point according to the vertical line segment and the horizontal line segment respectively, so as to obtain two segmentation points;
[0195] A fourth determining unit, configured to determine that other edge contour segments in the first edge contour, except for the edge contour segment between two segmentation points, are edge contour segments of a straight portion;
[0196] The elimination unit is used to eliminate the straight edge contour segment from the first edge contour to obtain a third image containing the second edge contour.
[0197] In some embodiments, in order to more accurately determine the two segmentation points, the third determining unit may include:
[0198] A first determining subunit, configured to determine a first segmentation point according to a longitudinal coordinate of a portion where the vertical line segment is located and the first edge contour overlap;
[0199] A second determining subunit, configured to determine a second segmentation point according to a horizontal coordinate of a portion where the straight line on which the horizontal line segment is located overlaps with the first edge contour;
[0200] The third determining subunit is configured to determine the first segmentation point and the second segmentation point as two segmentation points.
[0201] In some embodiments, in order to more accurately extract the outer edge contour of the curved portion of the first corner, the third determining submodule may include:
[0202] A sorting unit, used for sorting the connected components corresponding to different regions in the third image from large to small to obtain a connected component sequence;
[0203] The fifth determining unit is used to determine that the area corresponding to the second connected component in the connected component sequence is the target edge contour.
[0204] Figure 7 A schematic structural diagram of an electronic device provided by an embodiment of the present application is shown.
[0205] As shown Figure 7 in the figure, the electronic device 7 can implement the structural diagram of an exemplary hardware architecture of an electronic device capable of implementing the battery housing detection method and the battery housing detection device in the embodiments of the present application. The electronic device may refer to the electronic device in the embodiments of the present application.
[0206] The electronic device 7 may include a processor 701 and a memory 702 storing computer program instructions.
[0207] Specifically, the above-mentioned processor 701 may include a central processing unit (CPU), or an application specific integrated circuit (ASIC), or one or more integrated circuits configured to implement the embodiments of the present application.
[0208] The memory 702 may include a mass storage for data or instructions. By way of example and not limitation, the memory 702 may include a hard disk drive (HDD), a floppy disk drive, a flash memory, an optical disc, a magneto-optical disc, a magnetic tape, or a universal serial bus (USB) drive, or a combination of two or more of these. In a suitable case, the memory 702 may include a removable or non-removable (or fixed) medium. In a suitable case, the memory 702 may be internal or external to the integrated gateway disaster recovery device. In a specific embodiment, the memory 702 is a non-volatile solid state memory. In a specific embodiment, the memory 702 may include a read only memory (ROM), a random access memory (RAM), a disk storage media device, an optical storage media device, a flash memory device, an electrical, optical, or other physical / tangible memory storage device. Thus, generally, the memory 702 includes one or more tangible (non-transitory) computer-readable storage media (e.g., memory devices) encoded with software including computer-executable instructions, and when the software is executed (e.g., by one or more processors), it is operable to perform the operations described with reference to the method according to an aspect of the present application.
[0209] The processor 701 reads and executes the computer program instructions stored in the memory 702 to implement any one of the battery housing detection methods in the above embodiments.
[0210] In one example, the electronic device may further include a communication interface 703 and a bus 704. Among them, as Figure 7 shown in the figure, the processor 701, the memory 702, and the communication interface 703 are connected through the bus 704 and complete communication with each other.
[0211] The communication interface 703 is mainly used to implement communication between various modules, devices, units, and / or apparatuses in the embodiments of the present application.
[0212] The bus 704 includes hardware, software, or both, and couples components of the electronic device to each other. By way of example and not limitation, the bus may include an Accelerated Graphics Port (AGP) or other graphics bus, an Extended Industry Standard Architecture (EISA) bus, a Front Side Bus (FSB), a HyperTransport (HT) interconnect, an Industry Standard Architecture (ISA) bus, an InfiniBand interconnect, a Low Pin Count (LPC) bus, a memory bus, a MicroChannel Architecture (MCA) bus, a Peripheral Component Interconnect (PCI) bus, a PCI-Express (PCI-X) bus, a Serial Advanced Technology Attachment (SATA) bus, a Video Electronics Standards Association Local (VLB) bus, or other suitable buses or a combination of two or more of these. In suitable cases, the bus 704 may include one or more buses. Although the embodiments of the present application describe and illustrate specific buses, the present application contemplates any suitable bus or interconnect.
[0213] The electronic device can execute the detection method of the battery housing in the embodiments of the present application, thereby implementing the Figures 1 to 6 detection method and apparatus of the battery housing described.
[0214] In addition, in combination with the detection method of the battery housing in the above embodiments, the embodiments of the present application can provide a computer storage medium to implement. Computer program instructions are stored on the computer storage medium; when the computer program instructions are executed by a processor, any one of the detection methods of the battery housing in the above embodiments is implemented.
[0215] It should be clear that the present application is not limited to the specific configurations and processes described above and illustrated in the figures. For the sake of brevity, detailed descriptions of known methods are omitted here. In the above embodiments, several specific steps are described and illustrated as examples. However, the method process of the present application is not limited to the specific steps described and illustrated, and those skilled in the art can make various changes, modifications, and additions, or change the order between steps after understanding the spirit of the present application.
[0216] The functional blocks shown in the above-described structural block diagrams can be implemented as hardware, software, firmware, or a combination thereof. When implemented in hardware, it can be, for example, an electronic circuit, an application-specific integrated circuit (ASIC), appropriate firmware, a plug-in, a functional card, and so on. When implemented in software, the elements of the present application are programs or code segments used to perform the required tasks. The program or code segment can be stored in a machine-readable medium or transmitted via a data signal carried in a carrier wave over a transmission medium or a communication link. A "machine-readable medium" can include any medium capable of storing or transmitting information. Examples of machine-readable media include electronic circuits, semiconductor memory devices, ROM, flash memory, erasable ROM (EROM), floppy disks, CD-ROMs, optical discs, hard disks, fiber optic media, radio frequency (RF) links, and so on. The code segment can be downloaded via a computer network such as the Internet, an intranet, and so on.
[0217] It should also be noted that in the exemplary embodiments mentioned in the present application, some methods or systems are described based on a series of steps or devices. However, the present application is not limited to the order of the above steps, that is, the steps can be executed in the order mentioned in the embodiments, can be different from the order in the embodiments, or several steps can be executed simultaneously.
[0218] Aspects of the present application have been described above with reference to the flowcharts and / or block diagrams of methods, apparatuses (systems), and computer program products according to embodiments of the present application. It should be understood that each block in the flowcharts and / or block diagrams, and the combinations of blocks in the flowcharts and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device to produce a machine such that the instructions executed by the processor of the computer or other programmable data processing device enable the implementation of the functions / actions specified in one or more blocks of the flowcharts and / or block diagrams. Such a processor can be, but is not limited to, a general-purpose processor, a special-purpose processor, a special application processor, or a field programmable logic circuit. It is also understood that each block in the block diagrams and / or flowcharts, and the combinations of blocks in the block diagrams and / or flowcharts, can also be implemented by dedicated hardware performing the specified functions or actions, or by a combination of dedicated hardware and computer instructions.
[0219] Although the present application has been described with reference to the preferred embodiments, various improvements can be made to it and components therein can be replaced with equivalents without departing from the scope of the present application. In particular, as long as there is no structural conflict, the various technical features mentioned in each embodiment can be combined in any way. The present application is not limited to the specific embodiments disclosed in the text, but includes all technical solutions falling within the scope of the claims.
Claims
1. A detection method for a battery case, characterized in that, Including: Obtain a first image of a first corner of a battery housing, where the first corner is a rounded corner; Extract a target edge contour of a curved portion of the first corner in the first image; Perform curve fitting based on feature points of the target edge contour to obtain a target curve; Determine whether there are burrs on the first corner based on the target curve.
2. The method according to claim 1, characterized in that, The performing curve fitting based on feature points of the target edge contour to obtain a target curve includes: Perform circular fitting based on two end points of the target edge contour to obtain a target circle; The determining whether there are burrs on the first corner based on the target curve includes: Calculate the difference between the distance from a point on the target edge contour to the center of the target circle and the radius of the target circle; When the difference corresponding to a first point on the target edge contour is greater than a first threshold, determine that there is a burr at the first point.
3. The method according to claim 2, characterized in that, The method further includes: When the difference corresponding to each point on the target edge contour is not greater than the first threshold, perform quadratic curve fitting based on target points on the target edge contour to obtain a target quadratic curve, where the target points include at least three points; Calculate the curvature of the target quadratic curve; When the curvature is greater than a second threshold, determine that there are burrs on the edge contour segment corresponding to the target points.
4. The method according to claim 1, characterized in that, The obtaining a first image of a first corner of a battery housing includes: Obtain a color image of a first corner of a battery housing; Perform gray processing on the color image to obtain a second image; Perform binarization processing on the second image to obtain the first image.
5. The method according to claim 1, characterized in that, The extracting an edge contour of a curved portion of the first corner in the first image includes: Perform edge detection on the first image to obtain a first edge contour of the first corner; Remove edge contour segments of straight portions from the first edge contour to obtain a third image including a second edge contour, where the second edge contour is the edge contour of the curved portion of the first corner; Determine the target edge contour according to the connected components of different regions in the third image, where the target edge contour is the outer edge contour of the curved portion of the first corner.
6. The method according to claim 5, characterized in that, The removing edge contour segments of straight portions from the first edge contour to obtain a third image including a second edge contour includes: Cut the first edge contour to obtain multiple straight line segments; Determine multiple first straight line segments with lengths greater than a third threshold from the multiple straight line segments; Determine vertical line segments and horizontal line segments from the multiple first straight line segments according to the difference in abscissa and the difference in ordinate between the two end points corresponding to each of the first straight line segments; Determine a segmentation point according to each of the vertical line segments and the horizontal line segments to obtain two segmentation points; Determine the edge contour segments of the straight portions in the first edge contour other than the edge contour segment between the two segmentation points; Remove the edge contour segments of the straight portions from the first edge contour to obtain a third image including the second edge contour.
7. The method according to claim 6, characterized in that, Determining one segmentation point according to each of the vertical line segment and the horizontal line segment to obtain two segmentation points, including: Determining a first segmentation point according to the ordinate of the overlapping part of the straight line where the vertical line segment is located and the first edge contour; Determining a second segmentation point according to the abscissa of the overlapping part of the straight line where the horizontal line segment is located and the first edge contour; Determining the first segmentation point and the second segmentation point as the two segmentation points.
8. According to the method of claim 5, wherein Determining the target edge contour according to the connected components of different regions in the third image, including: Sorting the connected components corresponding to different regions in the third image from large to small to obtain a connected component sequence; Determining the region corresponding to the second connected component in the connected component sequence as the target edge contour.
9. A detection device for a battery housing, wherein The device includes: An acquisition module, configured to acquire a first image of a first corner of a battery case, where the first corner is a rounded corner; An extraction module, configured to extract a target edge contour of a bent part of the first corner in the first image; A fitting module, configured to perform curve fitting based on the feature points of the target edge contour to obtain a target curve; A determination module, configured to determine whether there is a burr on the first corner based on the target curve.
10. An electronic device, wherein The device includes: a processor and a memory storing computer program instructions; When the processor executes the computer program instructions, the detection method of the battery case according to any one of claims 1-8 is implemented.
11. A computer storage medium, wherein Computer program instructions are stored on the computer storage medium, and when the computer program instructions are executed by a processor, the detection method of the battery case according to any one of claims 1-8 is implemented.
12. A computer program product, wherein When the instructions in the computer program product are executed by a processor of an electronic device, the electronic device is caused to execute the detection method of the battery case according to any one of claims 1-8.