Battery inclination detection method, device and computer-readable storage medium
Through depth image processing and normal vector calculation, the problem of low accuracy of battery tilt detection in the prior art is solved, and high accuracy detection of battery tilt is achieved, reducing the risk of battery damage and safety risks.
Patent Information
- Application Number
- CN202510338157.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-21
- Publication Date
- 2025-06-17
- Estimated Expiration
- 2045-03-21
AI Technical Summary
In the prior art, the accuracy of detecting battery tilt is low, resulting in damage and safety hazards that may be caused during battery production and transportation.
By obtaining the depth image of the material frame and the battery, the reference plane and the reference normal vector are determined, and different detection directions and detection normal vectors are determined according to the preset angle, and the offset angle and height difference are calculated to determine whether the battery is tilted.
The accuracy of battery tilt detection is improved, and the inclined battery can be effectively detected from the material frame carrying the battery, reducing the risk of battery damage and safety risks.
Smart Images

Figure CN119850630B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of image recognition, and particularly to a method and device for detecting battery tilt and a computer-readable storage medium. Background Art
[0002] In battery production, the produced batteries are placed in a bin, which makes it easier to transport batches of batteries. The batteries are neatly placed in the bin, and each battery is vertically arranged at a certain interval. In this way, the transportation of a large number of batteries is completed. During the transportation of a large number of batteries, if the placement state of the batteries in the bin is abnormal, it will damage the batteries and even cause safety accidents. Therefore, it is necessary to detect the placement state of the batteries in the bin to timely discover the abnormal placement state of the batteries.
[0003] Currently, on the battery production line, the method of manual inspection is used to detect the placement state of the batteries. Due to the influence of various external factors, the method of manual inspection will cause inaccurate detection of battery tilt. Therefore, how to improve the accuracy of inspecting the placement state of the batteries has become an urgent problem to be solved. Summary of the Invention
[0004] Embodiments of this application provide a method and device for detecting battery tilt and a computer-readable storage medium, so as to at least solve the problem of low accuracy in detecting battery tilt in related technologies.
[0005] In a first aspect, an embodiment of this application provides a method for detecting battery tilt, and the method includes:
[0006] Obtain a depth image of a bin and a number of batteries carried by the bin;
[0007] Determine a battery image of each battery in the depth image. For any one battery image, determine different detection directions according to a preset angle, and detection normal vectors corresponding to each detection direction;
[0008] Determine a reference plane based on the bin in the depth image, and determine a reference normal vector according to the reference plane;
[0009] Determine the offset angle and height difference of the battery in the detection direction according to any one detection normal vector and the reference normal vector respectively;
[0010] In any one detection direction, if any one of the offset angle and the height difference meets the tilt standard, the current battery is tilted.
[0011] In an embodiment, the offset angle satisfies the following configuration:
[0012]
[0013] Where θ is the angle between the detected normal vector and the reference normal vector, and θ1 is the offset angle. is the reference normal vector, is the detected normal vector, and a0, b0, c0 are the components of the reference normal vector on the x-axis, y-axis, and z-axis respectively, and a1, b1, c1 are the components of the detected normal vector on the x-axis, y-axis, and z-axis respectively.
[0014] In one embodiment, for any battery image, different detection directions are determined according to a preset angle, including:
[0015] In the battery image, a number of target regions are obtained;
[0016] When the relative positions of any two target regions satisfy the preset angle, different detection directions are determined.
[0017] In one embodiment, determining the detected normal vector of the detection direction based on the detection direction includes:
[0018] Based on the detection direction, the depth data of the first target region and the second target region are obtained, and based on the depth data, the first depth average value of the first target region and the second depth average value of the second target region are obtained;
[0019] Based on the first depth average value and the second depth average value, the detected normal vector of the detection direction is determined.
[0020] In one embodiment, the height difference satisfies the following configuration:
[0021]
[0022] Where z is the height difference, z1 is the z-axis component of the first depth average value, z2 is the z-axis component of the second depth average value, and d0 is the constant term parameter of the reference plane.
[0023] In one embodiment, determining the battery image of each battery based on the battery in the depth image includes:
[0024] Point cloud data and a preset radius threshold are obtained, and the number of neighboring points of each point in the point cloud data is determined within the preset radius threshold;
[0025] Based on the number of neighboring points, each battery is separately segmented by a density clustering algorithm to obtain the battery image of each battery.
[0026] In one embodiment, the reference plane and the reference normal vector satisfy the following configuration:
[0027] The reference plane satisfies the following configuration:
[0028]
[0029] Among them, a0, b0, and c0 are the coefficients of the reference plane equation, and d0 is the constant term parameter of the reference plane equation, which represents the distance of the reference plane along the reference normal vector direction relative to the origin;
[0030] The reference normal vector satisfies the following configuration:
[0031]
[0032] Among them, is the reference normal vector, and a0, b0, and c0 are the components of the reference normal vector on the x-axis, y-axis, and z-axis respectively.
[0033] In a second aspect, an embodiment of the present application provides a battery tilt detection device, including:
[0034] A depth image acquisition module, configured to acquire depth images of a material frame and a plurality of batteries carried by the material frame;
[0035] A detection direction and detection normal vector determination module, configured to determine a battery image of each battery in the depth image, and for any one battery image, determine different detection directions according to a preset angle, and the detection normal vector corresponding to each detection direction;
[0036] A reference normal vector determination module, configured to determine a reference plane based on the material frame in the depth image, and determine a reference normal vector according to the reference plane;
[0037] An offset angle and height difference determination module, configured to determine the offset angle and height difference of the battery in the detection direction according to any one detection normal vector and the reference normal vector respectively;
[0038] A battery tilt detection module, configured to, in any one detection direction, if any one of the offset angle and height difference meets the tilt standard, then the current battery is tilted.
[0039] In a third aspect, an embodiment of the present application provides a computer device, including a memory, a processor, and a computer program stored on the memory and executable on the processor. When the processor executes the computer program, it implements the battery tilt detection method as described in the first aspect above.
[0040] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, on which a computer program is stored. When the program is executed by a processor, it implements the battery tilt detection method as described in the first aspect above.
[0041] The battery tilt detection method, device, and computer-readable storage medium provided by the embodiments of the present application at least have the following technical effects.
[0042] Through the depth images of a number of batteries carried by a material frame, in the depth images of the batteries, a reference plane is determined according to the material frame, and a reference normal vector is obtained. For each battery, a detection direction is determined, and a detection normal vector in the detection direction is determined. According to the detection normal vector and the reference normal vector, the offset angle and height difference of the battery in the detection direction are determined. When the offset angle and height difference in any one detection direction meet the inclination standard, the current battery tilt can be detected. Through the above method, since the normal vector is perpendicular to the given plane, taking the material frame as the reference plane, the offset angle and height difference between the battery and the material frame are determined by the normal vector of the reference plane and the normal vector in the detection direction of the battery. Both the offset angle and height difference can determine whether there is a deviation between the battery plane and the reference plane where the material frame is located. When the deviation meets the inclination standard, it can be detected that the battery is tilted. Through the above detection method, tilted batteries can be effectively detected from the material frame carrying the batteries.
[0043] Details of one or more embodiments of the present application are set forth in the following drawings and description to make other features, objects, and advantages of the present application more concise and understandable. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The schematic embodiments and descriptions thereof of the present application are used to explain the present application and do not constitute an improper limitation of the present application. In the drawings:
[0045] Figure 1 is a flowchart of a battery tilt detection method shown according to an exemplary embodiment;
[0046] Figure 2 is a schematic diagram of a target area shown according to an exemplary embodiment;
[0047] Figure 3 is a schematic diagram of a target area shown according to another exemplary embodiment;
[0048] Figure 4 is a schematic diagram of a single battery area shown according to an exemplary embodiment;
[0049] Figure 5 is a schematic diagram of a depth image shown according to an exemplary embodiment;
[0050] Figure 6 is a schematic diagram of a clustering result shown according to an exemplary embodiment;
[0051] Figure 7 is a schematic diagram of a battery deviation direction shown according to an exemplary embodiment;
[0052] Figure 8 is a block diagram of a battery tilt detection device shown according to an exemplary embodiment;
[0053] Figure 9 is a block diagram of an electronic device shown according to an exemplary embodiment.
[0054] In the above drawings, the meanings of the respective reference numerals are as follows:
[0055] 100, calibration line;
[0056] 101, first vertical target area, 102, second vertical target area;
[0057] 201, first diagonal target area, 202, second diagonal target area;
[0058] 301, first horizontal target area, 302, second horizontal target area;
[0059] 401, third diagonal target area, 402, and fourth diagonal target area;
[0060] 501, fifth diagonal target area, 502, sixth diagonal target area;
[0061] 601, seventh diagonal target area, 602, eighth diagonal target area. Detailed implementation manners
[0062] In order to make the objectives, technical solutions and advantages of the present application clearer and more understandable, the present application will be described and explained below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application. Based on the embodiments provided in the present application, all other embodiments obtained by those of ordinary skill in the art without making creative efforts belong to the scope of protection of the present application.
[0063] Obviously, the accompanying drawings in the following description are only some examples or embodiments of the present application. For those of ordinary skill in the art, without making creative efforts, the present application can also be applied to other similar scenarios based on these drawings. In addition, it can also be understood that although the efforts made in this development process may be complex and lengthy, for those of ordinary skill in the art related to the content disclosed in the present application, some design, manufacturing or production changes made based on the technical content disclosed in the present application are only conventional technical means and should not be understood as the content disclosed in the present application being insufficient.
[0064] References to "embodiments" in this application mean that specific features, structures, or characteristics described in connection with the embodiments can be included in at least one embodiment of this application. The phrase appears in various places in the specification and does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment mutually exclusive with other embodiments. It is explicitly and implicitly understood by those of ordinary skill in the art that the embodiments described in this application can be combined with other embodiments without conflict.
[0065] Unless otherwise defined, technical terms or scientific terms involved in this application shall have the ordinary meaning as understood by those of ordinary skill in the technical field to which this application pertains. The words "a", "an", "one kind", "the" and the like involved in this application do not denote a limitation of quantity and can denote a singular or plural number. The terms "include", "comprise", "have" and any variations thereof involved in this application are intended to cover non-exclusive inclusion; for example, a process, method, product or device that includes a series of steps or modules (units) is not limited to the listed steps or units, but may further include unlisted steps or units, or may further include other steps or units inherent to these processes, methods, products or devices. The terms "connected", "coupled" and the like involved in this application are not limited to physical or mechanical connections, but may include electrical connections, whether direct or indirect. The term "plurality" involved in this application means two or more. "And / or" describes the association relationship of associated objects and indicates that three relationships may exist. For example, "A and / or B" may represent: A exists alone, A and B exist simultaneously, and B exists alone. The character " / " generally represents an "or" relationship between the associated objects before and after. The terms "first", "second", "third", etc. involved in this application are only used to distinguish similar objects and do not represent a specific order for the objects.
[0066] During the battery production process, the batteries are neatly placed in a material box, and each battery is vertically arranged at a certain interval. For the above application scenario, if the battery is tilted, on the one hand, it will cause battery damage, resulting in economic losses, and on the other hand, it will pose a safety hazard during the production and transportation process, leading to accidents. Therefore, accurately detecting the tilt of the battery is crucial. Based on the above situation, the embodiments of this application provide a battery tilt detection method, device, and computer-readable storage medium.
[0067] In a first aspect, the embodiments of this application provide a battery tilt detection method. Figure 1 is a flowchart of a battery tilt detection method shown according to an exemplary embodiment, as Figure 1 shown, the battery tilt detection method includes:
[0068] Step S101: Obtain the depth images of the material frame and several batteries carried by the material frame.
[0069] Use a 3D camera device to capture the material frame and several batteries carried by the material frame to obtain depth images. The depth images include the three-dimensional depth data of the batteries and partial frames of the material frame. The three-dimensional depth data provides a detection basis for subsequent detection of battery tilt.
[0070] Step S102: Determine the battery image of each battery in the depth image. For any one battery image, determine different detection directions according to a preset angle, and the detection normal vector corresponding to each detection direction.
[0071] In the depth image, use a clustering algorithm to segment the material frame and batteries in the depth image from the background to obtain a separate battery image for each battery. For any one battery image, obtain different detection directions according to a preset angle. The specific steps for obtaining different detection directions of the battery are as follows:
[0072] Step S121: In the battery image, obtain several target regions.
[0073] Both ends of the battery are electrode ends, and there are raised or sunken parts at the electrode ends. These raised or sunken parts have an obvious height relative to the two ends of the battery and are significantly inclined relative to other flat parts of the battery. Therefore, these two parts will have obvious interference for detecting battery tilt. During the process of image processing, the raised or sunken parts are processed, and only the flat parts at both ends of the battery are retained. To avoid the influence of these parts, the target regions are also set at the flat parts at both ends of the battery to be able to further Figure 2 is a schematic diagram of the target region shown according to an exemplary embodiment, as Figure 2 shown, several target regions are set in the flat part of the battery, and the angle between any two target regions is the same. Optionally, the angle between any two adjacent target regions includes 45°, 30°, and 60°.
[0074] Step S122: When the relative positions of any two target regions satisfy a preset angle, determine different detection directions.
[0075] When the relative positions of any two target regions satisfy a preset angle, the direction of the straight line formed by the two target regions is the detection direction.
[0076] In one embodiment, a horizontal line passing through the center of the battery electrode end is used as the horizontal reference line, the preset angle is 180°, and the angle between any two adjacent target regions is 45°. Then there are a total of 8 target regions at the electrode end of the battery. When the relative positions of any two target regions satisfy 180°, four detection directions can be determined at the electrode end of the battery, namely the horizontal direction, the vertical direction, the first diagonal direction, and the second diagonal direction. As Figure 2 shown, the counterclockwise angle between the first vertical target region 101 and the horizontal reference line is 90°, and the relative position between the first vertical target region 101 and the second vertical target region 102 satisfies 180°. Then the detection direction is determined to be the vertical direction. The counterclockwise angle between the first diagonal target region 201 and the horizontal reference line is 45°, and the relative position between the first diagonal target region 201 and the second diagonal target region 202 satisfies 180°. Then the detection direction is determined to be the first diagonal direction, that is, the 45° direction. The first horizontal target region 301 and the second horizontal target region 302 are located on the horizontal reference line, and the relative position between the two horizontal target regions satisfies 180°. Then the detection direction is determined to be the horizontal direction. The counterclockwise angle between the third diagonal target region 401 and the horizontal reference line is 135°, and the relative position between the third diagonal target region 401 and the fourth diagonal target region 402 satisfies 180°. Then the detection direction is determined to be the second diagonal direction, that is, the 135° direction.
[0077] In another embodiment, a horizontal line passing through the center of the battery electrode end is used as the horizontal reference line, the preset angle is 180°, and the angle between any two adjacent target regions is 60°. Then there are a total of 6 target regions at the electrode end of the battery. When the relative positions of any two target regions satisfy 180°, three detection directions can be determined at the electrode end of the battery, namely the horizontal direction, the third diagonal direction, and the fourth diagonal direction. Figure 3 is a schematic diagram of the target region shown according to another exemplary embodiment. As Figure 3 shown, the first horizontal target region 301 and the second horizontal target region 302 are located at the horizontal reference line, and the relative position between the two horizontal target regions satisfies 180°. Then the detection direction is determined to be the horizontal direction. The counterclockwise angle between the fifth diagonal target region 501 and the horizontal reference line is 60°, and the relative position between the fifth diagonal target region 501 and the sixth diagonal target region 502 satisfies 180°. Then the detection direction is determined to be the third diagonal direction, that is, the 60° direction. The counterclockwise angle between the seventh diagonal target region 601 and the horizontal reference line is 120°, and the relative position between the seventh diagonal target region 601 and the eighth diagonal target region 602 satisfies 180°. Then the detection direction is determined to be the fourth diagonal direction, that is, the 120° direction.
[0078] Figure 4 is a schematic diagram of a single battery area shown according to an exemplary embodiment. As Figure 4 shown, in the processed single battery image, the internal area of the battery is shown in white. A target area is set within the internal area of the battery, and the battery is detected based on the target area.
[0079] Determine the detection direction at the electrode end of the battery through steps S121 to S122, and determine the corresponding detection normal vector for each detection direction based on the detection direction. Among them, the specific steps for obtaining the detection direction include the following:
[0080] Step S123: Based on the detection direction, obtain the depth data of the first target area and the second target area. Based on the depth data, obtain the first depth average value of the first target area and the second depth average value of the second target area.
[0081] Based on any one detection direction, obtain the depth data of the first target area and the second target area in the detection direction. For example, in the vertical direction, obtain the depth data of the first vertical target area 101 and the second vertical target area 102. In the first diagonal direction, obtain the depth data of the first diagonal target area 201 and the second diagonal target area 202.
[0082] According to the obtained depth data, obtain the first depth average value of the first target depth area, and the first depth average value is (x1, y1, z1), and the second depth average value of the second target area, and the second depth average value is (x2, y2, z2). For example, in the vertical direction, obtain the first depth average value (x1, y1, z1) of the first vertical target area 101 and the second depth average value (x2, y2, z2) of the second vertical target area 102.
[0083] Step S124: Determine the detection normal vector of the detection direction based on the first depth average value and the second depth average value.
[0084] Based on the first depth average value and the second depth average value, subtract the two depth average values to obtain the detection normal vector of the detection direction. Among them, the detection normal vector is specifically:
[0085]
[0086] where a1 is the x-axis component of the detection normal vector, b1 is the y-axis component of the detection normal vector, and c1 is the z-axis component of the detection normal vector.
[0087] Through the above method, determine the detection normal vectors of different detection directions for subsequent determination of the offset angle and height difference with the reference normal vector.
[0088] Figure 5 is a schematic diagram showing a depth image according to an exemplary embodiment, as Figure 5 shown, the depth image includes part of the frame border and depth data of several batteries. Process the depth image to obtain a battery image of each battery in the depth image. Among them, the steps of determining the battery image of each battery specifically include:
[0089] Step S201, obtain point cloud data and a preset radius threshold, and determine the number of neighborhood points of each point in the point cloud data within the preset radius threshold.
[0090] Step S202, based on the number of neighborhood points, use a density clustering algorithm to separately segment each battery to obtain the battery image of each battery.
[0091] Obtain point cloud data and a preset radius threshold, and count the number of neighborhood points of each point in the point cloud data within the preset radius threshold. For any point, if the number of neighborhood points within the preset radius threshold is greater than or equal to the threshold density, then the current point is taken as a core point. If the number of neighborhood points within the preset radius threshold is less than the density threshold, and the current point is within the range of other core points, then the current point is taken as a boundary point. If the number of neighborhood points within the preset radius threshold is less than the density threshold, and the current point is not within the range of other core points, then the current point is a noise point. Mark each point by the above method.
[0092] When the first sample point is within the radius range of the second sample point and the second sample point is a core point, then the first sample point is directly density-reachable from the second sample point. If other sample points satisfy the above conditions, it means that the two sample points are also directly density-reachable. For example, sample point p i is within the radius range of the second sample point p 2, and the second sample point p 2 is a core point, then sample point p i is density-reachable from p 2.
[0093] Density-connect multiple sample points that can be density-reachable and establish a clustering set. When all sample points are traversed and the density-connection relationship is established, mark each point for clustering. Figure 6 is a schematic diagram showing the clustering result according to an exemplary embodiment, as Figure 6 shown, part of the border of the frame and each battery are clearly distinguishable.
[0094] Through the above steps S201 to S202, clustering the frame and batteries in the depth image can reduce the interference of other factors and is beneficial to improving the accuracy of segmenting and extracting the battery and frame parts.
[0095] After being processed by the above density clustering algorithm, each battery, bin, and background in the depth image are separated. The background is removed by setting area, height thresholds, etc., and each battery is individually segmented to obtain the battery image of each battery.
[0096] Continuing to refer to step S102, different detection directions are determined in each battery image according to the target area, and the corresponding detection normal vectors are determined in the detection directions. Each detection normal vector and the subsequent reference normal vector jointly determine the offset angle and height difference in the current detection direction, so as to be able to judge whether the battery is tilted in the current detection direction.
[0097] Step S103: Determine the reference plane based on the bin in the depth image, and determine the reference normal vector according to the reference plane.
[0098] The bin does not change during the production process. Therefore, the plane where the bin is located is used as the reference plane to detect whether the battery is tilted. Therefore, the reference plane is determined based on the bin in the depth image. Among them, the reference plane satisfies the following configuration:
[0099]
[0100] Among them, a0, b0, c0 are the coefficients of the reference plane equation, and d0 is the constant term parameter of the reference plane equation, which represents the distance of the reference plane relative to the origin along the direction of the reference normal vector.
[0101] Based on the reference plane, the reference normal vector is obtained. Among them, the reference normal vector satisfies the following configuration:
[0102]
[0103] Among them, is the reference normal vector, and a0, b0, c0 are the components of the reference normal vector on the x-axis, y-axis, and z-axis respectively.
[0104] The tilt of the battery is relative to the bin. Therefore, the plane where the border of the bin is located is used as the reference plane. By judging the relative position between the plane where the electrode end of the battery is located and the plane where the bin is located, it is possible to detect whether the battery is tilted. For any plane, the normal vector of the plane is always perpendicular to the plane. Therefore, through the reference normal vector and the detection normal vector, it is possible to determine whether the plane of the battery electrode end and the reference plane are parallel, so as to detect the tilt of the battery.
[0105] Step S104: Determine the offset angle and height difference of the battery in the detection direction according to any detection normal vector and the reference normal vector respectively.
[0106] According to the detection direction determined in step S102, on each detection direction, determine the offset angle and height difference of the battery in the current detection direction based on the detection normal vector and the reference normal vector of the current detection direction, and determine the tilt of the battery through the offset angle and the height difference.
[0107] Among them, the offset angle satisfies the following configuration:
[0108]
[0109] Among them, θ is the included angle between the detection normal vector and the reference normal vector, and θ1 is the offset angle. is the reference normal vector. is the detection normal vector, a0, b0, c0 are the components of the reference normal vector on the x-axis, y-axis, and z-axis respectively, and a1, b1, c1 are the components of the detection normal vector on the x-axis, y-axis, and z-axis respectively.
[0110] The height difference satisfies the following configuration:
[0111]
[0112] Among them, z is the height difference, z1 is the z-axis component of the first depth average value, z2 is the z-axis component of the second depth average value, and d0 is the constant term parameter of the reference plane.
[0113] The normal vector of a plane is always perpendicular to the plane. There is an included angle between the reference normal vector and the detection normal vector, indicating that there is an offset between the plane where the battery electrode end is located and the reference plane, that is, the tilt of the battery causes the plane of the battery electrode end to shift, so that the electrode end plane and the reference plane are not in the same plane or not parallel. Therefore, it can be judged whether the battery is tilted through the offset angle.
[0114] When the battery is placed in the material frame and the battery is not tilted, the height of any angle of the electrode end plane of the battery is the same. If the battery is tilted, a height difference will be generated in the tilting direction, so that it can be judged whether the battery is tilted according to the height in the detection direction.
[0115] By determining the height difference in each detection direction and the reference normal vector and the detection normal vector in each detection direction, determine the offset angle of the battery in the detection direction, and use the offset angle and the height difference as judgment conditions to provide a basis for judging the tilt of the battery.
[0116] Step S105: On any detection direction, if any one of the offset angle and the height difference meets the tilt standard, the current battery is tilted.
[0117] The inclination standard is that when the offset angle is greater than or equal to the offset angle threshold and the height difference is greater than or equal to the height threshold. In any detection direction, if any one of the judgment conditions of the offset angle and the height difference meets the inclination standard, the current battery is inclined. It should be noted that the specific data of the offset angle threshold and the height threshold in the inclination standard are set according to the actual application scenario.
[0118] Figure 7 It is a schematic diagram of the battery deviation direction shown according to an exemplary embodiment, as Figure 7 shown, the detection method from step S101 to step S105 shows the result of detecting the inclination of the battery. The material frame holds multiple batteries, and for each battery, it is necessary to detect whether the battery deviates, so it is necessary to sort each battery image. As Figure 7 shown, 10 represents the battery image of the tenth battery, and the calibration line 100 represents that the content shown in the image is the height data display of the first horizontal target area and the second horizontal target area in the horizontal direction, where the specific value of the height difference between the first horizontal target area and the second horizontal target area is shown at the upper end of the battery image as 1.06. Therefore, according to Figure 7 it can be obtained that the height difference between the first horizontal target area and the second horizontal target area in the tenth battery is 1.06, that is, there is a height deviation of 1.06 in the horizontal direction.
[0119] To sum up, the battery inclination detection method provided by the embodiment of the present application determines the battery inclination by determining the reference normal vector and the detection normal vector of each battery in the depth image. Moreover, there are multiple detection directions for the battery, which ensures that the inclination at multiple angles can be detected, avoids the situation where the battery inclination cannot be detected when the battery is inclined in a single direction, and ensures the accuracy of clearly detecting the battery inclination.
[0120] In a second aspect, the embodiment of the present application provides a battery inclination detection device. Figure 8 It is a block diagram of the battery inclination detection device shown according to an exemplary embodiment. As Figure 8 shown, the battery inclination detection device includes:
[0121] A depth image acquisition module, configured to acquire the depth images of the material frame and several batteries carried by the material frame;
[0122] A detection direction and detection normal vector determination module, configured to determine the battery image of each battery in the depth image, and for any one battery image, determine different detection directions according to a preset angle, and the detection normal vector corresponding to each detection direction;
[0123] A reference normal vector determination module, configured to determine a reference plane based on the material frame in the depth image, and determine a reference normal vector according to the reference plane;
[0124] An offset angle and height difference determination module, configured to determine the offset angle and height difference of the battery in the detection direction respectively according to any detected normal vector and the reference normal vector.
[0125] A battery tilt detection module, configured to tilt the current battery if any one of the offset angle and the height difference meets the tilt standard in any detection direction.
[0126] In summary, the battery tilt detection device provided by this application, through the depth images of the material frame and several batteries carried by the material frame, in the depth images of the batteries, determines the reference plane according to the material frame and obtains the reference normal vector. For each battery, the detection direction is determined, and the detected normal vector in the detection direction is determined. According to the detected normal vector and the reference normal vector, the offset angle and height difference of the battery in the detection direction are determined. When the offset angle and height difference in any one detection direction meet the tilt standard, the current battery tilt can be detected. Through the above method, since the normal vector is perpendicular to the given plane, taking the material frame as the reference plane, the offset angle and height difference between the battery and the material frame are determined by the normal vector of the reference plane and the normal vector of the detection direction in the battery. Both the offset angle and the height difference can determine whether there is a deviation between the battery plane and the reference plane where the material frame is located. When the deviation meets the tilt standard, the battery tilt can be detected. Through the above detection method, the tilted battery can be effectively detected from the material frame carrying the battery.
[0127] It should be noted that the battery tilt detection device provided in this embodiment is used to implement the above implementation manners, and those that have been described will not be repeated. As used above, terms such as "module", "unit", "sub-unit", etc. can be a combination of software and / or hardware that can achieve a predetermined function. Although the devices described in the above embodiments are preferably implemented in software, implementation in hardware, or a combination of software and hardware is also possible and contemplated.
[0128] In a third aspect, an embodiment of this application provides an electronic device. Figure 9 It is a block diagram of an electronic device shown according to an exemplary embodiment. As Figure 9 shown, the electronic device may include a processor 81 and a memory 82 storing computer program instructions.
[0129] Specifically, the above-mentioned processor 81 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 this application.
[0130] Among them, the memory 82 may include a mass storage for data or instructions. By way of example and not limitation, the memory 82 may include a hard disk drive (HDD), a floppy disk drive, a solid state drive (SSD), a flash memory, an optical disk, a magneto-optical disk, a magnetic tape, or a universal serial bus (USB) drive, or a combination of two or more of these. In appropriate cases, the memory 82 may include removable or non-removable (or fixed) media. In appropriate cases, the memory 82 may be internal or external to the data processing device. In a particular embodiment, the memory 82 is non-volatile memory. In a particular embodiment, the memory 82 includes a read-only memory (ROM) and a random access memory (RAM). In appropriate cases, the ROM may be a mask-programmed ROM, a programmable ROM (PROM), an erasable PROM (EPROM), an electrically erasable PROM (EEPROM), an electrically alterable ROM (EAROM), or a flash memory (FLASH), or a combination of two or more of these. In appropriate cases, the RAM may be a static random access memory (SRAM) or a dynamic random access memory (DRAM), where the DRAM may be a fast page mode dynamic random access memory (FPMDRAM), an extended date out dynamic random access memory (EDODRAM), a synchronous dynamic random access memory (SDRAM), etc.
[0131] The memory 82 can be used to store or cache various data files required for processing and / or communication, as well as possible computer program instructions executed by the processor 81.
[0132] The processor 81 reads and executes the computer program instructions stored in the memory 82 to implement any one of the battery tilt detection methods in the above embodiments.
[0133] In one embodiment, the battery tilt detection device may further include a communication interface 83 and a bus 80. Among them, as Figure 9 shown, the processor 81, the memory 82, and the communication interface 83 are connected through the bus 80 and complete communication with each other.
[0134] The communication interface 83 is used to implement communication between each module, device, unit, and / or device in the embodiments of the present application. The communication port 83 can also implement data communication with other components such as external devices, image / data acquisition devices, databases, external storage, and image / data processing workstations.
[0135] Bus 80 includes hardware, software, or both, and couples components of the battery tilt detection device to each other. Bus 80 includes, but is not limited to, at least one of the following: Data Bus, Address Bus, Control Bus, Expansion Bus, Local Bus. By way of example and not limitation, Bus 80 may include an Accelerated Graphics Port (AGP) or other graphics bus, an Extended Industry Standard Architecture (EISA) bus, a Front Side Bus (FSB), a Hyper Transport (HT) interconnect, an Industry Standard Architecture (ISA) bus, an InfiniBand interconnect, a Low Pin Count (LPC) bus, a memory bus, a Micro Channel 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 Bus (VLB) bus, or other suitable bus or a combination of two or more of these. In suitable cases, Bus 80 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.
[0136] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, on which a program is stored. When the program is executed by a processor, the battery tilt detection method provided in the first aspect is implemented.
[0137] Among them, the more specific readable storage medium that can be adopted may include, but is not limited to: portable disk, hard disk, random access memory, read-only memory, erasable programmable read-only memory, optical storage device, magnetic storage device, or any suitable combination of the above.
[0138] In a possible implementation manner, the present invention can also be implemented in the form of a program product, which includes program code. When the program product runs on a terminal device, the program code is used to cause the terminal device to execute the steps of implementing the battery tilt detection method provided in the first aspect.
[0139] Among them, the program code for executing the present invention can be written in any combination of one or more programming languages. The program code can be executed entirely on the user device, partially on the user device, executed as an independent software package, partially on the user device and partially on a remote device, or entirely on a remote device.
[0140] The technical features of the above-described embodiments can be combined arbitrarily. For the sake of concise description, not all possible combinations of the technical features in the above-described embodiments are described. However, as long as there is no contradiction in the combination of these technical features, it should be considered as the scope recorded in this specification.
[0141] The above-described embodiments only represent several implementation manners of the present application. The description is relatively specific and detailed, but it should not be construed as a limitation on the scope of the invention patent. It should be noted that for those of ordinary skill in the art, without departing from the concept of the present application, several deformations and improvements can still be made, and these all belong to the protection scope of the present application. Therefore, the protection scope of the patent of the present application should be subject to the appended claims.
Claims
1. A battery tilt detection method, characterized in that: The method comprises: Obtaining a depth image of a material frame and a plurality of batteries carried by the material frame; Determine a battery image of each battery in the depth image, and for any one of the battery images, determine different detection directions according to a preset angle; Based on any one of the detection directions, obtain depth data of a first target area and a second target area, and based on the depth data, obtain a first depth average value of the first target area and a second depth average value of the second target area; Based on the first depth average value and the second depth average value, the two depth average values are subtracted to determine a detection normal vector of the detection direction; Determine a reference plane based on a material frame in the depth image, and determine a reference normal vector according to the reference plane; Determine the offset angle and height difference of the battery in the detection direction according to any one of the detection normal vectors and the reference normal vector respectively; In any of the detection directions, if any one of the offset angle and the height difference meets the tilt standard, the current battery is tilted.
2. The battery tilt detection method according to claim 1, characterized in that: The offset angle satisfies the following configuration: Among them, θ is the angle between the detection normal vector and the reference normal vector, θ1 is the offset angle, is the base normal vector, is the detected normal vector, a0, b0, c0 are the components of the reference normal vector on the x-axis, y-axis, and z-axis respectively, and a1, b1, c1 are the components of the reference normal vector on the x-axis, y-axis, and z-axis respectively.
3. The battery tilt detection method according to claim 1, characterized in that: The determining of different detection directions for any one of the battery images according to a preset angle includes: In the battery image, acquiring a number of target areas; When the relative positions of any two target areas satisfy the preset angle, different detection directions are determined.
4. The battery tilt detection method according to claim 1, characterized in that: The height difference satisfies the following configuration: Where z is the height difference, z1 is the z-axis component of the first depth average, z2 is the z-axis component of the second depth average, and d0 is a constant term parameter of the reference plane.
5. The battery tilt detection method according to claim 1, characterized in that: The step of determining a battery image of each battery based on the batteries in the depth image comprises: Obtaining point cloud data and a preset radius threshold, wherein the number of neighborhood points of each point in the point cloud data is determined within the preset radius threshold; Based on the number of the neighborhood points, each battery is segmented separately by a density clustering algorithm to obtain the battery image of each battery.
6. The battery tilt detection method according to claim 1, characterized in that: The reference plane and the reference normal vector satisfy the following configuration: The reference plane satisfies the following configuration: Among them, a0, b0, c0 are the coefficients of the reference plane equation, and d0 is the constant term parameter of the reference plane equation, which represents the distance of the reference plane relative to the origin along the direction of the reference normal vector; The reference normal vector satisfies the following configuration: in, is the reference normal vector, a0, b0, c0 are the components of the reference normal vector on the x-axis, y-axis, and z-axis respectively.
7. A battery tilt detection device, characterized in that: include: A depth image acquisition module is used to acquire a depth image of a material frame and a plurality of batteries carried by the material frame; A detection direction and normal vector determination module is used to determine a battery image of each battery in the depth image, and for any of the battery images, determine different detection directions according to a preset angle; A depth average value determination module, used for obtaining depth data of a first target area and a second target area based on any one of the detection directions, and obtaining a first depth average value of the first target area and a second depth average value of the second target area based on the depth data; a detection normal vector determination module, configured to determine a detection normal vector of the detection direction by subtracting the two depth average values from each other based on the first depth average value and the second depth average value; A reference normal vector determination module, configured to determine a reference plane based on a material frame in the depth image, and determine a reference normal vector according to the reference plane; A module for determining an offset angle and a height difference, used for determining an offset angle and a height difference of the battery in the detection direction according to any one of the detection normal vectors and the reference normal vector respectively; The battery tilt detection module is used to detect that the current battery is tilted if any one of the offset angle and the height difference meets the tilt standard in any of the detection directions.
8. An electronic device, characterized in that: The invention comprises a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the battery tilt detection method according to any one of claims 1 to 6 when executing the computer program.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the battery tilt detection method according to any one of claims 1 to 6 is implemented.
Citation Information
Patent Citations
Method and device for measuring inclination angle of bonding finger, terminal and storage medium
CN115435749A
Image defect detection method, device and system and computer readable storage medium
CN119151945A