Method for determining the pose estimation matrix of a DC charging gun holder and an automatic charging device

By combining adaptive threshold segmentation and edge detection with ellipse fitting, a method is used to identify the conductor hole of the DC charging gun holder using a regular camera. This solves the high cost problem in existing technologies and achieves low-cost, high-precision pose estimation, which is suitable for automatic charging systems with varying lighting conditions and complex scenarios.

CN122492831APending Publication Date: 2026-07-31SHAANXI GREEN ENERGY ELECTRONIC TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
SHAANXI GREEN ENERGY ELECTRONIC TECH CO LTD
Filing Date
2026-07-02
Publication Date
2026-07-31

AI Technical Summary

Technical Problem

Existing automatic charging systems rely on expensive precision sensors and complex algorithms, resulting in high equipment costs and making them difficult to promote in ordinary parking lots and home charging stations.

Method used

An adaptive threshold segmentation and edge detection combined with ellipse fitting method is adopted to acquire DC charging gun holder images through a regular camera, identify conductor holes and calculate pose matrix, thereby reducing hardware cost and computational complexity.

Benefits of technology

It achieves high-precision charging gun seat posture estimation under low-cost hardware and computing power conditions, meets the requirements of automatic plugging and unplugging, and is suitable for variable lighting and complex scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122492831A_ABST
    Figure CN122492831A_ABST
Patent Text Reader

Abstract

This invention relates to the field of automatic charging technology for electric vehicles, specifically to a method for determining the pose estimation matrix of a DC charging gun socket and an automatic charging device. The method for determining the pose estimation matrix of the DC charging gun socket first identifies conductor holes in an image of the DC charging gun socket through adaptive threshold segmentation and edge detection. Then, it uses ellipse fitting to obtain the center image coordinates and pixel radii of two conductor holes. Next, it uses a scaling factor to perform coordinate mapping and circumference fitting to obtain the center image coordinates of the remaining holes. Finally, it performs PNP calculation based on the obtained center image coordinates of multiple charging interfaces to obtain the pose estimation matrix of the DC charging gun socket.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of automatic charging technology for electric vehicles, specifically to a method for determining the pose estimation matrix of a DC charging gun holder and an automatic charging device. Background Technology

[0002] Currently, common automatic charging systems primarily rely on sophisticated sensors such as LiDAR, 3D structured light, time-of-flight (TOF) cameras, or binocular vision to estimate the pose of the charging gun holder. These solutions typically employ 3D reconstruction or depth sensing technologies to acquire high-precision six-degree-of-freedom pose information, thereby enabling reliable automatic plugging and unplugging. However, their drawbacks are equally apparent: the hardware cost of these sophisticated instruments is high, and the resulting point cloud processing, matching, and pose calculation algorithms place significant demands on the platform's computing power. This results in a persistently high overall cost for existing automatic charging equipment, hindering its large-scale deployment and widespread adoption in ordinary parking lots, home charging stations, and other similar scenarios. Summary of the Invention

[0003] The purpose of this application is to provide a method for determining the pose estimation matrix of a DC charging gun holder and an automatic charging device, so as to solve the above-mentioned defects of the prior art as described in the background art.

[0004] To achieve the above objectives, the first aspect of the present invention provides a method for determining the pose estimation matrix of a DC charging gun holder, the method comprising: Acquire an image of the DC charging gun socket corresponding to the target vehicle; wherein each charging interface of the DC charging gun socket is provided with a conductor terminal; Adaptive threshold segmentation is performed on the image of the DC charging gun holder to separate the conductor hole corresponding to the conductor terminal from the charging gun holder and obtain the corresponding binary image; Edge detection is performed based on the grayscale image corresponding to the image of the DC charging gun holder to extract the edge contours of multiple conductor holes; Ellipse fitting is performed on the conductor holes corresponding to the jacks DC+ and DC- in the binary image to determine the image coordinates and pixel radius of the center of the circle corresponding to the jacks DC+ and DC-. Based on the center image coordinates, center spatial coordinates, physical radius, and pixel radius corresponding to the socket DC+ and the socket DC-, the scaling factor is determined. Based on the center image coordinates and center spatial coordinates corresponding to the DC+ and DC- sockets, the center spatial coordinates and physical radius of the remaining sockets in the DC charging socket, and the scaling factor, the center image coordinates and pixel radius of the remaining sockets are determined. Based on the center image coordinates and pixel radius of the remaining sockets, a circular fit is performed on the remaining sockets, and the center image coordinates of the remaining sockets are corrected and updated according to the fitting result; and Based on the image coordinates and spatial coordinates of the center of the multiple sockets in the DC charging gun socket, the pose estimation matrix of the DC charging gun socket is determined.

[0005] Preferably, the step of performing adaptive threshold segmentation on the image of the DC charging gun holder to separate the conductor hole corresponding to the conductor terminal from the charging gun holder and obtain the corresponding binary image includes: Convert the image of the DC charging gun holder into a corresponding grayscale image; For each pixel in the grayscale image: The dynamic threshold is determined based on the gray-level statistical characteristics of the local neighborhood of the pixel and a preset constant value; and When the value of a pixel is greater than the dynamic threshold, a white foreground is output; when the value of a pixel is less than the dynamic threshold, a black background is output.

[0006] Preferably, for each pixel in the grayscale image, determining the dynamic threshold based on the grayscale statistical features of the pixel's local neighborhood and a preset constant value includes: When the ratio of foreground to background in the local neighborhood of a pixel is greater than a corresponding preset threshold, the dynamic threshold is increased accordingly; and When the ratio of the foreground to the background in the local neighborhood of a pixel is less than the corresponding preset threshold, the dynamic threshold is reduced accordingly.

[0007] Preferably, the step of performing ellipse fitting based on the conductor holes corresponding to the jacks DC+ and DC- in the binary image to determine the center image coordinates and pixel radius of the circles corresponding to the jacks DC+ and DC- includes: For the conductor hole corresponding to socket DC+ or socket DC-, perform the following operations: Using the centroid corresponding to the conductor hole as the initial center, multiple rays are drawn out from the initial center at preset intervals. For each ray: the foreground and background pixel boundary points closest to the initial center are taken as the target boundary points corresponding to that ray; and Ellipse fitting is performed based on multiple target critical points to determine the center image coordinates and pixel radius of the socket corresponding to the conductor hole.

[0008] Preferably, determining the pose estimation matrix of the DC charging gun holder based on the image coordinates and spatial coordinates of the center points of multiple sockets in the DC charging gun holder includes: At least four pairs of points are selected, consisting of the image coordinates and spatial coordinates of the center of the socket, and PNP calculation is performed to obtain the pose estimation matrix of the DC charging gun holder; wherein the centers of the circles corresponding to the image coordinates of the center participating in the PNP calculation are not collinear.

[0009] Preferably, the pose estimation matrix of the DC charging gun holder includes: the translation and rotation orientation of the DC charging gun holder in three-dimensional space.

[0010] A second aspect of the present invention provides an automatic charging device, comprising: a robotic arm for carrying a charging gun head for movement; The image acquisition module is used to acquire images of the DC charging gun socket corresponding to the target vehicle; The processing module is configured to determine the pose estimation matrix of the DC charging gun holder based on the image of the DC charging gun holder, using the method for determining the pose estimation matrix of the DC charging gun holder; and Based on the pose estimation matrix of the DC charging gun holder, the movement of the robotic arm is controlled to connect the charging gun head to the charging gun holder.

[0011] A third aspect of the present invention provides a machine-readable storage medium storing instructions for causing a machine to perform the method for determining the pose estimation matrix of the DC charging gun holder. Attached Figure Description

[0012] The accompanying drawings are provided to further illustrate embodiments of the present invention and form part of the specification. They are used together with the following detailed description to explain the embodiments of the present invention, but do not constitute a limitation thereof. In the drawings: Figure 1 A flowchart illustrating the method for determining the pose estimation matrix of a DC charging gun holder provided by the present invention is shown. Figure 2 A schematic diagram of the DC charging gun holder provided by the present invention is shown. Detailed Implementation

[0013] To better understand the above-mentioned objectives, features, and advantages of the present invention, the present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments. It should be noted that, unless otherwise specified, the embodiments and features described in these embodiments can be combined with each other.

[0014] Many specific details are set forth in the following description in order to provide a full understanding of the invention. However, the invention may also be practiced in other ways different from those described herein, and therefore the scope of protection of the invention is not limited to the specific embodiments disclosed below.

[0015] Figure 1 A flowchart illustrating the method for determining the pose estimation matrix of a DC charging gun holder provided by the present invention is shown, as follows: Figure 1 As shown, this invention discloses a method for determining the pose estimation matrix of a DC charging gun holder, which may include the following steps S101~S108: S101. Obtain an image of the DC charging gun socket corresponding to the target vehicle; Observation reveals that the DC charging gun socket consists of nine circular charging ports, each with a metal conductor terminal in the center.

[0016] For example, the high-voltage, high-current metal conductors inside the DC+ and DC- sockets are used to transmit electrical energy; the metal conductor inside the PE socket is used for grounding protection and connecting to the vehicle chassis. These three sockets are the largest in radius among the nine holes of the DC charging gun socket.

[0017] The sockets CC1 and CC2 contain small metal pins for detecting whether the gun head is fully inserted; The A+ and A- sockets contain internal metal conductors that supply power to the vehicle's battery management system (BMS).

[0018] The S+ and S- sockets contain internal metal conductors and are used for communication between the charging station and the vehicle's battery management system (BMS).

[0019] It should also be noted that electric vehicle charging scenarios are diverse and complex, including open spaces, bright light, underground parking lots, and nighttime. Therefore, capturing images of DC charging gun holders may involve complex and variable lighting conditions, with both excessively strong and insufficient light potentially occurring simultaneously. To address this, this invention adjusts the exposure parameters when a supplementary light is available, resulting in a shorter camera exposure time and a higher exposure gain. This ensures a more constant light level entering the camera, resulting in relatively stable images with minimal variation between 100,000 lux of strong light and 1,000 lux of supplementary light illumination. This significantly enhances the stability against noise and interference in subsequent image processing, providing a more reliable data foundation for later processing steps.

[0020] In the implementation of this invention, an ordinary 2D camera, such as a conventional CMOS camera, can be used to capture images of the charging gun socket set on the car to be charged, which is low cost.

[0021] S102. Perform adaptive threshold segmentation on the image of the DC charging gun holder, separate the conductor hole corresponding to the conductor terminal from the charging gun holder, and obtain the corresponding binary image. It is understandable that the metal conductor terminal in the charging socket appears as a silver-white circular conductor hole in the image of the DC charging gun holder, clearly distinguishable from the surrounding black charging gun holder. Therefore, binarizing the image of the DC charging gun holder can effectively separate the foreground (conductor hole) from the background area (charging gun holder), that is, to separate the silver-white conductor hole from the black charging gun holder, obtaining the corresponding binary image. In this binary image, the conductor hole region is a white connected region, and its boundary is the edge of the conductor hole. By extracting the contour of these white regions, the boundary point set of the conductor hole can be directly obtained, so as to further fit the center of the conductor hole in subsequent steps.

[0022] It should be noted that, since the center reflection of the conductors of the DC+ and DC- sockets of the DC charging gun holder is relatively obvious, the binarized image can segment the conductor hole areas of the DC+ and DC- sockets relatively completely. However, the other conductor holes cannot achieve the same result. The edges and centers of DC+ and DC- can be effectively extracted through the foreground areas of DC+ and DC-. However, only two centers are not enough to perform PNP calculation to obtain the pose of the DC charging holder. Therefore, more conductor hole center coordinates are needed.

[0023] In this embodiment of the invention, the step of performing adaptive threshold segmentation on the image of the DC charging gun holder to separate the conductor hole corresponding to the conductor terminal from the charging gun holder and obtain the corresponding binary image includes the following steps S201~S202: S201. Convert the image of the DC charging gun holder into a corresponding grayscale image; S202. Traverse each pixel in the grayscale image, and for each pixel in the image of the DC charging gun holder: perform the following steps S301~S302: S301. Determine the dynamic threshold based on the gray-scale statistical characteristics of the local neighborhood of the pixel and a preset constant value. Specifically, for example, in pixels Delineate a center or A window of pixels can be calculated using the mean method to determine the average value of all pixels within the window. ,according to and constant The difference is used to obtain the dynamic threshold. Among them, constants Used to fine-tune dynamic threshold General constants The larger the value, the more black areas are obtained in the binary image.

[0024] The dynamic threshold can also be calculated using the Gaussian weighted mean method, median method, variance or range method.

[0025] Furthermore, after initially obtaining the dynamic threshold according to the above steps, the dynamic threshold is finely adjusted according to steps S401~S403: S401. Calculate the ratio of foreground to background in the local neighborhood of the pixel; S402. When the ratio of the foreground to the background in the local neighborhood of the pixel is greater than the corresponding preset threshold, the dynamic threshold is increased accordingly. S403. When the ratio of the foreground to the background in the local neighborhood of the pixel is less than the corresponding preset threshold, the dynamic threshold is reduced accordingly.

[0026] It is understandable that the above processing steps can further and effectively reduce the impact of lighting conditions on the algorithm and accurately locate the position of the conductor hole.

[0027] S302. When the value of the pixel is greater than the dynamic threshold, output a white foreground; when the value of the pixel is less than the dynamic threshold, output a black background.

[0028] S103. Perform edge detection based on the grayscale image corresponding to the image of the DC charging gun holder, and extract the edge contours of multiple conductor holes; Specifically, Canny edge detection can be used to extract multiple edge contours of multiple conductor holes. Then, each contour is traversed, and contours within a reasonable range are selected based on the prior geometric positional relationship of the corresponding holes. Finally, the extracted contours provide data for ellipse fitting in subsequent steps.

[0029] It should also be noted that, due to factors such as noise, shadows, and lighting during image capture, the edge contour of the conductor hole may be broken or have multiple interfering edge points, which means that relying solely on edge detection cannot accurately extract the edge of the conductor hole. Therefore, the ellipse fitting step in step S104 also needs to be performed.

[0030] S104. Based on the conductor holes corresponding to the jack DC+ and jack DC- on the binary image, perform ellipse fitting to determine the center image coordinates and pixel radius of the circles corresponding to the jack DC+ and jack DC-. In this embodiment of the invention, the specific implementation process of step S104 includes: for the conductor hole corresponding to socket DC+ or socket DC-: performing the following processing steps S501~S503: S501. Using the centroid corresponding to the conductor hole as the initial center, draw out multiple rays from the initial center at preset intervals. Considering that the main object to be detected in this invention is a circle, polar coordinates are used to represent the circle, the preset interval angle is set to 3°, and the centroid is the geometric center of the white connected domain corresponding to the conductor hole area.

[0031] S502. For each ray: the foreground and background pixel boundary points closest to the initial center are taken as the target boundary points corresponding to the ray. S503. Perform ellipse fitting based on multiple target critical points to determine the center image coordinates and pixel radius of the socket corresponding to the conductor hole.

[0032] Specifically, multiple target critical points corresponding to multiple rays constitute multiple contour points for ellipse fitting. Based on the multiple target critical points obtained in step S502, the center and radius of the circle can be obtained relatively accurately using the OpenCV functions minEnclosingCircle (minimum circumcircle) or fitEllipse (ellipse fitting). The center is continuously moved within a certain range, and ellipse fitting is repeatedly performed. The ellipse whose aspect ratio and size best meet the requirements is found; this is the ellipse we need for fitting, and its center and radius are output.

[0033] S105. Based on the center image coordinates, center spatial coordinates, physical radius, and pixel radius corresponding to the socket DC+ and the socket DC-, determine the scaling factor; In this embodiment of the invention, reference is made to Figure 2 The conductor holes corresponding to the conductor terminals of jacks DC+ and DC- have the largest areas, are the most prominent in the image, have the most stable features, and are easy to threshold segmentation and edge detection; they have high contrast and strong anti-interference ability; they are spatially symmetrical, which facilitates rapid positioning and attitude verification.

[0034] Furthermore, based on the image coordinates of the center points A and B of jack DC+ and jack DC- respectively, the pixel distance between center points A and B on the image can be determined. ; Based on the pixel distance between the center A and the center B of the circle on the image The distance in the world coordinate system is known. And the following formula determines the pixel distance. and actual physical distance proportion : ; Based on the pixel radius of the DC+ socket Physical radius And the following formula determines the pixel radius. and physical radius proportion : ; According to the pixel radius of the jack DC- Physical radius And the following formula determines the pixel radius. and physical radius proportion : ; according to , , The corresponding average value is used to determine the target proportional coefficient.

[0035] S106. Based on the center image coordinates and center spatial coordinates corresponding to the socket DC+ and the socket DC-, the center spatial coordinates and physical radius of the other sockets in the DC charging socket, and the scaling factor, determine the center image coordinates and pixel radius of the other sockets. In this embodiment of the invention, the coordinates of the center images of the remaining holes can be obtained by using the scaling factor in the above steps for coordinate mapping.

[0036] Furthermore, either socket DC+ or socket DC- can be used. For reference, calculate the value of any one of the remaining sockets. Center image coordinates and pixel radius Let's take an example to illustrate this in detail.

[0037] According to the proportionality coefficient Socket Corresponding: Center image coordinates and the center space coordinates Socket Corresponding: Spatial coordinates of the center of the circle and physical radius The socket is calculated using the following formula. Corresponding circle center image coordinates and pixel radius : S107. Based on the center image coordinates and pixel radius of the remaining sockets, perform circumferential fitting on the remaining sockets, and correct and update the center image coordinates of the remaining sockets according to the fitting results. It is understood that the center image coordinates of the remaining sockets obtained through step S106 are relatively coarse. They can be further fitted again using least squares circle fitting based on edge points or Hough circle transformation, and the fitted center coordinates and radius can be used as the final center image coordinates and radius of the remaining sockets.

[0038] The least-squares circle fitting based on edge points is as follows: First, extract local edge points: extract edge points using Canny within the neighborhood annular band around the coarse center and the radius (i.e., the center image coordinates and radius obtained in step S106); then filter effective points: retain edge points whose distance from the coarse center is within the radius tolerance range; next, perform least-squares fitting: substitute the filtered points into the least-squares circle algorithm to solve for the center and radius that minimize the sum of squared errors; finally, output the precise center: obtain the center coordinates with sub-pixel accuracy.

[0039] S108. Based on the center image coordinates and spatial coordinates of multiple sockets in the DC charging gun holder, determine the pose estimation matrix of the DC charging gun holder.

[0040] In this embodiment of the invention, determining the pose estimation matrix of the DC charging gun holder based on the image coordinates and spatial coordinates of the center points of multiple sockets in the DC charging gun holder includes: At least four pairs of points are selected, consisting of the image coordinates and spatial coordinates of the center of the socket, and PNP (Perspective-n-Point) calculation is performed to obtain the pose estimation matrix of the DC charging gun holder; wherein the center of the circle corresponding to the image coordinates of the center participating in the PNP calculation is not collinear.

[0041] It should also be noted that, considering that the world coordinates of jack CC2 are slightly different in the old and new national standards, if the center point pair of PNP calculation includes the center of jack CC2, then the inverse mapping operation is performed according to the calculated pose estimation matrix and the world coordinates of the old and new national standards respectively. The difference operation is performed according to the calculated image coordinates and the actual image coordinates, and the one with the smaller error is selected as the actual pose estimation matrix.

[0042] The pose estimation matrix of the DC charging gun holder includes the translation and rotation orientation of the DC charging gun holder in three-dimensional space.

[0043] Through multiple experimental tests, the method for determining the pose estimation matrix of the DC charging gun holder provided in this application has good accuracy, low computational load, and high robustness under different illumination, angle, and distance conditions. It can stably complete the gun insertion action with an accuracy deviation within ±0.5mm and 1°, meeting the gun insertion requirements.

[0044] The present invention also provides an automatic charging device, comprising: a robotic arm for carrying a charging gun head for movement; The image acquisition module is used to acquire images of the DC charging gun socket corresponding to the target vehicle; The processing module is configured to determine the pose estimation matrix of the DC charging gun holder based on the image of the DC charging gun holder, using the method for determining the pose estimation matrix of the DC charging gun holder; and Based on the pose estimation matrix of the DC charging gun holder, the movement of the robotic arm is controlled to connect the charging gun head to the charging gun holder.

[0045] The present invention also provides a machine-readable storage medium storing instructions for causing a machine to execute the method for determining the pose estimation matrix of the DC charging gun holder.

[0046] The method for determining the pose estimation matrix of a DC charging gun socket provided by this invention first identifies conductor holes in an image of the DC charging gun socket through adaptive threshold segmentation and edge detection. Then, ellipse fitting is used to obtain the image coordinates and pixel radii of the center points of two conductor holes. Next, coordinate mapping and circumference fitting are performed using scaling factors to obtain the image coordinates of the center points of the remaining holes. Finally, PNP calculation is performed based on the obtained image coordinates of the center points of multiple charging ports to obtain the pose estimation matrix of the DC charging gun socket. This method has significant advantages in both computational power consumption and hardware cost. On the one hand, the algorithm is based on 2D vision and conventional image processing operations, with low computational load, and can run in real time on low-performance embedded devices. On the other hand, it only requires a common CMOS camera, without the need for additional expensive sensors. Therefore, this method is easy to replicate and deploy in different scenarios, and has good promotional significance and engineering application prospects.

[0047] The optional embodiments of the present invention have been described in detail above with reference to the accompanying drawings. However, the embodiments of the present invention are not limited to the specific details in the above embodiments. Within the scope of the technical concept of the embodiments of the present invention, various simple modifications can be made to the technical solutions of the embodiments of the present invention, and these simple modifications all fall within the protection scope of the embodiments of the present invention.

[0048] It should also be noted that the various specific technical features described in the above embodiments can be combined in any suitable manner without contradiction. To avoid unnecessary repetition, the embodiments of the present invention will not describe the various possible combinations separately.

[0049] Those skilled in the art will understand that all or part of the steps in the methods of the above embodiments can be implemented by a program instructing related hardware. This program is stored in a storage medium and includes several instructions to cause a microcontroller, chip, or processor to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes: a USB flash drive, a portable hard drive, and a read-only memory (ROM). Various media that can store program code, such as only memory, random access memory (RAM), magnetic disks or optical disks.

[0050] Furthermore, various different implementations of the present invention can be combined arbitrarily, as long as they do not violate the spirit of the present invention, they should also be regarded as the content disclosed in the present invention.

Claims

1. A method for determining the pose estimation matrix of a DC charging gun holder, characterized in that, The method includes: Acquire an image of the DC charging gun socket corresponding to the target vehicle; wherein each charging interface of the DC charging gun socket is provided with a conductor terminal; Adaptive threshold segmentation is performed on the image of the DC charging gun holder to separate the conductor hole corresponding to the conductor terminal from the charging gun holder and obtain the corresponding binary image; Edge detection is performed based on the grayscale image corresponding to the image of the DC charging gun holder to extract the edge contours of multiple conductor holes; Ellipse fitting is performed on the conductor holes corresponding to the jacks DC+ and DC- in the binary image to determine the image coordinates and pixel radius of the center of the circle corresponding to the jacks DC+ and DC-. Based on the center image coordinates, center spatial coordinates, physical radius, and pixel radius corresponding to the socket DC+ and the socket DC-, the scaling factor is determined. Based on the center image coordinates and center spatial coordinates corresponding to the DC+ and DC- sockets, the center spatial coordinates and physical radius of the remaining sockets in the DC charging socket, and the scaling factor, the center image coordinates and pixel radius of the remaining sockets are determined. Based on the center image coordinates and pixel radius of the remaining sockets, a circular fit is performed on the remaining sockets, and the center image coordinates of the remaining sockets are corrected and updated according to the fitting result; and Based on the image coordinates and spatial coordinates of the center of the multiple sockets in the DC charging gun socket, the pose estimation matrix of the DC charging gun socket is determined.

2. The method according to claim 1, characterized in that, The step of performing adaptive threshold segmentation on the image of the DC charging gun holder to separate the conductor hole corresponding to the conductor terminal from the charging gun holder and obtain the corresponding binary image includes: Convert the image of the DC charging gun holder into a corresponding grayscale image; For each pixel in the grayscale image: The dynamic threshold is determined based on the gray-level statistical characteristics of the local neighborhood of the pixel and a preset constant value; and When the value of a pixel is greater than the dynamic threshold, a white foreground is output; when the value of a pixel is less than the dynamic threshold, a black background is output.

3. The method according to claim 2, characterized in that, For each pixel in the grayscale image: determining the dynamic threshold based on the grayscale statistical features of the pixel's local neighborhood and a preset constant value includes: When the ratio of foreground to background in the local neighborhood of a pixel is greater than a corresponding preset threshold, the dynamic threshold is increased accordingly; and When the ratio of the foreground to the background in the local neighborhood of a pixel is less than the corresponding preset threshold, the dynamic threshold is reduced accordingly.

4. The method according to claim 1, characterized in that, The step of performing ellipse fitting based on the conductor holes corresponding to the jacks DC+ and DC- in the binary image to determine the center image coordinates and pixel radii of the circles corresponding to the jacks DC+ and DC- includes: For the conductor hole corresponding to socket DC+ or socket DC-, perform the following operations: Using the centroid corresponding to the conductor hole as the initial center, multiple rays are drawn out from the initial center at preset intervals. For each ray: the foreground and background pixel boundary points closest to the initial center are taken as the target boundary points corresponding to that ray; and Ellipse fitting is performed based on multiple target critical points to determine the center image coordinates and pixel radius of the socket corresponding to the conductor hole.

5. The method according to claim 1, characterized in that, The step of determining the pose estimation matrix of the DC charging gun holder based on the image coordinates and spatial coordinates of the center of multiple sockets in the DC charging gun holder includes: At least four pairs of points are selected, consisting of the image coordinates and spatial coordinates of the center of the socket, and PNP calculation is performed to obtain the pose estimation matrix of the DC charging gun holder; wherein the centers of the circles corresponding to the image coordinates of the center participating in the PNP calculation are not collinear.

6. The method according to claim 1, characterized in that, The pose estimation matrix of the DC charging gun holder includes the translation and rotation orientation of the DC charging gun holder in three-dimensional space.

7. An automatic charging device, characterized in that, include: A robotic arm used to carry a charging gun head for movement; The image acquisition module is used to acquire images of the DC charging gun socket corresponding to the target vehicle; The processing module is configured to determine the pose estimation matrix of the DC charging gun holder based on the image of the DC charging gun holder, using the method for determining the pose estimation matrix of the DC charging gun holder as described in any one of claims 1-6; and Based on the pose estimation matrix of the DC charging gun holder, the movement of the robotic arm is controlled to connect the charging gun head to the charging gun holder.

8. A machine-readable storage medium, characterized in that, The machine-readable storage medium stores instructions for causing the machine to perform a method for determining the pose estimation matrix of the DC charging gun holder according to any one of claims 1 to 6.