Battery pack local photographing point acquisition method and device, electronic equipment and medium
The maximum peripheral contour of the upper cover of the battery pack and calculate the local photo points is solved by extracting the maximum peripheral outline of the battery pack cover by a 2D camera, which solves the problem of high time cost for acquiring local photo points by 3D cameras, achieving faster data processing and reduced replacement time.
Patent Information
- Application Number
- CN202411439832.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-15
- Publication Date
- 2025-02-14
AI Technical Summary
In the prior art, the time cost of using a 3D camera to obtain local photo points of the battery pack is relatively high, and it is necessary to build a point cloud template with the upper cover of the battery pack, increasing the replacement time and the number of tests.
The original image of the battery pack cover is obtained through a 2D camera, the maximum peripheral outline is extracted, and the local photo points are calculated using an isometric point sampling algorithm, avoiding the step of building a point cloud template.
Reduces data processing time, omits modeling steps in the global transformation process, and reduces the transformation time and test times.
Smart Images

Figure CN119444678A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of battery pack recycling, and in particular to a method, device, electronic device and medium for obtaining local photographing points of a battery pack. Background Art
[0002] During the intelligent disassembly of retired battery packs, the first thing to do is to remove the screws in the upper cover of the retired battery pack. The intelligent disassembly process is to first locate the retired battery through the global camera, obtain the photo point of the local camera (that is, the local photo point), and then use the local camera to take pictures and identify at the local photo point to obtain the precise coordinates of the screws.
[0003] In the prior art, the global camera commonly used in the intelligent disassembly process is a 3D camera. During the global changeover process of the battery pack cover removal station, modeling requires the construction of a point cloud template of the battery pack cover. In the process of taking pictures and processing data, the entire data processing process takes about 5 seconds (4.7 seconds to 5.2 seconds), which has a high time cost. Summary of the invention
[0004] In view of this, it is necessary to provide a method, device, electronic device and medium for obtaining local photo points of a battery pack, so as to solve the problem of high time cost of using a 3D camera to obtain local photo points of a battery pack in the prior art.
[0005] In order to solve the above problems, the present application provides a method for obtaining local photo points of a battery pack, comprising: Acquire an original image obtained by photographing the upper cover of the battery pack based on a 2D camera; Extracting the maximum peripheral contour from the original image to determine a maximum contour image; Based on an equidistant point sampling algorithm, local photographing points are extracted from the maximum contour image, where the local photographing points are positions where a camera takes a local photograph of the upper cover of the battery pack.
[0006] In some possible implementations, extracting the maximum peripheral contour from the original image to determine the maximum contour image includes: Based on the original image, determining a target image; Performing edge detection on the target image to obtain an initial edge image; Based on the initial edge image, determining a target edge image; The maximum peripheral contour is extracted from the target edge image to obtain a maximum contour image.
[0007] In some possible implementations, determining a target image based on the original image includes: grayscale the original image to obtain an intermediate image; Based on the intermediate image, a target image is determined.
[0008] In some possible implementations, determining a target image based on the intermediate image includes: Gaussian blur processing is performed on the intermediate image to obtain a target image.
[0009] In some possible implementations, performing edge detection on the target image to obtain an initial edge image includes: Based on the Canny operator algorithm, edge detection is performed on the target image to determine an initial edge image.
[0010] In some possible implementations, determining a target edge image based on the initial edge image includes: The edge image is expanded and eroded to obtain a target edge image.
[0011] In some possible implementations, extracting the maximum peripheral contour from the target edge image to obtain the maximum contour image includes: Based on the cv2.findContours function, the maximum outer contour is extracted from the target edge image to obtain a maximum contour image.
[0012] The present application also provides a device for obtaining local photographing points of a battery pack, comprising: A 2D image acquisition unit, used to acquire an original image obtained by photographing the upper cover of the battery pack based on a 2D camera; A maximum contour extraction unit, used for extracting the maximum peripheral contour in the original image to obtain a maximum contour image; The local photographing point extraction unit is used to extract the local photographing point from the maximum contour image based on an equidistant point sampling algorithm, wherein the local photographing point is a position point where the camera takes a local photograph of the upper cover of the battery pack.
[0013] The present application also provides an electronic device, including a memory and a processor; The memory is used to store programs; The processor is coupled to the memory and is used to execute the program stored in the memory to implement the steps of the above-mentioned method for acquiring local photographing points of the battery pack.
[0014] The present application also provides a computer-readable storage medium, on which a program or instruction is stored. When the program or instruction is executed by a processor, the steps of the method for acquiring local photo points of a battery pack described above are implemented.
[0015] The beneficial effects of the present application are as follows: the method for obtaining local photographic points of a battery pack provided by the present application reduces data processing time by extracting the outline of the upper cover of the battery pack in a 2D image and calculating and obtaining the corresponding local photographic points, and omits the modeling step in the global changeover process of the battery pack upper cover removal station. There is no need to build a point cloud template for the upper cover of the battery pack, which reduces the changeover time, omits the global changeover step, and does not require global program debugging, thereby reducing the number of tests. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] Figure 1 A schematic diagram of an embodiment of a method for acquiring local photographing points of a battery pack provided in the present application; Figure 2 Schematic diagram of the original image provided for this application; Figure 3 For this application Figure 1 A schematic flow chart of an embodiment of step S102; Figure 4 Schematic diagram of the intermediate image provided for this application; Figure 5 Schematic diagram of the initial edge image provided for this application; Figure 6 A schematic diagram of an expanded image provided for this application; Figure 7 A schematic diagram of an image after corrosion provided for this application; Figure 8 Schematic diagram of the maximum outline image provided for this application; Fig. 9 Schematic diagram of the distribution of local photo points provided for this application; Fig.10 A schematic diagram of the structure of an embodiment of a device for acquiring local photographing points of a battery pack provided in the present application; Fig.11 A schematic diagram of the structure of an embodiment of an electronic device provided in this application. DETAILED DESCRIPTION
[0017] The technical solutions in the embodiments of the present application will be described clearly and completely below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present application.
[0018] It should be understood that the schematic drawings are not drawn to scale. The flowcharts used in this application illustrate operations implemented according to some embodiments of the present application. It should be understood that the operations of the flowcharts may be implemented out of order, and steps without logical contextual relationships may be reversed in order or implemented simultaneously. In addition, those skilled in the art may add one or more other operations to the flowcharts, or may remove one or more operations from the flowcharts, under the guidance of the content of this application. Some of the block diagrams shown in the accompanying drawings are functional entities, and do not necessarily correspond to physically or logically independent entities. These functional entities may be implemented in software form, or implemented in one or more hardware modules or integrated circuits, or implemented in different networks and / or processor systems and / or microcontroller systems.
[0019] The descriptions of "first", "second", etc. involved in the embodiments of the present application are only used to describe the implicit purpose, and cannot be understood as indicating or implying their relative importance or implicitly indicating the number of the indicated technical features. Therefore, the technical features defined as "first" and "second" may explicitly or implicitly include at least one of the features. "And / or" describes the association relationship of the associated objects, indicating that three relationships may exist, for example: A and / or B, which can represent: A exists alone, A and B exist at the same time, and B exists alone.
[0020] Reference to "embodiments" herein means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present application. The appearance of the phrase in various locations in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein may be combined with other embodiments.
[0021] The present application provides a method for obtaining local photo taking points of a battery pack, which are described below.
[0022] Figure 1 A flowchart of an embodiment of a method for obtaining local photographing points of a battery pack provided in this application is shown as follows: Figure 1 As shown, the method for obtaining local photo points of the battery pack includes: S101, obtaining an original image obtained by photographing the upper cover of the battery pack based on a 2D camera; S102, extracting the maximum peripheral contour from the original image to determine the maximum contour image; S103, extracting local photographing points from the maximum contour image based on an equidistant point sampling algorithm, where the local photographing points are positions where the camera takes a local photograph of the upper cover of the battery pack.
[0023] Compared with the prior art (obtaining the photo points of the local camera through a 3D camera), the present application reduces the data processing time by extracting the outline of the battery pack cover in the 2D image and calculating the corresponding local photo points. It also omits the modeling step in the global changeover process of the battery pack cover removal station, and there is no need to build a point cloud template of the battery pack cover, which further reduces the changeover time. It also omits the global changeover step, and there is no need to debug the global program, thereby reducing the number of tests.
[0024] In a specific embodiment, Figure 2 Take the battery pack cover shown in the figure as an example to illustrate. Figure 2 is the original image of the battery pack cover. Figure 2 There are 55 screws on the entire battery pack cover. A local photo point is set for every 3 screws. The last screw of each photo is the first screw of the next local photo. An overlapping check is performed, and a total of 27 local photo points need to be obtained.
[0025] In order to better extract the maximum outer contour, in some embodiments, the original image is first converted into an edge image that is easier to process, and then the maximum outer contour of the battery cover is found. Specifically, Figure 3 As shown, step S102 includes: S301, grayscale the original image to obtain an intermediate image; It should be noted that the original image captured by the 2D camera is an RGB color image, which usually contains three color channels: red, green and blue. Each channel contains a large amount of data. By graying it, the amount of image data can be reduced, making the shape, contour and edge in the image more prominent. In a specific embodiment, the intermediate image is as follows: Figure 4 shown.
[0026] S302, performing Gaussian blur processing on the intermediate image to obtain a target image.
[0027] It should be noted that Gaussian blur processing can effectively remove noise in an image, making the image smoother and highlighting the main features of the image, such as edges and contours. In a specific embodiment, the effect after Gaussian blur processing is shown in Table 1: Table 1: Gaussian denoising image data table
[0028] As can be seen from Table 1, after Gaussian blur processing, the number of pixels is reduced and many unimportant edges and noises are removed.
[0029] S303, performing edge detection on the target image to obtain an initial edge image; It should be noted that, in some embodiments, the Canny operator is used for edge detection; in a specific embodiment, the initial edge image is as follows: Figure 5 As shown, the result of edge detection is a binary image (black and white image), in which white pixels represent detected edges and black pixels represent non-edge areas.
[0030] S304, performing dilation and corrosion processing on the edge image to obtain a target edge image; It should be noted that the expansion operation uses a 5 5, by expanding the edge pixels outward, connecting the broken edges, and enhancing the continuity of the edges; then, the expanded image is eroded; the erosion operation uses the same structural element to shrink the expanded edge to a width close to the original width, eliminate redundant noise points, and maintain the smoothness of the edge; through the processing steps of first dilation and then erosion, the broken parts in the edge can be effectively connected to ensure the integrity of the contour; in a specific embodiment, the expanded image is as follows Figure 6 As shown, the image after corrosion is Figure 7 shown.
[0031] S305 , extracting the maximum outer contour from the target edge image to obtain a maximum contour image.
[0032] It should be noted that, in some embodiments, the contours in the image are extracted by using the cv2.findContours function, which receives the processed binary image as input and returns a list containing all detected contours, each contour consisting of a set of continuous points, representing a connected boundary in the image; in a specific embodiment, the maximum contour image is as follows Figure 8 shown.
[0033] After extracting the maximum contour of the object, local photographic points are extracted from the maximum contour image based on an equidistant point sampling algorithm, specifically including: first, calculating the total arc length of the contour (the arc length represents the perimeter of the contour, that is, the sum of the distances from the starting point to the end point along the contour), and calculating the geometric center point of the contour; then, by calculating the distance between each corner point in the contour and the center point, the corner point closest to the center point is selected as the first local photographic point, and the corner point is unique in the geometric shape of the contour, and can ensure that a stable and consistent photographic starting point is obtained in each processing process; then, based on the initial point, subsequent photographic points are equidistantly distributed, starting from the starting point of the contour, by traversing each point on the contour, the photographic points are equidistantly distributed according to a preset interval distance, and in each processing process, the distance between the current point and the next point is accumulated and calculated. When the accumulated distance reaches or exceeds the preset interval, a new photographic point is generated. This process ensures the uniform distribution of local photographic points on the contour; in a specific embodiment, the local photographic points are distributed as follows Fig. 9 shown.
[0034] Based on the above method, in a specific embodiment, the entire code running time of the battery pack local photo point acquisition method of the present application is 0.03s (exposure time: 0.001s, image transmission time: 0.016s, image processing time: 0.013s), while the 3D structured light camera takes 5s to process data during the photo taking and data processing process. The comparison between the two reduces the changeover time.
[0035] In order to better implement a method for obtaining local photographic points of a battery pack in an embodiment of the present application, based on a method for obtaining local photographic points of a battery pack, correspondingly, Fig.10 As shown, the embodiment of the present application further provides a battery pack local photo point acquisition device 1000, comprising: A 2D image acquisition unit 1001 is used to acquire an original image obtained by photographing the upper cover of the battery pack based on a 2D camera; The maximum contour extraction unit 1002 is used to extract the maximum peripheral contour in the original image to obtain a maximum contour image; The local photographing point extraction unit 1003 is used to extract local photographing points from the maximum contour image based on an equidistant point sampling algorithm, where the local photographing points are positions where the camera takes a local photograph of the upper cover of the battery pack.
[0036] The battery pack local photographing point acquisition device 1000 provided in the above embodiment can implement the technical solution described in the above battery pack local photographing point acquisition method embodiment. The specific implementation principles of the above units can refer to the corresponding contents in the above battery pack local photographing point acquisition method embodiment, which will not be repeated here.
[0037] like Fig.11 As shown, the present application also provides an electronic device 1100. The electronic device 1100 includes a processor 1101, a memory 1102 and a display 1103. Fig.11 Only some components of the electronic device 1100 are shown, but it should be understood that it is not required to implement all of the components shown, and more or fewer components may be implemented instead.
[0038] In some embodiments, the memory 1102 may be an internal storage unit of the electronic device 1100, such as a hard disk or memory of the electronic device 1100. In other embodiments, the memory 1102 may also be an external storage device of the electronic device 1100, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc., equipped on the electronic device 1100.
[0039] Furthermore, the memory 1102 may include both an internal storage unit of the electronic device 1100 and an external storage device. The memory 1102 is used to store application software installed in the electronic device 1100 and various data.
[0040] In some embodiments, the processor 1101 may be a central processing unit (CPU), a microprocessor or other data processing chip, used to run program codes or process data stored in the memory 1102, such as the method for acquiring local photographing points of a battery pack in the present application.
[0041] In some embodiments, the display 1103 may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, an OLED (Organic Light-Emitting Diode) touch device, etc. The display 1103 is used to display information on the electronic device 1100 and to display a visual user interface. The components 1101-1103 of the electronic device 1100 communicate with each other via a system bus.
[0042] In some embodiments of the present application, when the processor 1101 executes the battery pack local photographing point acquisition program in the memory 1102, the following steps may be implemented: Acquire an original image obtained by photographing the upper cover of the battery pack based on a 2D camera; Extract the maximum peripheral contour from the original image and determine the maximum contour image; Based on the equidistant point sampling algorithm, local photographing points are extracted from the maximum contour image. The local photographing points are the positions where the camera takes a local photograph of the upper cover of the battery pack.
[0043] It should be understood that: when the processor 1101 executes the battery pack local photo point acquisition program in the memory 1102, in addition to the above functions, other functions can also be implemented. For details, please refer to the description of the corresponding method embodiment above.
[0044] Furthermore, the embodiment of the present application does not specifically limit the type of the electronic device 1100 mentioned, and the electronic device 1100 may be a portable electronic device such as a mobile phone, a tablet computer, a personal digital assistant (PDA), a wearable device, a laptop computer, etc. Exemplary embodiments of portable electronic devices include but are not limited to portable electronic devices equipped with IOS, Android, Microsoft or other operating systems. The above-mentioned portable electronic devices may also be other portable electronic devices, such as a laptop computer with a touch-sensitive surface (e.g., a touch panel). It should also be understood that in some other embodiments of the present application, the electronic device 1100 may not be a portable electronic device, but a desktop computer with a touch-sensitive surface (e.g., a touch panel).
[0045] Accordingly, an embodiment of the present application also provides a computer-readable storage medium, which is used to store computer-readable programs or instructions. When the program or instructions are executed by a processor, the steps or functions of the method for acquiring local photo points of a battery pack provided in the above-mentioned method embodiments can be implemented.
[0046] Those skilled in the art will appreciate that all or part of the processes of the above-mentioned embodiments can be implemented by instructing related hardware through a computer program, and the above-mentioned program can be stored in a computer-readable storage medium, wherein the computer-readable storage medium is a disk, an optical disk, a read-only storage memory, or a random access memory, etc.
[0047] The above is a detailed introduction to a method for acquiring local photo points of a battery pack provided by the present application. Specific examples are used in this article to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea; at the same time, for technical personnel in this field, according to the idea of the present application, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.
[0048] The above are only preferred specific implementations of the present application, but the protection scope of the present application is not limited thereto. Any changes or substitutions that can be easily conceived by any technician familiar with the technical field within the technical scope disclosed in the present application should be covered within the protection scope of the present application.
Claims
1. A method for obtaining local photographing points of a battery pack, characterized in that: include: Acquire an original image obtained by photographing the upper cover of the battery pack based on a 2D camera; Extracting the maximum peripheral contour from the original image to determine a maximum contour image; Based on an equidistant point sampling algorithm, local photographing points are extracted from the maximum contour image, where the local photographing points are positions where a camera takes a local photograph of the upper cover of the battery pack.
2. The method for obtaining local photographing points of a battery pack according to claim 1, characterized in that: Extracting the maximum peripheral contour from the original image to determine the maximum contour image includes: Based on the original image, determining a target image; Performing edge detection on the target image to obtain an initial edge image; Based on the initial edge image, determining a target edge image; The maximum peripheral contour is extracted from the target edge image to obtain a maximum contour image.
3. The method for obtaining local photographing points of a battery pack according to claim 2, characterized in that: Based on the original image, determining a target image includes: grayscale the original image to obtain an intermediate image; Based on the intermediate image, a target image is determined.
4. The method for obtaining local photographing points of a battery pack according to claim 3, characterized in that: Determining a target image based on the intermediate image includes: Gaussian blur processing is performed on the intermediate image to obtain a target image.
5. The method for obtaining local photographing points of a battery pack according to claim 2, characterized in that: Performing edge detection on the target image to obtain an initial edge image includes: Based on the Canny operator algorithm, edge detection is performed on the target image to determine an initial edge image.
6. The method for obtaining local photographing points of a battery pack according to claim 2, characterized in that: Determining a target edge image based on the initial edge image includes: The edge image is expanded and eroded to obtain a target edge image.
7. The method for obtaining local photographing points of a battery pack according to claim 2, characterized in that: Extracting the maximum peripheral contour from the target edge image to obtain a maximum contour image includes: Based on the cv2.findContours function, the maximum outer contour is extracted from the target edge image to obtain a maximum contour image.
8. A device for obtaining local photographic points of a battery pack, characterized in that: include: A 2D image acquisition unit, used to acquire an original image obtained by photographing the upper cover of the battery pack based on a 2D camera; A maximum contour extraction unit, used for extracting the maximum peripheral contour in the original image to obtain a maximum contour image; The local photographing point extraction unit is used to extract the local photographing point from the maximum contour image based on an equidistant point sampling algorithm, wherein the local photographing point is a position point where the camera takes a local photograph of the upper cover of the battery pack.
9. An electronic device, characterized in that: including memory and processor; The memory is used to store programs; The processor is coupled to the memory and is used to execute the program stored in the memory to implement the steps of the method for acquiring local photo points of a battery pack as described in any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: The readable storage medium stores a program or instruction, and when the program or instruction is executed by the processor, the steps of the method for acquiring local photographing points of a battery pack described in any one of claims 1 to 7 are implemented.