5G antenna pose estimation method and equipment based on machine vision and medium
Through the combination of monocular camera and robotic arm, the pose of 5G antenna is calculated using the YOLOv8 model and triangulation principle, which solves the problems of system complexity and cost in the prior art, and achieves efficient and accurate pose estimation.
Patent Information
- Application Number
- CN202411113530.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-14
- Publication Date
- 2024-11-15
- Estimated Expiration
- 2044-08-14
AI Technical Summary
The existing 5G antenna position estimation method based on machine vision has problems such as high system complexity, high cost and high requirements for ambient lighting and texture, and it is difficult to widely use in actual production environments.
Using a monocular camera combined with a robotic arm, the YOLOv8 model is used to detect the antenna, and the robotic arm base coordinates of the antenna feature points are calculated through feature extraction and triangulation principles, and combined with LM algorithm and SVD decomposition method to optimize position estimation to reduce the system structure and operation volume .
It improves the accuracy and efficiency of 5G antenna position estimation, reduces system complexity and hardware costs, and reduces the dependence on prior knowledge.
Smart Images

Figure CN118967816A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of positioning detection, and specifically to a 5G antenna posture estimation method, device and medium based on machine vision. Background Art
[0002] With the rapid development of 5G communication technology, the test of 5G antenna performance has become particularly critical. In the 5G antenna near-field detection system based on the manipulator, the size and height of the sampling surface need to be set according to the operating frequency and size of the 5G antenna. The position of the sampling surface is determined according to the posture of the 5G antenna, and the position of the sampling surface determines the sampling trajectory of the magnetic field probe at the end of the manipulator. Only when the position and direction of the antenna match the position and direction of the magnetic field probe can the electromagnetic performance of the antenna be accurately measured.
[0003] Machine vision can complete tasks such as object recognition, positioning and measurement without contact, and plays a vital role in the development of today's industrial automation and robotics. Among them, the method based on monocular vision is simple and easy, but it cannot provide the real scale information of the target object; the method based on binocular vision can restore the three-dimensional information of the object, but it has high requirements on ambient lighting and texture, and the stereo matching algorithm is complex; the method based on multi-eye vision can provide more comprehensive perspective information, but it has a large amount of calculation, high cost, and increased system complexity, which is not conducive to its widespread application in actual production environments. Therefore, the above methods all have certain limitations in practical applications. Summary of the invention
[0004] In view of the shortcomings of the prior art, the present invention provides a 5G antenna posture estimation method, device and medium based on machine vision, in order to improve the accuracy and efficiency of antenna posture estimation and reduce system complexity.
[0005] To achieve the above object, the present invention adopts the following technical solutions:
[0006] The present invention provides a 5G antenna posture estimation method based on machine vision, which comprises the following steps:
[0007] S1: When the monocular camera reaches the i-th acquisition point When the monocular camera is used to locate the position of the i-th robot arm Next, collect the i-th antenna image , using the YOLOv8 model Detect the antennas in the ROI to obtain the antenna image of the i-th ROI area , and exist The coordinates of the upper left corner of ;
[0008] S2: Antenna images of the i-1th and ith ROI regions and Perform feature extraction and feature matching to obtain non-collinear 5G antenna feature points exist and The corresponding pixel pairs , ;in, represents the jth 5G antenna feature point; express exist The coordinates on express exist The coordinates on the ; m represents the total number of feature points, m ≥ 3; and represents the j-th pixel pair;
[0009] S3: Use formula (1) to calculate the m pixel pairs respectively in The pixel coordinates in , ,in, express exist The coordinates on express exist Coordinates on:
[0010] (1)
[0011] In formula (1), express In the i-1th antenna image The upper left corner coordinates of ;
[0012] S4: Based on the principle of triangulation, use formula (2) to calculate the jth 5G antenna feature point Coordinates in the robot base coordinate system :
[0013] (2)
[0014] In formula (2), is the intrinsic parameter matrix of the monocular camera and is obtained through camera calibration; , They are the rotation matrix and translation vector of the camera coordinate system relative to the robot base coordinate system when the monocular camera takes the i-th photo, and are obtained through coordinate transformation; , They are the rotation matrix and translation vector of the camera coordinate system relative to the robot base coordinate system when the monocular camera takes the i-1th photo, and are obtained through coordinate transformation; Indicates that the monocular camera is The collection point when taking the photo arrive The depth value of Indicates that the monocular camera is The collection point when taking the photo arrive The depth value of
[0015] S5: Use the LM algorithm to iteratively optimize the objective function shown in formula (3), use the calculation result of S4 as the initial value of the LM algorithm, and solve the j-th 5G antenna feature point Optimal coordinates in the robot base coordinate system ;
[0016] (3)
[0017] In formula (3), express and The relocation error between
[0018] S6: Fitting the optimal coordinate set using SVD decomposition Get the normal vector of the antenna plane ; Where T represents transpose;
[0019] S7: The direction of the normal vector of the antenna plane is the antenna coordinate system. The axis direction vector is denoted by ; Select a vector direction on the antenna plane as the antenna coordinate system The axis direction vector is denoted by ; By calculation Axis direction vector and The cross product of the axis direction vector is The axis direction vector is denoted by ;
[0020] S8: Use equation (4) to get the transformation matrix of the antenna coordinate system relative to the robot base coordinate system , that is and The position of the middle antenna:
[0021] (4)
[0022] In formula (4), is the rotation matrix of the antenna coordinate system relative to the robot base coordinate system, is the translation vector of the antenna coordinate system relative to the robot base coordinate system.
[0023] The 5G antenna posture estimation method based on machine vision described in the present invention is also characterized in that the relocation error in S5 It is obtained by following the steps below:
[0024] A: Calculate using formula (5) and The actual distance between :
[0025] (5)
[0026] B: According to the cosine theorem, use formula (6) to calculate and Relocation distance between :
[0027] (6)
[0028] C: According to the actual distance , Relocation distance , we get the relocation error of formula (7): :
[0029] (7).
[0030] In S8, the rotation matrix is calculated using formula (8): :
[0031] (8)
[0032] In S8, a fixed point on the 5G antenna is selected as the origin of the antenna coordinate system, and the coordinate of the origin in the robot base coordinate system is marked as the translation vector .
[0033] An electronic device of the present invention is characterized in that it includes: a memory for storing a computer program; and a processor for implementing the 5G antenna posture estimation method based on machine vision when executing the computer program.
[0034] A computer-readable storage medium of the present invention is characterized in that a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the 5G antenna posture estimation method based on machine vision is implemented.
[0035] Compared with the prior art, the present invention has the following advantages:
[0036] 1. The present invention adopts a combination of a robotic arm and a triangulation method, using a robotic arm with a monocular camera to capture images at different viewing angles, effectively replacing the traditional binocular or multi-camera system, simplifying the system structure, reducing the amount of calculation, and also reducing the hardware cost.
[0037] 2. The present invention is easy to implement. While the robotic arm carries a probe to perform the task of detecting the radiation performance of the 5G antenna, it can calculate the posture of the 5G antenna to be tested, and optimize the calculated posture result based on the robotic arm posture information, thereby improving the accuracy of posture estimation.
[0038] 3. The present invention estimates the posture of the 5G antenna to be measured by analyzing the camera image and the posture information of the end of the robotic arm, without relying on prior posture information, thus reducing the system's dependence on prior knowledge. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] Figure 1 It is a schematic diagram of the overall structure of the system involved in the present invention;
[0040] Figure 2 It is a flow chart of the pose estimation method of the present invention;
[0041] Figure 3 A schematic diagram of a triangulation method in an embodiment of the present invention;
[0042] Numbers in the figure: 1 monocular camera; 2 robotic arm; 3 robotic arm base; 4 human-computer interaction unit; 5 control unit; 6 5G antenna to be tested; 7 stage. DETAILED DESCRIPTION
[0043] In this embodiment, Figure 1 As shown, a 5G antenna posture estimation device based on machine vision includes: a monocular camera 1, a robotic arm 2, a robotic arm base 3, a human-machine interaction unit 4, a control unit 5, a 5G antenna to be tested 6, and a stage 7. Among them, the monocular camera 1 is installed at the end of the robotic arm 2 in the manner of an eye on a hand, and the optical axis direction of the monocular camera 1 is the same as the Z-axis direction of the end of the robotic arm 2; the robotic arm 2 carries the monocular camera 1 to the image acquisition position to perform the image acquisition task; the human-machine interaction unit 4 is used to monitor the system operation status; the control unit 5 is used to send instructions and process data; the 5G antenna to be tested 6 is placed on the stage 7. In this embodiment, the robotic arm is a 6-DOF robotic arm, and the 5G antenna to be tested is a rectangular PCB board-mounted antenna.
[0044] In this embodiment, Figure 2 As shown, a 5G antenna posture estimation method based on machine vision includes the following steps:
[0045] S1: When the monocular camera reaches the i-th acquisition point When the monocular camera is used to locate the position of the i-th robot arm Next, collect the i-th antenna image , using the YOLOv8 model Detect the antennas in the ROI to obtain the antenna image of the i-th ROI area , and exist The coordinates of the upper left corner of ;
[0046] In this embodiment, before performing S1, the following preparations need to be completed, including:
[0047] (A) Training the antenna detection model. The process is as follows: Use the device to control the robotic arm carrying the monocular camera to collect 60 5G antenna images from different perspectives, and use the labelme tool to annotate the antenna area of each image in the dataset. Randomly select 48 antenna images from the dataset as the training set, and the remaining 12 antenna images as the test set. Input the images of the training set and their corresponding labels into the YOLOv8 target detection algorithm for training. After the training is completed, the model is applied to the test set, and the parameters are optimized according to the test results to obtain the 5G antenna detection model.
[0048] (B) Use the checkerboard calibration method to calibrate the monocular camera and obtain the monocular camera intrinsic parameter matrix as shown in formula (1): , the expression is:
[0049] (1)
[0050] In formula (1), and are the normalized focal lengths on the u-axis and v-axis of the camera image coordinate system, respectively. is the focal length of the camera, and Respectively represent the size of the unit pixel in the camera image coordinate system, in units of , and Represents the optical center of the camera, which is the intersection of the camera optical axis and the image plane.
[0051] (C) Use the Tsai method to calibrate the hand-eye of the robot-camera system and obtain the hand-eye matrix shown in formula (2): :
[0052] (2)
[0053] in, , Respectively represent the shooting When the image is taken, the rotation matrix and translation vector of the camera coordinate system relative to the coordinate system of the robot end.
[0054] S2: Antenna images of the i-1th and ith ROI regions and Perform feature extraction and feature matching. Specifically, and Grayscale, Gaussian filtering, and binarization are performed, and the corner points and surface solder joints of the antenna are selected as antenna feature points. The Shi-Tomas method is used to detect corner points of the ROI image, and the SIFT descriptor of each corner point is calculated. The Brute-Force method is then used to match the feature points to obtain non-collinear 5G antenna feature points. exist and The corresponding pixel pairs , ;in, represents the jth 5G antenna feature point; express exist The coordinates on express exist The coordinates on the ; m represents the total number of feature points, m ≥ 3; and represents the j-th pixel pair;
[0055] S3: Use formula (3) to calculate the m pixel pairs respectively in The pixel coordinates in , ,in, express exist The coordinates on express exist Coordinates on:
[0056] (3)
[0057] In formula (3), express In the i-1th antenna image The upper left corner coordinates of ;
[0058] S4: Figure 3 As shown, based on the principle of triangulation, the jth 5G antenna feature point is calculated using formula (4) Coordinates in the robot base coordinate system :
[0059] (4)
[0060] In formula (4), , They are the rotation matrix and translation vector of the camera coordinate system relative to the robot base coordinate system when the monocular camera takes the i-th photo, and are obtained through coordinate transformation; , They are the rotation matrix and translation vector of the camera coordinate system relative to the robot base coordinate system when the monocular camera takes the i-1th photo, and are obtained through coordinate transformation; Indicates that the monocular camera is The collection point when taking the photo arrive The depth value of Indicates that the monocular camera is The collection point when taking the photo arrive The depth value of
[0061] In this embodiment, the rotation matrix of the camera coordinate system relative to the robot base coordinate system is calculated using equation (5): and translation vectors :
[0062] (5)
[0063] In formula (5), It represents the transformation matrix of the camera coordinate system relative to the robot base coordinate system when taking the i-th photo.
[0064] S5: Use the LM algorithm to iteratively optimize the objective function shown in equation (6), use the calculation result of S4 as the initial value of the LM algorithm, and solve the j-th 5G antenna feature point Optimal coordinates in the robot base coordinate system ;
[0065] (6)
[0066] In formula (6), express and The relocation error between is calculated by formula (7):
[0067] (7)
[0068] In this embodiment, the maximum number of iterations of the LM optimization algorithm is set to 500, and the step size is When the algorithm is executed to the maximum number of iterations or the step size is less than the given accuracy, it is considered that the optimization process has reached the optimal state, and the iteration is stopped. The optimization result is used as the optimal coordinate of the j-th 5G antenna feature point in the robot base coordinate system.
[0069] S6: Fitting the optimal coordinate set using SVD decomposition Get the normal vector of the antenna plane ; Where T represents transpose;
[0070] S7: The 5G antenna to be tested in this embodiment is a rectangular PCB onboard antenna. When constructing the antenna coordinate system, the direction of the normal vector of the antenna plane is taken as the antenna coordinate system. The axis direction vector is denoted by ; Select the optimal coordinates of the upper left corner point on the antenna plane The optimal coordinates of the lower left corner point The direction of the antenna coordinate system The axis direction vector is denoted by ; By calculating Axis direction vector and The cross product of the axis direction vector is The axis direction vector is denoted by ;
[0071] S8: Calculate the rotation matrix of the antenna coordinate system relative to the robot base coordinate system using equation (8): :
[0072] (8)
[0073] Select the optimal coordinates of the upper left corner of the 5G antenna to be tested The origin of the antenna coordinate system is denoted by the coordinate of the origin in the robot base coordinate system as the translation vector of the antenna coordinate system relative to the robot base coordinate system. Using equation (9), we can get the transformation matrix of the antenna coordinate system relative to the manipulator base coordinate system: , that is and The position of the middle antenna:
[0074] (9)
[0075] In this embodiment, an electronic device includes: a memory for storing a computer program for executing the above method; and a processor for executing the program stored in the memory.
[0076] In this embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the above method is implemented.
Claims
1. A 5G antenna posture estimation method based on machine vision, characterized in that: The following steps are involved: S1: When the monocular camera reaches the i-th acquisition point When the monocular camera is used to locate the position of the i-th robot arm Next, collect the i-th antenna image , using the YOLOv8 model Detect the antennas in the ROI to obtain the antenna image of the i-th ROI area , and exist The coordinates of the upper left corner of ; S2: Antenna images of the i-1th and ith ROI regions and Perform feature extraction and feature matching to obtain non-collinear 5G antenna feature points exist and The corresponding pixel pairs , ;in, represents the jth 5G antenna feature point; express exist The coordinates on express exist The coordinates on the ; m represents the total number of feature points, m ≥ 3; and represents the jth pixel pair; S3: Use formula (1) to calculate the m pixel pairs respectively in The pixel coordinates in , ,in, express exist The coordinates on express exist Coordinates on: (1) In formula (1), express In the i-1th antenna image The upper left corner coordinates of ; S4: Based on the principle of triangulation, use formula (2) to calculate the jth 5G antenna feature point Coordinates in the robot base coordinate system : (2) In formula (2), is the intrinsic parameter matrix of the monocular camera and is obtained through camera calibration; , They are the rotation matrix and translation vector of the camera coordinate system relative to the robot base coordinate system when the monocular camera takes the i-th photo, and are obtained through coordinate transformation; , They are the rotation matrix and translation vector of the camera coordinate system relative to the robot base coordinate system when the monocular camera takes the i-1th photo, and are obtained through coordinate transformation; Indicates that the monocular camera is The collection point when taking the photo arrive The depth value of Indicates that the monocular camera is The collection point when taking the photo arrive The depth value of S5: Use the LM algorithm to iteratively optimize the objective function shown in formula (3), use the calculation result of S4 as the initial value of the LM algorithm, and solve the j-th 5G antenna feature point Optimal coordinates in the robot base coordinate system ; (3) In formula (3), express and The relocation error between S6: Fitting the optimal coordinate set using SVD decomposition Get the normal vector of the antenna plane ; Where T represents transpose; S7: The direction of the normal vector of the antenna plane is the antenna coordinate system. The axis direction vector is denoted by ; Select a vector direction on the antenna plane as the antenna coordinate system The axis direction vector is denoted by ; By calculating Axis direction vector and The cross product of the axis direction vector is The axis direction vector is denoted by ; S8: Use equation (4) to get the transformation matrix of the antenna coordinate system relative to the robot base coordinate system , that is and The position of the middle antenna: (4) In formula (4), is the rotation matrix of the antenna coordinate system relative to the robot base coordinate system, is the translation vector of the antenna coordinate system relative to the robot base coordinate system.
2. According to a 5G antenna posture estimation method based on machine vision according to claim 1, it is characterized in that: The relocation error in S5 It is obtained by following the steps below: A: Calculate using formula (5) and The actual distance between : (5) B: According to the cosine theorem, use formula (6) to calculate and Relocation distance between : (6) C: According to the actual distance , Relocation distance , we get the relocation error of formula (7): : (7)。 3. According to a 5G antenna posture estimation method based on machine vision according to claim 1, it is characterized in that: In S8, the rotation matrix is calculated using formula (8): : (8)。 4. According to a 5G antenna posture estimation method based on machine vision according to claim 1, it is characterized in that: In S8, a fixed point on the 5G antenna is selected as the origin of the antenna coordinate system, and the coordinate of the origin in the robot base coordinate system is marked as the translation vector .
5. An electronic device, characterized in that: include: Memory for storing computer programs; A processor, configured to implement a machine vision-based 5G antenna pose estimation method as described in any one of claims 1 to 4 when executing the computer program.
6. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the machine vision-based 5G antenna posture estimation method as described in any one of claims 1 to 4 is implemented.
Citation Information
Patent Citations
Dynamic target position and attitude measurement method based on monocular vision at tail end of mechanical arm
CN103759716A
Automatic detection device and method for communication base station antenna poses
CN107121125A
Method for automatically inspecting communication base station by unmanned aerial vehicle
CN116560395A
Monocular vision space cooperative target pose measurement method
CN117808880A
Monocular vision tracking method, apparatus and non-volatile computer-readable storage medium
US20190371003A1
