Battery module orientation detection method and system, storage medium

By rotating the image area of ​​the battery module to align with a preset coordinate system, and using the coordinates of the reference point to determine the orientation of the battery module, the problems of detection accuracy and deployment difficulty caused by different camera angles are solved, achieving low-cost and high-efficiency orientation detection.

CN120931717BActive Publication Date: 2026-04-10CONTEMPORARY AMPEREX RUNZHI SOFTWARE TECH LTD +1
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-10-10
Publication Date
2026-04-10

AI Technical Summary

Technical Problem

In battery module orientation detection, due to the different shooting angles of cameras, existing technologies cannot use uniform detection parameters for accurate detection, resulting in high costs and difficult deployment.

Method used

By rotating the target area and feature area in the battery module image to make them parallel to the coordinate axes of the preset coordinate system, the orientation of the battery module is determined by the reference point and the coordinate relationship of the reference point in the coordinate system, and orientation detection is performed using uniform detection parameters.

Benefits of technology

This reduces detection costs and deployment difficulties caused by different camera angles, and improves the accuracy and efficiency of orientation detection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120931717B_ABST
    Figure CN120931717B_ABST
Patent Text Reader

Abstract

The application discloses a battery module orientation detection method and system and a storage medium. A reference target region and a reference feature region are obtained by rotating a first target region and a first feature region, and the direction of the reference target region is parallel to a reference direction, which is a coordinate axis direction of a preset coordinate system. The first target region and the first feature region in images captured at different shooting angles are rotated to be parallel to the coordinate axis direction of the preset coordinate system, and then the orientation of the battery module can be determined according to the coordinates of the first target region and the first feature region in the unified preset coordinate system in different images. In other words, the same detection parameters can be used for orientation detection of images captured at different shooting angles, so that the deployment difficulty and cost are reduced.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of image detection, in particular to a battery module orientation detection method and system, and a storage medium. BACKGROUND

[0002] When detecting the orientation of a battery module, false detection often occurs due to different camera shooting angles and other reasons. In order to improve the accuracy of orientation detection, detection parameters corresponding to different cameras can be configured respectively. However, this is high in cost and difficult to deploy. SUMMARY

[0003] The present application at least provides a battery module orientation detection method and system, and a storage medium, to reduce cost and deployment difficulty.

[0004] The first aspect of the present application provides a battery module orientation detection method, comprising: obtaining images of a plurality of battery modules; determining a first target region of each battery module in the images, and determining a first feature region of each label in the images; wherein the label is arranged on the battery module; rotating the first target region and the first feature region to obtain a second target region and a second feature region; wherein a first side of the battery module in the second target region is parallel to a reference direction, and the reference direction is a direction of a coordinate axis of a preset coordinate system; determining an orientation of the battery module based on coordinates of a first reference point in the second feature region and a second reference point in the second target region in the preset coordinate system; wherein the orientation of the battery module is a direction of the first reference point relative to the second reference point.

[0005] Therefore, by rotating the first target region and the first feature region to obtain the second target region and the second feature region, and by making the reference direction a direction of a coordinate axis of a preset coordinate system, the first target region and the first feature region in the images taken at different shooting angles are rotated to be parallel to the direction of the coordinate axis of the preset coordinate system, and then the orientation of the battery module can be determined according to the coordinates of the first target region and the first feature region in the different images in the unified preset coordinate system, in other words, the same detection parameters can be used for orientation detection for images taken at different camera angles, thereby reducing deployment difficulty and cost.

[0006] In some embodiments, the first side of the battery module in the second target region is parallel to a first coordinate axis of the preset coordinate system; and a second side of the battery module in the second target region is parallel to a second coordinate axis of the preset coordinate system.

[0007] In some embodiments, rotating the first target region and the first feature region comprises: in response to the direction of the first edge of the battery module in the first target region not matching the reference direction, rotating the first target region and the first feature region by a preset angle in a predetermined direction to obtain a third target region and a third feature region; determining a second included angle between the first edge of the battery module in the third target region and the reference direction, and rotating the third target region and the third feature region toward the reference direction by the second included angle as a rotation angle.

[0008] The above scheme, when the direction of the first edge of the battery module does not match the reference direction, through a two-stage rotation mechanism, i.e., first rotating by a preset angle in a predetermined direction to obtain a third target region, and then rotating the third target region according to a second included angle between the battery module in the third target region and the reference direction to obtain a second target region, is conducive to making the second target region more accurately match the reference direction, and further conducive to improving the accuracy of orientation detection when using a preset coordinate system for orientation detection.

[0009] In some embodiments, rotating the first target region and the first feature region further comprises: in response to the direction of the first edge of the battery module matching the reference direction, determining a first included angle between the first edge of the battery module in the first target region and the reference direction, and rotating the first target region and the first feature region toward the reference direction by the first included angle as a rotation angle.

[0010] The above scheme, when the direction of the first edge of the battery module matches the reference direction, directly rotates the third target region and the third feature region according to the first included angle, which is conducive to improving the detection efficiency of orientation detection.

[0011] In some embodiments, determining the second included angle between the first edge of the battery module in the third target region and the reference direction comprises: determining a third reference point in each third target region; obtaining an average value of coordinate values of a plurality of to-be-fitted reference points in a preset coordinate system to obtain a first fitted reference point; wherein the plurality of to-be-fitted reference points include the third reference points in the third target regions in the same row or the same column; fitting each first fitted reference point corresponding to different rows or columns to obtain a trend indication line; obtaining an included angle between the trend indication line and a first direction as the second included angle between the first edge of the battery module in the third target region and the reference direction; wherein the first direction is parallel or perpendicular to the reference direction.

[0012] The scheme has the advantages that the trend indication line of the third reference point in the third target region is obtained by fitting, and the second angle between the first side of the battery module in the third target region and the reference direction is obtained as the angle between the trend indication line and the first direction, so that the accuracy of the second angle between the first side of the battery module in the third target region and the reference direction is improved, and the matching degree between the second target region obtained after the third target region is rotated according to the second angle and the reference direction is higher, thereby facilitating the improvement of the accuracy of the orientation detection when the preset coordinate system is used for orientation detection.

[0013] In some embodiments, the first target region is a rectangle; before the first target region and the first feature region are rotated to obtain the second target region and the second feature region, the method further comprises: obtaining a ratio of the first side adjacent to the second side of the first target region as a width-height ratio of the first target region; wherein the second side of the first target region is parallel to the reference direction; when the width-height ratio is not less than a preset ratio, it is determined that the direction of the first side of the battery module in the first target region is not matched with the reference direction; and when the width-height ratio is less than the preset ratio, it is determined that the direction of the first side of the battery module in the first target region is matched with the reference direction.

[0014] The scheme has the advantages that the ratio of the first side and the second side of the first target region is used to determine whether the first target region is matched with the reference direction, so that the efficiency of determining the direction of the battery module in the first target region is improved.

[0015] In some embodiments, determining the orientation of the battery module based on the coordinates of the first reference point in the second feature region and the second reference point in the second target region in the preset coordinate system comprises: determining a second reference coordinate of the second reference point in the second target region in the preset coordinate system, and / or a first reference coordinate of the first reference point in the second feature region in the preset coordinate system; and determining the orientation of the battery module based on a first offset value of the first reference coordinate relative to the second reference coordinate in the first coordinate axis direction of the preset coordinate system, and / or a second offset value of the first reference coordinate relative to the second reference coordinate in the second coordinate axis direction of the preset coordinate system.

[0016] The scheme has the advantages that the offset values of the coordinates of the first reference point in the second feature region and the second reference point in the second target region in the preset coordinate system are determined, so that the same detection parameters can be used to determine the orientation of the battery module when different images are used for orientation detection, thereby facilitating the further reduction of the deployment difficulty and cost.

[0017] In some embodiments, determining the orientation of the battery module based on the first offset value of the first reference coordinate relative to the second reference coordinate in the first coordinate axis direction in the preset coordinate system and / or the second offset value of the first reference coordinate relative to the second reference coordinate in the second coordinate axis direction in the preset coordinate system includes: calculating a width offset ratio of the second reference coordinate relative to the first reference coordinate in the first coordinate axis direction based on the first offset value of the second reference coordinate relative to the first reference coordinate in the first coordinate axis direction and the length of the battery module in the first coordinate axis direction; and / or calculating a height offset ratio of the second reference coordinate relative to the first reference coordinate in the second coordinate axis direction based on the second offset value of the second reference coordinate relative to the first reference coordinate in the second coordinate axis direction and the length of the battery module in the second coordinate axis direction; and determining the orientation of the battery module based on the width offset ratio and the height offset ratio.

[0018] The above scheme determines the orientation of the battery module based on the width offset ratio and the height offset ratio, which can be used for orientation detection of different battery modules and different camera angles using the same detection parameters, thereby reducing the impact of different sizes of battery modules or different camera angles on orientation detection, improving the accuracy of orientation detection, and further reducing the deployment difficulty and cost.

[0019] In some embodiments, after obtaining the second target region, the method further includes determining a coordinate interval in which the second target region is located based on the coordinates of the fourth reference point in the preset coordinate system in the second target region; and after determining the orientation of the battery module, the method further includes determining whether the orientation of the battery module is the same as a preset reference orientation corresponding to the coordinate interval.

[0020] The above scheme determines whether the orientation of the battery module is the same as the preset reference orientation corresponding to the coordinate interval based on the coordinate interval in which the second target region is located, thereby providing more flexible detection criteria for orientation detection.

[0021] In some embodiments, determining the coordinate interval in which the second target region is located based on the coordinates of the fourth reference point in the preset coordinate system in the second target region includes: determining an average value of sub-coordinate values of the fourth reference point in the preset coordinate system in each second target region; and determining the coordinate interval in which the battery module is located as a first coordinate interval in response to the sub-coordinate value of the fourth reference point in the second target region being greater than the average value, and determining the coordinate interval in which the battery module is located as a second coordinate interval in response to the sub-coordinate value of the fourth reference point in the second target region being not greater than the average value.

[0022] The above scheme determines the coordinate interval based on the average value of the fourth reference point in each second target region, thereby improving the efficiency of coordinate interval determination.

[0023] In some embodiments, before rotating the first target region and the first feature region to obtain the second target region and the second feature region, the method further comprises: determining the number of battery modules and / or labels in the image; and discarding the image in response to the number of battery modules and / or labels being less than a preset threshold.

[0024] The above scheme discards the image when the number of battery modules and / or labels is less than a preset threshold, which helps to reduce the impact of false alarm caused by orientation detection when the number of battery modules and / or labels is insufficient, and enhances the robustness of orientation detection.

[0025] In some embodiments, before rotating the first target region and the first feature region to obtain the second target region and the second feature region, the method further comprises: determining a fifth reference point in each first target region and a sixth reference point on each first feature region; determining a first target region corresponding to a fifth reference point closest to each sixth reference point to obtain a plurality of matching pairs, wherein each matching pair includes a first feature region and a corresponding first target region; determining a first overlap rate of the first feature region and the first target region in the matching pair; determining the matching pair as a valid matching pair in response to the first overlap rate being greater than a preset overlap rate; and determining the matching pair as an invalid matching pair in response to the first overlap rate not being greater than the preset overlap rate.

[0026] The above scheme determines whether the matching relationship between the first target region and the first feature region is valid, which helps to reduce the impact of false orientation detection caused by the matching relationship between the first target region and the first feature region, and further improves the accuracy of orientation detection.

[0027] In some embodiments, before rotating the first target region and the first feature region to obtain the second target region and the second feature region, the method further comprises: identifying each detection object in the image to obtain an identification region of each detection object; wherein the detection object includes a battery module and a label, and the identification region surrounds the detection object; determining a second overlap rate of the identification region and a preset detection region; and determining a detection object with a second overlap rate greater than or equal to a preset overlap rate as an associated object of the preset detection region.

[0028] The above scheme determines the second overlap rate of the identification region and the preset detection region, and determines a detection object with a second overlap rate greater than or equal to a preset overlap rate as an associated object of the preset detection region, which helps to eliminate detection objects irrelevant to the preset detection region, reduces the impact of irrelevant detection objects on orientation detection of battery modules in the preset detection region, and further improves the accuracy of orientation detection.

[0029] The second aspect of the present application provides a battery module orientation detection system, comprising a camera device, a storage device and a processing device coupled with each other, the camera device is used to collect images, and the processing device is used to execute program instructions stored in the storage device to realize the battery module orientation detection method in the first aspect.

[0030] The third aspect of the present application provides a computer readable storage medium, which stores program instructions, and the program instructions are executed by a processor to realize the battery module orientation detection method in the first aspect.

[0031] Therefore, by rotating the first target region and the first feature region to obtain the second target region and the second feature region, and the reference direction is a coordinate axis direction of a preset coordinate system, the first target region and the first feature region in the images taken at different shooting angles are rotated to be parallel to the coordinate axis direction of the preset coordinate system, and then the orientation of the battery module can be determined according to the coordinates of the first target region and the first feature region in different images in the unified preset coordinate system, in other words, the images taken at different camera angles can be detected by using the same detection parameters, thereby reducing the deployment difficulty and cost.

[0032] It should be understood that the foregoing general description and the following detailed description are only exemplary and explanatory, rather than limiting the present application. BRIEF DESCRIPTION OF DRAWINGS

[0033] The accompanying drawings, which are incorporated into and form part of the specification, illustrate embodiments consistent with the present application and, together with the specification, serve to explain the technical solutions of the present application.

[0034] Figure 1 is a flowchart of an embodiment of the battery module orientation detection method of the present application;

[0035] Figure 2 is a schematic diagram of an image in some embodiments of the present application;

[0036] Figure 3 is a schematic diagram of the reference target region and the reference feature region obtained by rotating the first target region and the first feature region in the image in some embodiments of the present application; Figure 2

[0037] Figure 4 is a schematic diagram of the third target region and the third feature region obtained by rotating the first target region and the first feature region in the image in some embodiments of the present application; Figure 2

[0038] Figure 5 is a flowchart of another embodiment of the battery module orientation detection method of the present application; ​​

[0039] Figure 6 is a flowchart of another embodiment of the battery module orientation detection method of the present application;

[0040] Figure 7 is a flowchart of yet another embodiment of the battery module orientation detection method of the present application;

[0041] Figure 8 is a schematic diagram of a trend indicator line in some embodiments of the present application;

[0042] Figure 9 is a flowchart of yet another embodiment of the battery module orientation detection method of the present application;

[0043] Figure 10 is a flowchart of yet another embodiment of the battery module orientation detection method of the present application;

[0044] Figure 11 is a flowchart of yet another embodiment of the battery module orientation detection method of the present application;

[0045] Figure 12 is a flowchart of yet another embodiment of the battery module orientation detection method of the present application;

[0046] Figure 13 is a flowchart of yet another embodiment of the battery module orientation detection method of the present application;

[0047] Figure 14 is a flowchart of yet another embodiment of the battery module orientation detection method of the present application;

[0048] Figure 15 is a schematic diagram of an embodiment of the battery module orientation detection system of the present application;

[0049] Figure 16 is a schematic diagram of an embodiment of the computer readable storage medium of the present application. DETAILED DESCRIPTION

[0050] The schemes of the embodiments of the present application will be described in detail below with reference to the accompanying drawings.

[0051] In the following description, for the purposes of explanation and not limitation, specific details are set forth, such as particular system configurations, interfaces, techniques, etc., in order to provide a thorough understanding of the present application.

[0052] The term "and / or", used in the present document, only describes the association relationship of the associated objects, which means that there can be three relationships, for example, A and / or B can represent the following three cases: A exists alone, A and B exist together, and B exists alone. In addition, the character " / " in the present document generally represents an "or" relationship between the front and rear associated objects. In addition, "multiple" in the present document means two or more than two. In addition, the term "at least one" in the present document means any one of multiple or any combination of at least two of multiple, for example, including at least one of A, B and C can mean including any one or more elements selected from the set consisting of A, B and C.

[0053] In an industrial production line, a camera device can be deployed on the production line to monitor products, worker operations, etc. on the production line, thereby improving product qualification rate or worker operation compliance, etc. For example, in a battery module manual packaging scenario, the orientation of the battery module usually needs to meet certain standards, and therefore, in the embodiments provided in the present application, the orientation of the battery module in the image can be detected based on image acquisition by the deployed camera device.

[0054] However, the present inventors have found in practical applications that, due to different shooting angles of the cameras deployed on site, the orientation of the battery module in the acquired image is difficult to detect by using unified detection parameters, in other words, if unified detection parameters are used for orientation detection, the accuracy of the orientation detection will be affected; if corresponding detection parameters are configured for different cameras, the deployment difficulty and cost will be increased.

[0055] Therefore, the present application provides a battery module orientation detection method, please refer to Figure 1 The battery module orientation detection method comprises:

[0056] Step S100: acquiring images of a plurality of battery modules.

[0057] The images can be acquired by a camera device deployed at the workstation. The camera device can acquire the frame images in the video stream as images for battery module orientation detection by acquiring a video stream. Alternatively, the camera device can acquire images in a manner of image acquisition at a preset time interval, etc. The present application does not limit the image acquisition manner.

[0058] When the image acquisition is performed in step S100, one image can be acquired for several workstations, that is, the image can include the regions of several workstations; or the image acquisition can be performed for one workstation, that is, the image can only include the region of one workstation.

[0059] Step S200: determining a first target region of each battery module in the image, and determining a first feature region of each label in the image.

[0060] The label is arranged on the battery module.

[0061] In combination Figure 2 The battery module orientation detection method of the present application is described taking the battery module orientation detection in the battery module packaging scenario as an example. In the manual battery packaging process, it is required to paste a label on the corresponding position of the battery module, and sometimes it is also required to place the battery module in a certain orientation when packaging (for example, all left, all right, or one column left and one column right, etc., which is not limited by the present application). The orientation of the battery module can be determined according to the relative position of the label on the battery module, for example, if the label is on the left side of the battery module, it indicates that the battery module is facing left; if the label is on the right side of the battery module, it indicates that the battery module is facing right. As shown in Figure 2 The thick solid line box represents the battery module, the thin solid line box represents the label, and the dashed line box represents the first target area of the battery module and the first feature area of the label, respectively. The first target area and the first feature area are used to indicate the position of the battery module and the label in the image, for example, the first target area and the first feature area can be the bounding box or the circumscribed rectangle of the battery module and the label, Figure 2 As an example of the first target area and the first feature area, the shape, size, etc. of the first target area and the first feature area can be set according to actual needs, which is not limited by the present application.

[0062] Step S300: Rotate the first target area and the first feature area to obtain the second target area and the second feature area.

[0063] The reference direction is a coordinate axis direction of the preset coordinate system.

[0064] It can be understood that the label is fixed on the battery module, so the relative position relationship between the first target area and the first feature area remains unchanged before and after rotation.

[0065] In some embodiments, the first edge of the battery module in the second target area can be parallel to the first coordinate axis of the preset coordinate system; and the second edge of the battery module in the second target area can be parallel to the second coordinate axis of the preset coordinate system. Please refer to Figure 3 , wherein the first coordinate axis (for example, X axis) and the second coordinate axis (for example, Y axis) are coordinate axes in the preset coordinate system. In Figure 3 , the reference direction can be the Y axis direction in the preset coordinate system. The first edge of the battery module can be the longer edge of the battery module in the image, and the second edge of the battery module can be the shorter edge of the battery module. In other embodiments, the reference direction can be the X axis direction in the preset coordinate system, which is not limited by the present application.

[0066] In some embodiments, the first target region and the first feature region can be rotated, which can be only rotating a part within the first target region and the first feature region, or the whole image can also be rotated.

[0067] Step S400: determining the orientation of the battery module based on the coordinates of the first reference point in the second feature region and the second reference point in the second target region in the preset coordinate system.

[0068] The orientation of the battery module is the direction of the first reference point relative to the second reference point.

[0069] The relative position relationship between the second feature region and the second target region can be determined according to the size relationship of the coordinates of the first reference point in the second feature region and the second reference point in the second target region in the preset coordinate system, and then the relative position relationship of the label in the battery module is determined, so as to determine the orientation of the battery module. For example, if the X coordinate (horizontal coordinate) of the first reference point in the second feature region is greater than the X coordinate of the second reference point in the second target region, it indicates that the first reference point in the second feature region is on the right side of the second reference point in the second target region; if the Y coordinate (vertical coordinate) of the first reference point in the second feature region is greater than the Y coordinate of the second reference point in the second target region, it indicates that the first reference point in the second feature region is on the upper side of the second reference point in the second target region; or, if the X coordinate (horizontal coordinate) of the first reference point in the second feature region is greater than the X coordinate of the second reference point in the second target region, it indicates that the first reference point in the second feature region is on the left side of the second reference point in the second target region; if the Y coordinate (vertical coordinate) of the first reference point in the second feature region is greater than the Y coordinate of the second reference point in the second target region, it indicates that the first reference point in the second feature region is on the lower side of the second reference point in the second target region, and the like, which are not limited in the present application.

[0070] The first reference point can be the center point of the second feature region; correspondingly, the second reference point can be the center point of the second target region. Alternatively, the first reference point can be the top-left vertex of the second feature region; correspondingly, the second reference point can be the top-left vertex of the second target region. The selection of the first reference point and the second reference point is not limited in the present application.

[0071] Therefore, by rotating the first target region and the first feature region to obtain the second target region and the second feature region, and the reference direction is the direction of a coordinate axis of the preset coordinate system, the first target region and the first feature region in the images captured at different shooting angles are rotated to be parallel to the direction of the coordinate axis of the preset coordinate system, and then the orientation of the battery module can be determined according to the coordinates of the first target region and the first feature region in different images in the unified preset coordinate system, in other words, the images captured at different shooting angles can be detected by using the same detection parameters, thereby reducing the deployment difficulty and cost.

[0072] In some embodiments, referring to Figure 5 , rotating the first target region and the first feature region comprises:

[0073] Step S310: in response to the direction of the first edge of the battery module in the first target region not matching the reference direction, rotating the first target region and the first feature region by a preset angle in a predetermined direction to obtain a third target region and a third feature region.

[0074] Step S311: determining a second included angle between the first edge of the battery module in the third target region and the reference direction, and rotating the third target region and the third feature region towards the reference direction by the second included angle to obtain a second target region and a second feature region.

[0075] In combination with Figures 2-4 , in Figure 2 , the battery module is horizontally arranged as a whole (i.e., the first edge is close to the horizontal state), and the corresponding first target region is also horizontally arranged. The reference direction is the Y-axis direction, and the first edge of the battery module does not match the reference direction. The first target region and the first feature region can be rotated by 90° in the counterclockwise direction, so that the battery module is vertically arranged as a whole (i.e., the first edge is close to the vertical state). Then, the second included angle between the direction of the first edge of the battery module in the third target region and the reference direction is determined, and the third target region and the third feature region are further rotated towards the reference direction to obtain the second target region and the second feature region.

[0076] The above scheme, when the direction of the first edge of the battery module does not match the reference direction, through a two-stage rotation mechanism, i.e., first rotating by a preset angle in a predetermined direction to obtain a third target region, and then rotating the third target region according to the second included angle between the battery module in the third target region and the reference direction to obtain a second target region, is conducive to making the second target region more accurately match the reference direction, and further conducive to improving the accuracy of the orientation detection when using the preset coordinate system for orientation detection.

[0077] In some embodiments, referring to Figure 6 , rotating the first target region and the first feature region further comprises:

[0078] Step S320: in response to the direction of the first edge of the battery module in the first target region matching the reference direction, determining a first included angle between the first edge of the battery module in the first target region and the reference direction, and rotating the first target region and the first feature region towards the reference direction by the first included angle to obtain a second target region and a second feature region.

[0079] Exemplarily, the predetermined direction can include a counterclockwise direction or a clockwise direction. The preset angle can include 90°, 180°, etc., which are not limited in the present application.

[0080] The above scheme is advantageous in improving the detection efficiency of the orientation detection, by directly rotating the third target region and the third feature region according to the first included angle when the direction of the first side of the battery module matches the reference direction.

[0081] In some embodiments, referring to Figure 7 The second included angle of the first side of the battery module in the third target region and the reference direction is determined in step S311, including:

[0082] Step S311a: determining a third reference point in each third target region, respectively.

[0083] The third reference point can be a center point of the third target region, or a center point of the battery module in the third target region, or a vertex of the battery module, etc., and the selection manner of the third reference point is not limited in the present application. In some embodiments, one, two or three third reference points can be determined in the third target region, and the number of the third reference points is not limited in the present application.

[0084] It should be noted that the third reference points determined in each third target region are selected by the same standard, for example, all are center points of the battery module, or all are vertices at corresponding positions of the battery module, etc.

[0085] Step S311b: obtaining an average value of coordinate values of a plurality of to-be-fitted reference points in a preset coordinate system, to obtain a first fitted reference point.

[0086] The plurality of to-be-fitted reference points include the third reference points in each third target region in the same row or the same column.

[0087] Step S311c: fitting each first fitted reference point corresponding to different rows or columns to obtain a trend indication line.

[0088] Exemplarily, in step S311c, linear regression calculation can be performed on each first fitted reference point corresponding to different rows or columns, and the trend indication line is obtained by fitting based on the linear regression calculation result.

[0089] Step S311d: obtaining an included angle between the trend indication line and the first direction as the second included angle of the first side of the battery module in the third target region and the reference direction.

[0090] The first direction is parallel or perpendicular to the reference direction.

[0091] In combination with Figure 8 In Figure 8In the example shown in FIG. 6, the center point of the battery module is taken as the third reference point, the reference direction is the Y-axis direction, the first direction is perpendicular to the reference direction, and the to-be-fitted reference points include the average value of each third reference point in the same column. In other words, the first fitted reference point is obtained by averaging the coordinates of the third reference points in the same column, and the first direction is the X-axis direction. As shown in FIG. 6, after obtaining the trend indication line, the angle between the trend indication line and the first direction (X-axis direction) is obtained, which is equivalent to obtaining the angle between the first side of the battery module in the third target region and the reference direction (Y-axis direction). Thus, the angle can be taken as the rotation angle, and the third target region and the third feature region are rotated toward the reference direction (Y-axis direction). Figure 8

[0092] In other embodiments, the to-be-fitted reference points can include each third reference point in the same row, the reference direction can be the Y-axis direction, and the first direction can be parallel to the reference direction.

[0093] It can be understood that when the first angle between the first side of the battery module and the reference direction is determined in step S320 and the first target region and the first feature region are rotated to obtain the second target region and the second feature region, the operations in steps S311a-S311d can also be referred to, which will not be described herein again.

[0094] The above scheme obtains the trend indication line of the third reference points in the third target region by fitting, and obtains the angle between the trend indication line and the first direction as the second angle between the first side of the battery module in the third target region and the reference direction, which is beneficial to improving the accuracy of the second angle between the first side of the battery module in the third target region and the reference direction, and further makes the matching degree between the second target region obtained by rotating the third target region according to the second angle and the reference direction higher, thereby being beneficial to further improving the accuracy of the orientation detection when the preset coordinate system is used for orientation detection.

[0095] In some embodiments, the first target region is a rectangle; please refer to Figure 9 Before rotating the first target region and the first feature region to obtain the second target region and the second feature region in step S200, the method further includes:

[0096] Step S210: obtaining the ratio of the first side adjacent to the first target region to the second side as the aspect ratio of the first target region.

[0097] The second side of the first target region is parallel to the reference direction.

[0098] Step S220: when the aspect ratio is not less than a preset ratio, it is determined that the direction of the first side of the battery module in the first target region is not matched with the reference direction.

[0099] ​Exemplarily, the preset ratio can be 1. In other embodiments, the preset ratio can also be 1.5, 1.1, 2, etc., which are not limited in the present application.

[0100] Step S230: When the aspect ratio is less than the preset ratio, it is determined that the direction of the first side of the battery module in the first target region matches the reference direction.

[0101] Exemplarily, in combination with Figures 2-3 , it is assumed that the reference direction is the Y-axis direction (for example, the vertical direction), the second side in the first target region is the short side in the vertical direction in the first target region, and the first side in the first target region is the long side in the horizontal direction in the first target region. When the ratio of the first side in the first target region to the second side in the first target region is greater than or equal to 1, it indicates that the battery module is closer to horizontal placement and does not match the reference direction (vertical direction); when the ratio of the first side in the first target region to the second side in the first target region is less than 1, it indicates that the battery module is closer to vertical placement and matches the reference direction (vertical direction).

[0102] The above scheme determines whether the first target region matches the reference direction by the ratio of the first side to the second side in the first target region, which is beneficial to improve the efficiency of determining the direction of the battery module in the first target region.

[0103] In some embodiments, please refer to Figure 10 , the step S400 of determining the orientation of the battery module based on the coordinates of the first reference point in the second feature region and the second reference point in the second target region in the preset coordinate system comprises:

[0104] Step S410: determining the second reference coordinates of the second reference point in the second target region in the preset coordinate system, and / or the first reference coordinates of the first reference point in the second feature region in the preset coordinate system.

[0105] Step S420: determining the orientation of the battery module based on the first offset value of the first reference coordinates relative to the second reference coordinates in the first coordinate axis direction in the preset coordinate system, and / or the second offset value of the first reference coordinates relative to the second reference coordinates in the second coordinate axis direction in the preset coordinate system.

[0106] In combination with Figure 3The first reference point and the second reference point can be determined in the second feature region and the second target region respectively, and the orientation of the battery module can be determined according to the coordinate relationship between the two. Exemplarily, the first reference point and the second reference point can be the center points of the second feature region and the second target region, the first coordinate axis can be the X axis in the preset coordinate system, and the second coordinate axis can be the Y axis in the preset coordinate system. Assuming that the second reference coordinate of the second reference point in the preset coordinate system is (x2, y2), the first reference coordinate of the first reference point in the preset coordinate system is (x1, y1), and x2 is greater than x1, it indicates that the label is on the left side of the battery module; y2 is greater than y1, it indicates that the label is on the lower side of the battery module. It can also be obtained that the label is on the lower left side of the battery module according to x2 being greater than x1 and y2 being greater than y1. After the relative position relationship of the label on the battery module is obtained, the orientation of the battery module can be determined.

[0107] In some embodiments, when the first offset value and the second offset value are greater than a preset threshold, it can be determined that the label is on the left side and the lower side of the battery module. Exemplarily, the preset threshold can be 0. The preset threshold can also be other numerical values, which are not limited in the present application.

[0108] The above scheme determines the offset values of the coordinates of the first reference point in the second feature region and the second reference point in the second target region in the preset coordinate system, so that the same detection parameters can be used to determine the orientation of the battery module when the orientation is detected for different images, thereby further reducing the deployment difficulty and cost.

[0109] In some embodiments, please refer to Figure 11 determining the orientation of the battery module based on the first offset value of the first reference coordinate relative to the second reference coordinate in the first coordinate axis direction of the preset coordinate system and / or the second offset value of the first reference coordinate relative to the second reference coordinate in the second coordinate axis direction of the preset coordinate system in step S420 includes:

[0110] Step S421: based on the first offset value of the second reference coordinate relative to the first reference coordinate in the first coordinate axis direction and the length of the battery module in the first coordinate axis direction, calculating the width offset proportion of the second reference coordinate relative to the first reference coordinate in the first coordinate axis direction; and / or, based on the second offset value of the second reference coordinate relative to the first reference coordinate in the second coordinate axis direction and the length of the battery module in the second coordinate axis direction, calculating the height offset proportion of the second reference coordinate relative to the first reference coordinate in the second coordinate axis direction.

[0111] Step S422: determining the orientation of the battery module based on the width offset proportion and the height offset proportion.

[0112] Exemplarily, in combination with Figure 3For example, assuming that the length of the battery module in the first coordinate axis (X-axis) direction is 150 and the first offset value is -30, the width offset ratio is -0.2; when the size of the battery module is different, for example, the length of the battery module in the first coordinate axis (X-axis) direction is 300 and the first offset value is -60, the width offset ratio is -0.2. Therefore, by converting the offset value into the offset ratio, the same detection parameter (for example, the preset threshold) can be used for orientation detection for battery modules of different sizes.

[0113] The above scheme determines the orientation of the battery module through the width offset ratio and the height offset ratio, and the same detection parameter can be used for orientation detection for different sizes of battery modules and different camera angles, which is beneficial to reduce the influence of different sizes of battery modules or different camera angles on orientation detection, thereby improving the accuracy of orientation detection, and is also beneficial to further reduce the deployment difficulty and cost.

[0114] In some embodiments, please refer to Figure 12 After obtaining the second target region, the method further includes:

[0115] Step S1210: determining a coordinate interval in which the second target region is located based on the coordinates of the fourth reference point in the preset coordinate system.

[0116] For example, the coordinate interval division point can be determined according to the average value of the coordinates of the fourth reference points in the two adjacent rows or the two adjacent columns of the second target region.

[0117] For example, the fourth reference point can be a center point in the second target region, or any point on the second target region, which is not limited in the present application.

[0118] In some embodiments, please continue to refer to Figure 12 After determining the orientation of the battery module, the method further includes:

[0119] Step S1220: determining whether the orientation of the battery module is the same as the preset reference orientation of the corresponding coordinate interval.

[0120] For example, the preset reference orientations of different coordinate intervals can be different or the same, and the preset reference orientations of different coordinate intervals can be preconfigured. For example, the reference orientations of different coordinate intervals can be preconfigured to be the same, or the reference orientations of adjacent coordinate intervals can be configured to be opposite.

[0121] The above scheme determines whether the orientation of the battery module is the same as the preset reference orientation corresponding to the coordinate interval in which the second target region is located, thereby providing more flexible detection criteria for orientation detection.

[0122] In some embodiments, the determining, in step S1210, the coordinate interval in which the second target region is located based on the coordinate of the fourth reference point in the preset coordinate system in the second target region can include: determining an average value of a sub-coordinate value of the fourth reference point in each second target region in the preset coordinate system; the sub-coordinate value includes a horizontal coordinate value or a vertical coordinate value of the fourth reference point; in response to the sub-coordinate value of the fourth reference point in the second target region being greater than the average value, determining that the coordinate interval in which the battery module is located is the first coordinate interval; and in response to the sub-coordinate value of the fourth reference point in the second target region being not greater than the average value, determining that the coordinate interval in which the battery module is located is the second coordinate interval.

[0123] In combination Figure 3 , the coordinate interval segmentation position can be determined according to the average value of the vertical coordinates of the center points of the upper and lower second target regions. For example, assuming that the vertical coordinate of the center point of the upper second target region is Y1 and the vertical coordinate of the center point of the lower second target region is Y2, the coordinate interval segmentation position is (Y1+Y2) / 2. In other words, if the vertical coordinate of the center point is greater than (Y1+Y2) / 2, it is determined that the second target region is in the first coordinate interval, and if the vertical coordinate of the center point is not greater than (Y1+Y2) / 2, it is determined that the second target region is in the second coordinate interval. In other embodiments, the coordinate interval segmentation position can also be determined according to the average value of the fourth reference points in the two adjacent columns of second target regions, and the number of coordinate intervals is not limited to two. The number of coordinate intervals can be set according to actual needs, which is not limited in the present application.

[0124] The above scheme determines the coordinate interval through the average value of the fourth reference points in each second target region, which is beneficial to improving the efficiency of determining the coordinate interval.

[0125] In some embodiments, referring to Figure 13 , before the rotating, in step S300, the first target region and the first feature region to obtain the second target region and the second feature region, the method further includes:

[0126] Step S201: determining the number of battery modules and / or labels in the image.

[0127] Step S202: in response to the number of battery modules and / or labels being less than a preset threshold, discarding the image.

[0128] It can be understood that the battery module packaging is a dynamic process, and has a transition state between the start of packaging and the completion of packaging. During the battery module packaging process, workers package the battery modules and place them together in a certain order, and label the battery modules. The camera device can capture images during the packaging process of the battery modules. In order to alleviate the false alarm problem caused by insufficient number of modules or missing labels when the module packaging is not completed, the number verification can be performed before the execution of the orientation determination. Exemplarily, if the number of battery modules identified in the current image is less than the preset rated number, the orientation detection of the image can not be triggered (for example, if the standard packaging number is 6, when the number of battery modules in the image is less than 6, the packaging is not completed, and the orientation detection of the image is not triggered); if the number of labels identified is less than 50% of the number of battery modules (that is, there are a large number of battery modules without labels, and the labeling is not completed), the orientation detection of the image can also not be triggered.

[0129] It is worth mentioning that the orientation detection of the battery module in the present application is based on images. When the number of battery modules in the image is insufficient (not completed), or the number of labels of the battery modules in the image is insufficient (not completed), or both the number of battery modules and the number of labels in the image are insufficient (both the packaging and the labeling are not completed), the orientation detection of the image can not be triggered, that is, the image is discarded.

[0130] The above scheme discards the image when the number of battery modules and / or labels is less than the preset threshold, which is beneficial to reduce the influence of false alarm caused by orientation detection when the number of battery modules and / or labels is insufficient. It is beneficial to alleviate the false alarm caused by the transient state (such as the worker has not completed the labeling), and enhances the robustness of the orientation detection.

[0131] In some embodiments, please refer to Figure 14 Before rotating the first target region and the first feature region to obtain the second target region and the second feature region, the method further includes:

[0132] Step S1401: Determine the fifth reference point in each first target region, and the sixth reference point on each first feature region.

[0133] Step S1402: Determine the first target region corresponding to the fifth reference point closest to each sixth reference point, respectively, to obtain a plurality of matching pairs.

[0134] The matching pair includes the first feature region and the corresponding first target region.

[0135] In combination with Figures 2-4In the packaging process, workers label each battery module. In the image, the area corresponding to each battery module is identified as a first target area, and the area corresponding to each label is identified as a first feature area. Just as each battery module has a corresponding relationship with its label, each first target area also has a corresponding relationship with its corresponding first feature area. It can be understood that the Euclidean distance between the fifth reference point in the first target area and the sixth reference point in the corresponding first feature area is smaller than the Euclidean distance between the fifth reference point in the first target area and the sixth reference point in the first feature area that does not have a corresponding relationship. Therefore, a number of matching pairs can be obtained according to the distance.

[0136] When determining the first target area corresponding to the fifth reference point closest to the sixth reference point, the Euclidean distance between each fifth reference point and the sixth reference point can be calculated.

[0137] Step S1403: Determine the first overlap rate of the first feature area and the first target area in the matching pair.

[0138] Step S1404: In response to the first overlap rate being greater than a preset overlap rate, determine that the matching pair is a valid matching pair.

[0139] Step S1405: In response to the first overlap rate not being greater than the preset overlap rate, determine that the matching pair is an invalid matching pair.

[0140] In combination Figures 2-4 , the first overlap rate between the first target area and the first feature area having a corresponding relationship is usually high, so the size of the first overlap rate can be used to determine whether the matching pair is valid. The preset overlap rate can be 50%, 80%, etc. The specific value can be set according to the actual scene, which is not limited by the present application.

[0141] Exemplarily, when a worker fails to label a certain battery module due to work error, the first target area of the battery module does not have a corresponding first feature area. However, in step S1402, the first feature area having the smallest distance from the first target area is determined and forms a matching pair. In step S1403, according to the first overlap rate between the first target area and the first feature area, the matching pair can be determined as an invalid matching pair, thereby alleviating the problem of orientation detection error caused by the error matching pair.

[0142] The above scheme determines whether the matching relationship between the first target area and the first feature area is valid, which is beneficial to reduce the impact of the matching relationship between the error first target area and the first feature area on the orientation detection error, and further improves the accuracy of the orientation detection.

[0143] In some embodiments, before the rotating the first target region and the first feature region to obtain the second target region and the second feature region in step S200, the method further comprises:

[0144] Step S1501: identifying each detection object in the image to obtain an identification region of each detection object.

[0145] The detection objects include the battery module and the label, and the identification region surrounds the detection object.

[0146] In some embodiments, the detection objects can also include interference objects. The identification region can be a circumscribed rectangle surrounding each detection object. The specific setting can be made according to actual needs, which is not limited in the present application.

[0147] Step S1502: determining a second overlap rate of the identification region and a preset detection region.

[0148] The preset detection region can be a specific station. Illustratively, the image can include at least 1 station, for example, the image can include 2 stations, that is, the field of view of one camera device can cover 2 stations, so as to collect an image including 2 stations. The range of each station, that is, the preset detection region, can be pre-configured, so that when the orientation of the battery module in a certain station is detected, the battery module in the range of the station can be detected, thereby alleviating the influence of the battery module not belonging to the range of the station on the orientation detection.

[0149] Step S1503: determining a detection object with a second overlap rate greater than or equal to a preset overlap rate as an associated object of the preset detection region.

[0150] The above scheme determines a detection object with a second overlap rate greater than or equal to a preset overlap rate as an associated object of the preset detection region by determining the second overlap rate of the identification region and the preset detection region, which is beneficial to eliminate the detection objects irrelevant to the preset detection region in the image, reduce the influence of the irrelevant detection objects on the orientation detection of the battery module in the preset detection region, and further improve the accuracy of the orientation detection.

[0151] In some embodiments, the RTSP protocol can be used to pull the camera video stream by calling the standard API interface provided by the monitoring platform.

[0152] In some embodiments, the battery module can be a valid frame in the video stream. The valid frame includes a frame image corresponding to the normal operation of the operator. The idle state when no one operates, the operation of non-operator and other interference frames are filtered.

[0153] In some embodiments, the motion intensity between consecutive frames can be detected using a sliding window method to remove interference frames such as false touch, jitter, and occlusion. Specifically, the pixel difference value between adjacent frames can be calculated, and when it exceeds a certain threshold, it is considered an abnormal frame and is removed.

[0154] In some embodiments, the image can be analyzed by a YOLOv5 model and orientation detection can be performed. When obtaining the data set of the training model, the training image can be randomly rotated (for example, rotated by 30°) to simulate the influence of camera installation angle deviation on orientation detection. The brightness level of the training image can also be adjusted to enable the model to work under different lighting conditions.

[0155] In some embodiments, during the labeling process during model construction, LabelMe tools can be used to label the battery module body, label body, and interference separately, and three independent classification systems can be established. Interference can include objects that frequently appear in the picture but are not related to the detection task, such as tools, technician body parts, and module packaging materials.

[0156] In some embodiments, input preprocessing can be performed on the image input to the model. For example, all input images can be uniformly adjusted to a resolution of 640x640 pixels.

[0157] In some embodiments, a weighted loss function can be used to enhance the model's ability to suppress interference when training the model. Specifically, a lower weight can be assigned to the interference category, while a higher weight can be assigned to the target category (module and label). This allows the model to focus more on reducing false positives for the target during training, rather than focusing too much on interference. A weight factor w can also be introduced based on the standard cross-entropy loss function to obtain a weighted cross-entropy loss function L weighted . This makes the final loss value more biased towards correctly identifying the target rather than the interference (making the model have a stronger suppression ability for interference, thereby reducing false positives). The weighted cross-entropy loss function L weighted is: . Where, and are the weights of positive examples (e.g., module / label) and negative examples (e.g., interference), respectively.

[0158] In some embodiments, a dedicated sub-model can be trained for the module body, label body, and interference, thereby alleviating the problem of class confusion in a single model. Moreover, each sub-model can be independently trained and optimized according to its specific task requirements, thereby achieving better performance.

[0159] In practical applications, through some embodiments of the present application, the orientation detection of at least two independent workstations can be performed on the same image, and the false detection rate can be reduced to below 0.5%. The above scheme not only realizes unified monitoring and logical isolation of a single camera for multiple workstations, but also effectively improves the accuracy of target identification and system stability, and is suitable for low-cost, multi-line deployment scenarios. By rotating the first feature region and the first target region, the matching accuracy of the inclined module label is improved. According to actual measurement, when the inclination angle of the battery module reaches 30°, the label matching accuracy is still maintained at more than 99.5%, meeting the high robustness requirements in complex industrial scenarios. In addition, by rotating the first feature region and the first target region to obtain the second target region and the second feature region, the automatic unification of the image coordinate system is realized, so that the cameras installed at different angles can share the same detection logic, and the operation and maintenance efficiency is improved by more than 60%. In some embodiments of the present application, by determining the preset reference orientation according to the coordinate interval where the second target region is located, not only the individual needs in diversified production scenarios are met, but also good scalability is provided to support subsequent addition of rule types, significantly improving the flexible production capacity of the system. For example, for user customized packaging needs (such as the labels of the battery modules in the left column of the packaging box facing left and the labels of the battery modules in the right column facing right), by calculating the mean value of the Y coordinates of the center points of the battery modules, the coordinate interval where the battery module is located is determined, and the label relative position analysis logic can be independently applied to each coordinate interval. Combined with the preset orientation rules (such as left / right / freely oriented, etc.), it is determined whether the orientation of each layer of module meets the preset orientation rules.

[0160] Those skilled in the art can understand that in the above method of the specific implementation, the writing order of each step does not mean a strict execution order and does not constitute any limitation on the implementation process. The specific execution order of each step should be determined by its function and possible internal logic.

[0161] Please refer to Figure 15 , Figure 15 is a frame diagram of an embodiment of the battery module orientation detection system of the present application. The battery module orientation detection system 80 includes a camera device 83, a storage device 81 and a processing device 82 coupled to each other. The camera device 83 is used to collect images, and the processing device 82 is used to execute program instructions stored in the storage device 81 to realize the steps in any of the above battery module orientation detection method embodiments.

[0162] Specifically, the processing device 82 is configured to control itself and the storage device 81 to implement the steps in any of the above-described battery module orientation detection method embodiments. The processing device 82 can also be referred to as a CPU (Central Processing Unit). The processing device 82 can be an integrated circuit chip with processing capability. The processing device 82 can also be a general-purpose processing device, a DSP (Digital Signal Processor), an ASIC (Application Specific Integrated Circuit), an FPGA (Field-Programmable Gate Array) or other programmable logic device, discrete gate or transistor logic device, discrete hardware component. The general-purpose processing device can be a microprocessor device or the processing device can also be any conventional processing device. In addition, the processing device 82 can be implemented by an integrated circuit chip together.

[0163] Please refer to Figure 16 , Figure 16 is a schematic diagram of a framework of an embodiment of the computer readable storage medium of the present application. The computer readable storage medium 90 stores program instructions 901 capable of being executed by a processor, and the program instructions 901 are used to implement the steps in any of the above-described battery module orientation detection method embodiments.

[0164] In some embodiments, the apparatus provided by the embodiments of the present disclosure has functions or includes modules that can be used to perform the methods described in the above method embodiments, and the specific implementation can refer to the description of the above method embodiments. For brevity, it will not be described here.

[0165] The above description of each embodiment tends to emphasize the differences between the embodiments, and the same or similar parts can be mutually referred to, and for brevity, will not be described here.

[0166] In several embodiments provided in the present application, it should be understood that the disclosed method and apparatus can be implemented in other ways. For example, the above-described apparatus implementation is only schematic, for example, the division of the modules or units is only a logical function division, and actual implementation can have another division manner, for example, a unit or component can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the coupling or direct coupling or communication connection between the shown or discussed mutual elements can be indirect coupling or communication connection through some interface, device or unit, and can be electrical, mechanical or other forms.

[0167] In addition, each function unit in each embodiment of the present application can be integrated in one processing unit, or each unit can be physically present separately, or two or more units can be integrated in one unit. The integrated unit can be realized in the form of hardware or in the form of a software function unit.

[0168] When the integrated unit is realized in the form of a software function unit and sold or used as an independent product, it can be stored in a computer readable storage medium. Based on such understanding, the technical solutions of the present application, essentially or in other words, the part that contributes to the prior art or the whole or part of the technical solutions can be embodied in the form of a software product. The computer software product is stored in a storage medium, and includes a number of instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) or a processor to execute all or part of the steps of the methods of the various embodiments of the present application. The aforementioned storage medium includes: a U disk, a mobile hard disk, a read-only memory (ROM, Read-Only Memory), a random access memory (RAM, Random Access Memory), a magnetic disk or an optical disk, and various media that can store program codes.

Claims

1. A battery module orientation detection method, characterized by, The method comprises: acquiring images of a plurality of battery modules; determining a first target region of each of the battery modules in the images, and determining a first feature region of each label in the images; wherein the label is arranged on the battery module; rotating the first target region and the first feature region to obtain a second target region and a second feature region; wherein a first side of the battery module in the second target region is parallel to a reference direction, and the reference direction is a direction of a coordinate axis of a preset coordinate system; determining an orientation of the battery module based on coordinates of a first reference point in the second feature region and a second reference point in the second target region in the preset coordinate system; wherein the orientation of the battery module is a direction of the first reference point relative to the second reference point; wherein the determination of the orientation of the battery module based on the coordinates of the first reference point in the second feature region and the second reference point in the second target region in the preset coordinate system comprises: determining a second reference coordinate of the second reference point in the second target region in the preset coordinate system, and a first reference coordinate of the first reference point in the second feature region in the preset coordinate system; determining the orientation of the battery module based on a first offset value of the first reference coordinate relative to the second reference coordinate in a first coordinate axis direction of the preset coordinate system, and a second offset value of the first reference coordinate relative to the second reference coordinate in a second coordinate axis direction of the preset coordinate system.

2. The method of claim 1, wherein, The first side of the battery module in the second target region is parallel to the first coordinate axis of the preset coordinate system; and a second side of the battery module in the second target region is parallel to the second coordinate axis of the preset coordinate system.

3. The method of claim 1, wherein, The rotation of the first target region and the first feature region comprises: in response to a direction of the first side of the battery module in the first target region not matching the reference direction, rotating the first target region and the first feature region by a preset angle in a predetermined direction to obtain a third target region and a third feature region; determining a second included angle between the first side of the battery module in the third target region and the reference direction, and rotating the third target region and the third feature region towards the reference direction by using the second included angle as a rotation angle.

4. The method of claim 3, wherein, The rotation of the first target region and the first feature region further comprises: in response to the direction of the first side of the battery module matching the reference direction, determining a first included angle between the first side of the battery module in the first target region and the reference direction, and rotating the first target region and the first feature region towards the reference direction by using the first included angle as a rotation angle.

5. The method of claim 3, wherein, The determination of the second included angle between the first side of the battery module in the third target region and the reference direction comprises: determining a third reference point in each of the third target regions; obtaining an average value of coordinate values of a plurality of to-be-fitted reference points in the preset coordinate system to obtain a first fitted reference point; wherein the plurality of to-be-fitted reference points comprise the third reference points in the third target regions in the same row or the same column; obtaining a trend indicating line by fitting each of the first fitting reference points corresponding to different rows or columns respectively; obtaining an included angle between the trend indicating line and a first direction as a second included angle between a first side of the battery module in the third target region and the reference direction, wherein the first direction is parallel or perpendicular to the reference direction.

6. The method according to claim 3 or 4, characterized in that, The first target region is a rectangle. Before the rotating the first target region and the first feature region to obtain the second target region and the second feature region, the method further comprises: obtaining a ratio of a first side adjacent to the first target region to a second side as an aspect ratio of the first target region, wherein the second side of the first target region is parallel to the reference direction; when the aspect ratio is not less than a preset ratio, determining that the direction of the first side of the battery module in the first target region does not match the reference direction; when the aspect ratio is less than the preset ratio, determining that the direction of the first side of the battery module in the first target region matches the reference direction.

7. The method of claim 1, wherein, The determining the orientation of the battery module based on the first offset value of the first reference coordinate relative to the second reference coordinate in the first coordinate axis direction of the preset coordinate system, the second offset value of the first reference coordinate relative to the second reference coordinate in the second coordinate axis direction of the preset coordinate system comprises: calculating a width offset proportion of the second reference coordinate relative to the first reference coordinate in the first coordinate axis direction based on the first offset value of the second reference coordinate relative to the first reference coordinate in the first coordinate axis direction and the length of the battery module in the first coordinate axis direction; calculating a height offset proportion of the second reference coordinate relative to the first reference coordinate in the second coordinate axis direction based on the second offset value of the second reference coordinate relative to the first reference coordinate in the second coordinate axis direction and the length of the battery module in the second coordinate axis direction; determining the orientation of the battery module based on the width offset proportion and the height offset proportion.

8. The method of claim 1, wherein, After the obtaining the second target region, the method further comprises: determining a coordinate interval in which the second target region is located based on the coordinates of the fourth reference point in the preset coordinate system in the second target region; After the determining the orientation of the battery module, the method further comprises: determining whether the orientation of the battery module is the same as a preset reference orientation of the corresponding coordinate interval.

9. The method of claim 8, wherein, The determining the coordinate interval in which the second target region is located based on the coordinates of the fourth reference point in the preset coordinate system in the second target region comprises: determining an average value of sub-coordinate values of the fourth reference point in the preset coordinate system in each of the second target regions, wherein the sub-coordinate values include horizontal coordinate values or vertical coordinate values of the fourth reference point; in response to the sub-coordinate value of the fourth reference point in the second target region being greater than the average value, determining that the coordinate interval in which the battery module is located is a first coordinate interval; In response to a sub-coordinate value of a fourth reference point in the second target region being not greater than the average value, it is determined that a coordinate interval in which the battery module is located is a second coordinate interval.

10. The method of claim 1, wherein, Before the rotating the first target region and the first feature region to obtain a second target region and a second feature region, the method further comprises: determining a number of the battery modules and / or the labels in the image; in response to the number of the battery modules and / or the labels being less than a preset threshold, discarding the image.

11. The method of claim 1, wherein, Before the rotating the first target region and the first feature region to obtain a second target region and a second feature region, the method further comprises: determining a fifth reference point in each of the first target regions, and a sixth reference point on each of the first feature regions; determining, respectively, the first target region corresponding to the fifth reference point closest to each of the sixth reference points to obtain a plurality of matching pairs; wherein the matching pair comprises a first feature region and a corresponding first target region; determining a first overlap rate of the first feature region and the first target region in the matching pair; in response to the first overlap rate being greater than a preset overlap rate, determining that the matching pair is a valid matching pair; in response to the first overlap rate being not greater than the preset overlap rate, determining that the matching pair is an invalid matching pair.

12. The method of claim 1, wherein, Before the rotating the first target region and the first feature region to obtain a second target region and a second feature region, the method further comprises: identifying each detection object in the image to obtain an identification region of each of the detection objects; wherein the detection object comprises the battery module and the label, and the identification region encloses the detection object; determining a second overlap rate of the identification region and a preset detection region; determining the detection object whose second overlap rate is greater than or equal to a preset overlap rate as an associated object of the preset detection region.

13. A battery module orientation detection system, comprising: The device comprises a camera, a storage device and a processing device which are coupled to each other, the camera is configured to capture an image, and the processing device is configured to execute program instructions stored in the storage device to implement the battery module orientation detection method according to any one of claims 1 to 12.

14. A computer-readable storage medium having stored thereon program instructions, wherein, The program instructions are executed by a processor to implement the battery module orientation detection method according to any one of claims 1 to 12.

Citation Information

Patent Citations

  • Detection method and device of laminated battery, image processing equipment and medium

    CN117053730A

  • Object detection method and device, storage medium and electronic equipment

    CN118864829A