Vision-based dynamic multi-target identification, pose estimation and tracking method and system

Through vision-based dynamic multi-target recognition, pose estimation and tracking methods, convolutional neural networks and PnP pose estimation are used to solve the problems of high cost and low real-time performance in multi-heterogeneous robot dynamic capture systems, and achieve low-cost, High-precision multi-target pose estimation and tracking.

CN118747770APending Publication Date: 2024-10-08江淮前沿技术协同创新中心 +1
View PDF 0 Cites 3 Cited by

Patent Information

Application Number
CN202410734325.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-07
Publication Date
2024-10-08

AI Technical Summary

Technical Problem

Existing Technology In multi-heterogeneous robot dynamic capture systems, high-precision motion capture systems require expensive special equipment and have unsatisfactory real-time performance, resulting in high system deployment and use costs and certain limitations.

Method used

Using vision-based dynamic multi-target recognition, pose estimation and tracking methods, by obtaining the video stream collected by the camera, using pre-trained convolutional neural network for key point detection and confidence screening, combined with the PnP pose estimation method to obtain the target object 6D pose information, and process the target detection frame through a multi-target tracking algorithm to achieve the target ID and tracking trajectory.

Benefits of technology

It reduces system deployment and maintenance costs, provides high-quality, refined multi-target pose estimation and tracking services, and ensures detection, estimation and tracking accuracy. It has important significance and broad application prospects.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118747770A_ABST
    Figure CN118747770A_ABST
Patent Text Reader

Abstract

The invention provides a dynamic multi-target recognition, pose estimation and tracking method and system based on vision, and relates to the technical field of vision, and the method comprises the steps: obtaining a video stream collected by a camera; performing key point detection on the image of the video stream based on a pre-trained convolutional neural network to obtain 2D key point data of the target object; carrying out confidence coefficient screening; matching is carried out based on the 3D key point list and the 2D key point data with the confidence higher than a threshold value, and 2D-3D key point pairs are obtained; and performing pose estimation on the 2D-3D key point pair based on a PnP pose estimation method to obtain 6D pose information of the target object. According to the embodiment of the invention, only low-cost common camera hardware is needed as input, the deployment and maintenance cost is low, the algorithm performance is excellent, high-quality and refined multi-target pose estimation and tracking service can be provided, and the system cost is reduced while better detection, estimation and tracking precision is ensured.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of visual technology, and in particular to a vision-based dynamic multi-target recognition, pose estimation and tracking method and system. Background Art

[0002] Object detection technology aims to detect and identify objects of interest from a given image or video, and obtain the category and location information of the object, usually expressed in the form of a bounding box. This technology is widely used in security monitoring, autonomous driving, robot perception and other fields, laying the foundation for subsequent advanced visual tasks such as object recognition, tracking, and pose estimation.

[0003] The pose estimation technology focuses on accurately estimating the position (translation) and posture (rotation) of the target object in three-dimensional space, obtaining the pose information of the target's six degrees of freedom (3 degrees of freedom in translation and 3 degrees of freedom in rotation), thereby achieving accurate positioning of rigid targets. This technology is mainly based on obtaining data from visual sensors and combining machine learning algorithms to achieve pose estimation. It is widely used in augmented reality, robot navigation, motion capture, autonomous driving and other fields, and is a key technology for achieving accurate target perception and motion planning.

[0004] Target tracking technology aims to detect, extract, identify and track moving targets in a continuous sequence of image frames, obtain the position and motion trajectory information of the target, so as to understand the behavior of the moving target and complete higher-level detection tasks. According to the number of tracking targets, tracking algorithms can be divided into single target tracking and multi-target tracking. Compared with single target tracking, multi-target tracking is more complex and challenging. It is necessary to locate multiple targets of interest in a given video at the same time, maintain the ID (Identity Document) of each target and record its motion trajectory.

[0005] The existing technology applies the above three core technologies to the motion capture system of multiple heterogeneous robots in order to achieve accurate perception of the target. However, in scenarios such as multiple heterogeneous robots, commercial high-precision motion capture systems usually require expensive dedicated equipment and have unsatisfactory real-time performance, resulting in high system deployment and use costs and certain limitations. Summary of the invention

[0006] To solve the above problems, an embodiment of the present invention provides a vision-based dynamic multi-target recognition, pose estimation and tracking method, the method comprising: acquiring a video stream captured by a camera; the image of the video stream includes at least one target object; performing key point detection on the image of the video stream based on a pre-trained convolutional neural network to obtain 2D key point data of the target object; performing confidence screening on the 2D key point data of the target object to obtain 2D key point data with a confidence level higher than a threshold; matching a 3D key point list pre-calibrated based on the target object with the 2D key point data with a confidence level higher than a threshold to obtain 2D-3D key point pairs; performing pose estimation on the 2D-3D key point pairs based on a PnP pose estimation method to obtain 6D pose information of the target object.

[0007] Optionally, the method also includes: performing target classification detection on the image of the video stream based on the pre-trained convolutional neural network to obtain multiple target detection frames of the target objects; processing the multiple target detection frames of the target objects through a multi-target tracking algorithm to obtain the ID and tracking trajectory of the target object.

[0008] Optionally, the method further includes: acquiring a plurality of image sets of the target objects, and performing category labeling and key point labeling on the image sets to obtain a data set; the data set includes a training set, a validation set, and a test set; the key point labeling is to label a plurality of feature points at different heights and positions of the target object, and the plurality of feature points satisfy that the number of feature points covered by shooting at any angle is greater than or equal to a quantity threshold; calibrating and correcting the distortion of the camera, and determining the camera parameters; training the convolutional neural network according to the data set and the camera parameters until conditions are met, and obtaining the detection model and weight file of the convolutional neural network.

[0009] Optionally, the convolutional neural network is a Yolov8 neural network with an attention mechanism added.

[0010] Optionally, the target detection frames of the multiple target objects are processed by the multi-target tracking algorithm to obtain the ID and tracking trajectory of the target object, including: creating a trajectory corresponding to the detection result of the first frame image of the video stream, initializing the motion variable of the Kalman filter, and predicting the corresponding prediction frame by filtering; performing IoU matching between the prediction frame and the target detection frame of the current frame image, and calculating the corresponding cost matrix; outputting a linear matching result according to the cost matrix combined with the Hungarian algorithm; the linear matching result includes a trajectory mismatch, a detection frame mismatch, or a successful match between the target detection frame and the prediction frame; if the linear matching result is a trajectory mismatch, deleting the mismatched trajectory; if the linear matching result is a detection frame mismatch, assigning an initialized new trajectory to the target detection frame; if the linear matching result is a successful match between the target detection frame and the prediction frame, updating the trajectory variable of the target detection frame by using the Kalman filter; looping the above steps until a confirmed trajectory appears or the video stream ends; predicting the frames corresponding to the confirmed trajectory and the unconfirmed trajectory by using the Kalman filter, and performing cascade matching between the frame of the confirmed trajectory and the target detection frame.

[0011] Optionally, the frame of the confirmed trajectory is cascade matched with the target detection frame, including: if the trajectory matches, updating the corresponding trajectory variable through Kalman filtering; if the detection frame mismatches or the trajectory mismatches, performing IoU matching on the trajectory of the unconfirmed state and the mismatched trajectory and the detection frame mismatch one by one, and then calculating the cost matrix through the result of the IoU matching; outputting a linear matching result according to the cost matrix combined with the Hungarian algorithm; if the output linear matching result is a trajectory mismatch, deleting the mismatched trajectory; if the output linear matching result is a target detection frame mismatch, assigning an initialized new trajectory to the target detection frame; if the output linear matching result is a successful match between the target detection frame and the predicted frame, using Kalman filtering to update the trajectory variable of the target detection frame; looping through the above steps until the video stream ends, and outputting the target detection frame ID and the target tracking trajectory.

[0012] Optionally, before creating a trajectory corresponding to the detection result of the first frame image of the video stream, the method also includes: performing confidence screening to obtain a target detection frame with a confidence level higher than a threshold, and outputting the target detection frame and corresponding confidence information.

[0013] Optionally, the method further comprises: annotating key points of the image set of the target object to obtain a 3D key point list.

[0014] Optionally, the target object is a heterogeneous robot.

[0015] An embodiment of the present invention provides a vision-based dynamic multi-target recognition, pose estimation and tracking system, the system comprising: a video acquisition module, used to obtain a video stream acquired by a camera; the image of the video stream includes at least one target object; a key point detection module, used to perform key point detection on the image of the video stream based on a pre-trained convolutional neural network to obtain 2D key point data of the target object; a confidence screening module, used to perform confidence screening on the 2D key point data of the target object to obtain 2D key point data with a confidence higher than a threshold; a matching module, used to match a 3D key point list pre-calibrated based on the target object with the 2D key point data with a confidence higher than a threshold to obtain a 2D-3D key point pair; a pose estimation module, used to perform pose estimation on the 2D-3D key point pair based on a PnP pose estimation method to obtain 6D pose information of the target object.

[0016] The vision-based dynamic multi-target recognition, pose estimation and tracking method and system provided in the embodiments of the present invention only require low-cost ordinary camera hardware as input, have low deployment and maintenance costs, excellent algorithm performance, and can provide high-quality and refined multi-target pose estimation and tracking services. While reducing system costs, it ensures good detection, estimation and tracking accuracy, and has important significance and broad application prospects. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying creative work.

[0018] Figure 1 A schematic diagram of a flow chart of a vision-based dynamic multi-target recognition, pose estimation and tracking method provided in an embodiment of the present invention;

[0019] Figure 2 A flowchart of a multi-target posture tracking and recognition method based on Yolov8 provided in an embodiment of the present invention;

[0020] Figure 3 A schematic diagram of single-camera imaging provided by an embodiment of the present invention;

[0021] Figure 4 A graph showing changes in the loss function of a neural network training provided by an embodiment of the present invention;

[0022] Figure 5 A specific flow chart of an enhanced PnP pose estimation method based on 2D key point confidence threshold screening provided by an embodiment of the present invention;

[0023] Figure 6 The effect diagram of the process of aligning 3D key points with visible 2D key points to 6D pose detection provided by the embodiment of the present invention;

[0024] Figure 7 The IoU formula principle diagram provided by the embodiment of the present invention;

[0025] Figure 8 A cascade matching flow chart provided for an embodiment of the present invention;

[0026] Fig. 9 A detection speed curve diagram of whether a multi-target tracking algorithm is added to a four-axis mechanical arm Mecanum wheeled robot and two isomorphic Mecanum wheeled robots provided in an embodiment of the present invention;

[0027] Fig.10 A schematic diagram of the structure of a vision-based dynamic multi-target recognition, pose estimation and tracking system provided in an embodiment of the present invention. DETAILED DESCRIPTION

[0028] In order to make the above-mentioned objects, features and advantages of the present invention more clearly understood, the specific embodiments of the present invention are described in detail below in conjunction with the accompanying drawings. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.

[0029] Based on the above-mentioned problems existing in the prior art, the embodiments of the present invention provide a new solution that can reduce the system deployment cost, improve practicality, and at the same time ensure the accuracy of target detection, pose estimation and tracking, so as to promote the development and application of multi-heterogeneous robot dynamic capture technology.

[0030] The embodiment of the present invention provides a vision-based dynamic multi-target recognition, pose estimation and tracking method, which can use an ordinary RGB (Red Green Blue) camera as input and realize high-precision, real-time multi-target detection, pose estimation and tracking through algorithm processing.

[0031] This method adopts a two-stage pose estimation method: first, multi-target detection of the input image is realized based on a convolutional neural network; secondly, the 6-DOF spatial pose estimation of the detected target is performed by combining an enhanced PnP (Perspective-n-Points) pose estimation method based on 2D (Dimensionality) key point confidence threshold screening. At the same time, the above method also integrates a multi-target tracking module, which can achieve continuous and stable tracking of dynamic targets.

[0032] Compared with traditional motion capture solutions, the embodiments of the present invention can achieve the three major functions of target recognition, pose estimation, and target tracking with a simple structure of RGB input-algorithm processing-target output. It has the advantages of low hardware cost, low deployment and maintenance cost, superior algorithm, and output that can achieve ideal detection, estimation, and tracking accuracy.

[0033] In addition, the above is applicable to multi-target scenes in the room, can effectively solve the occlusion problem, quickly parse the 6-DOF posture information of targets such as robots, and simultaneously achieve continuous and stable tracking of multi-target IDs, with high detection accuracy, good real-time performance, and high computing efficiency, and has significant practical value.

[0034] Figure 1 A schematic flow chart of a vision-based dynamic multi-target recognition, pose estimation and tracking method provided in an embodiment of the present invention, the method comprising:

[0035] S102, obtaining a video stream captured by a camera, wherein an image of the video stream includes at least one target object.

[0036] In this embodiment, a video stream captured by an RGB camera can be used as input. The image of the video stream includes one or more target objects, which are objects for pose estimation and tracking. Exemplarily, the above video stream is monitoring data in a room where a stream is pulled in real time, and multiple heterogeneous robots in the room are target objects.

[0037] Optionally, the camera may be calibrated and distortion corrected in advance to obtain camera parameters.

[0038] S104, performing key point detection on the image of the video stream based on a pre-trained convolutional neural network to obtain 2D key point data of the target object.

[0039] Among them, the training process of the convolutional neural network is as follows:

[0040] First, obtain a set of images of multiple target objects, and perform category annotation and key point annotation on the image set to obtain a data set. Among them, key point annotation is to mark multiple feature points at different heights and different positions of the target object, and the number of feature points covered by the multiple feature points at any angle is greater than or equal to the number threshold. Key point annotation of the image set of the target object can obtain a 3D key point list. Specifically, the data set can be divided into a training set, a validation set, and a test set.

[0041] Secondly, the camera is calibrated and distortion corrected to determine the camera parameters.

[0042] Then, the convolutional neural network is trained according to the above data set and camera parameters until the conditions are met, and the detection model and weight file of the convolutional neural network are obtained.

[0043] In this embodiment, the convolutional neural network can use the Yolov8 neural network with an attention mechanism. This embodiment designs an improved Yolov8 neural network, adds an attention mechanism to the original network, uses a self-built data set to train the Yolov8 neural network model, and obtains the Yolov8 detection model and its weight file. By using the Yolov8 network with a small model, fast speed, and high detection accuracy as the basis, the overall performance is better than the traditional detection method; and thus the better the detector performance, the better the multi-target tracking output effect based on the multi-target tracking algorithm.

[0044] For example, 300 images of multi-target image data in different postures are collected by extracting frames from the video stream; the image data is preprocessed, and the image data is labeled with categories and key points; the key point labeling needs to be multiple feature points at different heights and positions of the robot; the feature points need to satisfy the requirement that the number of feature key points is greater than or equal to 4 when shooting at any angle.

[0045] Based on the processed image data, a self-assembled data set is formed, and the self-assembled data set is divided into a training set, a validation set, and a test set in a ratio of 6: 3: 1. The training set and the validation set are used to train the YoloV8 neural network to obtain the preliminary YoloV8 detection model.

[0046] The test set is used to test the preliminary Yolov8 detection model to obtain the test results. Based on the above test results, the Yolov8 detection model is evaluated. After the evaluation is qualified, the test is terminated, and finally the Yolov8 detection model and weight file are obtained.

[0047] S106, performing confidence screening on the 2D key point data of the target object to obtain 2D key point data with a confidence level higher than a threshold.

[0048] By screening 2D key points based on confidence thresholds, 2D key points with low confidence and potential errors can be effectively eliminated, thereby improving the quality of matching point pairs input into the PnP algorithm in subsequent steps, thereby improving the accuracy of 6D pose analysis. The relatively small number of 2D-3D key point pairs also improves the speed of pose analysis operations.

[0049] S108 , matching a 3D key point list pre-calibrated based on the target object with 2D key point data with a confidence level higher than a threshold to obtain 2D-3D key point pairs.

[0050] The screened high-confidence 2D key points are aligned with the known 3D key points, and the aligned 2D-3D key point pairs are substituted into the PnP pose estimation method to obtain the 6D pose information of the detection target relative to the camera coordinate system.

[0051] S110, performing pose estimation on the 2D-3D key point pairs based on the PnP pose estimation method to obtain 6D pose information of the target object.

[0052] Specifically, the 6D pose information includes 3 translation degrees of freedom and 3 rotation degrees of freedom.

[0053] The vision-based dynamic multi-target recognition, pose estimation and tracking method provided by the embodiment of the present invention can realize classification detection and key point detection of multiple targets, has high generalization ability, can quickly parse the 6D pose of the detected target, only requires low-cost ordinary camera hardware as input, has low deployment and maintenance costs, excellent algorithm performance, and can provide high-quality and refined multi-target pose estimation services. While reducing system costs, it ensures good detection and estimation accuracy, and has important significance and broad application prospects.

[0054] The embodiment of the present invention adopts the Yolov8 network with small model, fast speed and high detection accuracy as the basis. Compared with the traditional detection method, the overall performance is better, and thus the detector performance is better.

[0055] Furthermore, the above method of the embodiment of the present invention can also perform multi-target tracking, such as Figure 1 As shown, the following steps are also included:

[0056] S112, performing target classification detection on the images of the video stream based on a pre-trained convolutional neural network to obtain target detection frames of multiple target objects.

[0057] S114, processing the target detection frames of multiple target objects through a multi-target tracking algorithm to obtain the IDs and tracking trajectories of the target objects.

[0058] Exemplarily, the multi-target tracking process is as follows:

[0059] (1) Create a trajectory corresponding to the detection result of the first frame of the video stream, initialize the motion variable of the Kalman filter, and predict the corresponding prediction box through filtering;

[0060] (2) Perform IoU matching between the predicted box and the target detection box of the current frame image, and calculate the corresponding cost matrix; the IoU calculation formula is as follows:

[0061]

[0062] (3) According to the cost matrix combined with the Hungarian algorithm, a linear matching result is output; the linear matching result includes trajectory mismatch, detection frame mismatch, or successful matching between the target detection frame and the prediction frame;

[0063] (4) If the linear matching result is a trajectory mismatch, the mismatched trajectory is deleted; if the linear matching result is a detection frame mismatch, an initialized new trajectory is assigned to the target detection frame; if the linear matching result is that the target detection frame matches the predicted frame successfully, the Kalman filter is used to update the trajectory variable of the target detection frame;

[0064] (5) Execute the above steps (1) to (4) repeatedly until a confirmed track appears or the video stream ends;

[0065] (6) Predict the boxes corresponding to the confirmed trajectory and the unconfirmed trajectory through Kalman filtering, and perform cascade matching on the box of the confirmed trajectory and the target detection box. Exemplarily, the cascade matching process is as follows:

[0066] If the trajectories match, the corresponding trajectory variables are updated through Kalman filtering;

[0067] If the detection frame mismatches or the trajectory mismatches, the unconfirmed trajectory and the mismatched trajectory are matched with the detection frame mismatch one by one by IoU matching, and then the cost matrix is ​​calculated based on the results of IoU matching;

[0068] According to the cost matrix combined with the Hungarian algorithm, the linear matching result is output;

[0069] If the output linear matching result is a trajectory mismatch, the mismatched trajectory is deleted; if the output linear matching result is a target detection frame mismatch, an initialized new trajectory is assigned to the target detection frame; if the output linear matching result is a successful match between the target detection frame and the predicted frame, the Kalman filter is used to update the trajectory variable of the target detection frame;

[0070] The above steps are executed repeatedly until the video stream ends, and the target detection box ID and target tracking trajectory are output.

[0071] Optionally, before creating the trajectory corresponding to the detection result of the first frame image of the video stream, the method further includes: performing confidence screening to obtain a target detection frame with a confidence higher than a threshold, and outputting the target detection frame and the corresponding confidence information. For example, the video stream is sent to the target detection module in the Yolov8 detection model for detection, and the target detection frame with a detection confidence less than 0.7 is screened and removed, and the target detection frame and confidence information are output.

[0072] The embodiment of the present invention first designs a data set collection method for a specific robot, including a specific method of extracting image data from a video frame and marking target key points;

[0073] Secondly, the Yolov8 neural network was designed, the attention mechanism was added to the original network, and the Yolov8 neural network model was trained using a self-built data set to obtain the Yolov8 detection model and its weight file.

[0074] Again, based on the above-mentioned Yolov8 detection model, the two-stage pose estimation method is designed. The pose estimation method obtains the 6D pose of the detected target by first aligning the 2D key points and screening the 3D key points confidence threshold, thereby realizing the target pose estimation.

[0075] Finally, based on the trained Yolov8 detection model and combined with the multi-target tracking algorithm processing, multi-target detection and tracking are realized.

[0076] Compared with the prior art, the embodiments of the present invention have the following beneficial effects:

[0077] The embodiments of the present invention can realize classification detection and key point detection of multiple targets. Since the present invention adopts a special processing method for image data, the trained detection model is not affected by occlusion and has a high generalization ability, and can quickly parse the 6D pose of the detected target. The detection capability of multiple heterogeneous robots in complex scenes is enhanced;

[0078] The embodiment of the present invention uses the Yolov8 network with a small model, fast speed and high detection accuracy as the basis, and has better overall performance than the traditional detection method. Therefore, the better the detector performance, the better the multi-target tracking output effect based on the multi-target tracking algorithm will be.

[0079] The embodiment of the present invention proposes a vision-based dynamic multi-target recognition, pose estimation and tracking method, which only requires low-cost ordinary camera hardware as input, has low deployment and maintenance costs, and has excellent algorithm performance. It can provide high-quality and refined multi-target pose estimation and tracking services, while reducing system costs. It ensures excellent detection, estimation and tracking accuracy, and has important significance and broad application prospects.

[0080] The following embodiments are described in detail by taking a four-axis manipulator Mecanum wheeled robot as an example.

[0081] In this embodiment, the above method is used to perform posture recognition on a four-axis mechanical arm Mecanum wheeled robot and two isomorphic Mecanum wheeled robots. At the same time, these robots are controlled to perform coordinated formation actions. During the entire action process, the parameter information fed back by the robot collector and camera is recorded in real time to verify the real-time effectiveness of this method in actual application scenarios.

[0082] The embodiment of the present invention provides a multi-target posture tracking and recognition method based on Yolov8, and its specific implementation method includes the following steps:

[0083] Step (1), acquiring image data. Multi-robot image data collection and data processing; screening and annotating the collected multi-robot image data to form a self-constructed data set, and dividing the data set into a training set, a validation set, and a test set;

[0084] Step (2), camera calibration and distortion correction. Calibrate the camera using the coordinate system transformation formula, then perform camera distortion correction and determine camera parameters;

[0085] Step (3), training the Yolov8 neural network. Based on steps (1) and (2), the Yolov8 neural network can be trained, and after the network model converges and becomes stable, the detection model and weight file of the Yolov8 neural network are obtained;

[0086] Step (4), using the Yolov8 detection model trained in step (3) to perform key point detection on multiple robots, and then output the robot's 6D pose through an enhanced PnP pose estimation method based on 2D key point confidence threshold screening;

[0087] Step (5): Use the Yolov8 detection model trained in step (3) to perform target classification detection on multiple robots, and then obtain the IDs and tracking trajectories of multiple robots through multi-target tracking algorithm processing.

[0088] Step (6), verify the real-time performance of the output results of step (4) and step (5).

[0089] Figure 2 A flow chart of a multi-target posture tracking and recognition method based on Yolov8 provided in an embodiment of the present invention is shown, and the flow includes: acquiring image data, camera calibration, distortion correction, inputting Yolov8 neural network, object detection, object key point detection, DeepSort multi-target tracking, PnP optimization algorithm, and outputting object category, tracking ID of each target, and 6D posture of the object.

[0090] As a feasible method, the specific method of the above step (1) is as follows:

[0091] Step (1-1) takes video of the target robot from different angles, and selects 300 images of multiple robots in different environments and postures by frame extraction;

[0092] Step (1-2) is to solve the problem of invisible key points and key point occlusion. 22 feature points are selected at different heights and positions of the robot for annotation. At the same time, the number of feature points is greater than or equal to 4 when shooting at any angle.

[0093] Step (1-3) establishes the 3D key point model of the target robot through the robot simulation platform Coppeliasim.

[0094] Figure 3 A schematic diagram of single-camera imaging is shown. As a feasible approach, the specific method of camera correction in step (2) above is as follows:

[0095] Step (2-1), let Pw(X w ,Y w ,Z w ) is a point in the world coordinate system space, Pc(X c ,Y c ,Z c ) is a point in the camera coordinate system space, and the world coordinate system is transformed to the camera coordinate system through the rotation matrix R and the translation matrix t:

[0096] Step (2-2), transform the camera coordinate system to the image plane coordinate system

[0097] The coordinates of a point in the camera coordinate system in the image coordinate system on the two-dimensional imaging plane can be obtained by Figure 3 The similarity principle of the triangles shown is obtained, and their similarity relationship is as follows: Then we can get the correspondence between the points in the camera coordinate system and the points in the image coordinate system:

[0098] Step (2-3), transform the image plane coordinate system to the pixel coordinate system

[0099] Since the points in the image coordinate system are measured by physical length, and the measurement unit of the points in the pixel coordinate system is pixel, it is necessary to first convert them through the conversion ratio between physical length and pixel. Secondly, the origin of the image coordinate system is located at the center of the imaging plane, and the origin of the pixel coordinate system is located at the upper left corner of the imaging plane. Therefore, after converting the points in the image coordinate system to pixels, it is necessary to add the offset (u0, v0) caused by the different origins. Finally, the corresponding relationship between the image coordinate system and the pixel coordinate system is as follows:

[0100] Steps (2-4), transformation from world coordinate system to pixel coordinate system:

[0101]

[0102] Where dx and dy are the widths of the pixel, fx and fy are the equivalent focal lengths,

[0103] Specifically, the matrix [R, t] composed of the rotation matrix R and the translation matrix t in step (2-4) is the camera's external parameter matrix, which is related to the relative position of the camera and the world coordinate system. The coordinate transformation matrix between the camera coordinate system and the pixel coordinate system is called the internal parameter matrix. Similarly, when the point in the pixel coordinate system is known, according to the back-projection model and the depth Z in the camera coordinate system c , and then use the camera's external parameter matrix to obtain the coordinates Pw(X w ,Y w ,Z w ).

[0104] Step (2-5), based on the theoretical values ​​of steps (2-1) to (2-4) of the pinhole camera model, considering the distortion factors of the actual camera, let (u, v) be the ideal coordinates on the image plane, (u d ,v d ) are the corresponding measured coordinates. Under this model, assuming that the principal point (0, 0) is distortion-free, then according to the radial distortion expression, we can get

[0105] Specifically, in step (2-5) k1, k2, k3 are radial distortion coefficients. In general models, there is no limit to the number of plus signs in the above formula. In fact, too many correction coefficients will not bring much benefit to the model results, but will increase the calculation burden. Therefore, the first three distortion correction coefficients are taken.

[0106] As a feasible method, the specific method of the above step (3) is:

[0107] The deep learning framework Pytorch is used for training. In terms of hardware configuration, the GPU is RTX 3060 and the CPU is 16vCPU Intel(R)Xeon(R)Platinum 8350C CPU@2.60GHz. In this example, the training parameter learning rate is 0.001, the batch size is set to 16, the IoU threshold is set to 0.5, and the number of iterations is 300. The ratio of the robot key point training set to the validation set is set to 5:1, and the ratio of the two to the test set is also set to 5:1.

[0108] The model evaluation index in step (3) can be directly generated by the program. Figure 4 The graph shows the change of loss function of neural network training. Figure 4 The loss function shown is used to indicate the degree of difference between the model's predicted value and the true value. The smaller the loss function, the better the robustness of the model and the better the algorithm can adapt to changes in data. Figure 4It can be seen that with the increase in the number of iterations during training, the loss rate of the Yolov8 loss function drops sharply, and finally reaches stability and is in a convergence state.

[0109] As a feasible approach, Figure 5 This is a specific flow chart of an enhanced PnP pose estimation method based on 2D key point confidence threshold screening in an embodiment of the present invention. The specific method is as follows:

[0110] Step (4-1), perform target detection and key point detection on the input image data based on the Yolov8 detection model. Input the image data into the key point detector of the Yolov8 detection model to obtain the 2D key point matrix (m*2) of the target object.

[0111] Step (4-2), store all 3D key points of the robot in a list.

[0112] Step (4-3), after obtaining the data of 2D key point detection, filter out the key point list with accurate position through confidence filtering, and obtain the ID number of each key point in the list. The 2D key point matrix is ​​filtered out through the confidence filtering of the enhanced PnP pose estimation method based on 2D key point confidence threshold screening to obtain the key point list with accurate position, and obtain the ID number (m*1) of each key point in the list.

[0113] Step (4-4), align the 3D key points with the visible 2D key points. The object 3D key point matrix (m*3) is obtained by aligning the IDs.

[0114] Step (4-5) brings the aligned 3D key points and 2D key points into an enhanced PnP pose estimation method based on 2D key point confidence threshold screening to obtain the robot 6D pose relative to the camera coordinate system. The robot 6D pose includes a rotation matrix + a translation matrix.

[0115] Figure 6 This is a rendering of the process of aligning 3D key points with visible 2D key points to 6D pose detection in an embodiment of the present invention, showing 3D spatial points (left side), 2D visible key points (lower side), aligned 3D key points (upper side), and 6D pose based on the camera coordinate system (right side).

[0116] As a feasible method, the specific process of the multi-target tracking algorithm in step (5) is as follows:

[0117] Step (5-1), based on the target detection output of step (4-1), create a trajectory corresponding to the result detected in the first frame. Initialize the motion variable of the Kalman filter and predict its corresponding box through filtering.

[0118] Step (5-2): Based on step (5-1), the target detection frame of the frame and the frame predicted by the trajectory of the previous frame are matched one by one by IoU, and then the cost matrix is ​​calculated based on the result of IoU matching. Figure 7 The schematic diagram of the IoU formula is shown.

[0119] Step (5-3) outputs the linear matching result based on the cost matrix obtained in step (5-2) combined with the Hungarian algorithm. There are three possible results, namely, trajectory mismatch, detection frame mismatch, or successful pairing of the detection frame and the predicted frame. In the case of trajectory mismatch, delete the mismatched trajectory; in the case of detection frame mismatch, assign an initialized new trajectory to the detection frame; in the case of successful pairing of the detection frame and the predicted frame, it means that the previous and next frames are matched successfully, and the Kalman filter is used to update the trajectory variable of the detection frame at this time.

[0120] Step (5-4), repeatedly looping step (5-2) to step (5-3) until a confirmed track appears or the video frame ends.

[0121] Step (5-5), predict the boxes corresponding to the confirmed state trajectory and the unconfirmed state trajectory through Kalman filtering, and perform cascade matching on the box of the confirmed state trajectory and the detection box.

[0122] Figure 8 This is a cascade matching flow chart in an embodiment of the present invention. Specifically, in the cascade matching flow chart, the upper part is feature extraction and similarity estimation, which is the cost function of the allocation problem. It is mainly composed of the Mahalanobis distance representing the motion model and the ID feature representing the appearance model; the lower part is data association, which is the main body of the process, and data association is also a cyclic process.

[0123] Step (5-6) has three possible results after the cascade matching based on step (5-5). The first is trajectory matching. Such a trajectory updates its corresponding trajectory variable through Kalman filtering. The second and third are detection box and trajectory mismatch. At this time, the previously unconfirmed trajectory and the mismatched trajectory are combined with the detection box mismatch for IoU matching one by one, and then the cost matrix is ​​calculated based on the result of IoU matching.

[0124] Specifically, the matching of the cascade matching trajectory in step (5-5) is to match the trajectory that has never been lost, that is, the trajectory that can be matched in every frame to the trajectory with the longest loss time of 30 frames with the detection results one by one in order, giving the highest priority to the trajectory that has never been lost, and matching those trajectories with the longest loss time at the end.

[0125] Specifically, in the final stage of cascade matching in step (5-5), the unconfirmed trajectories and the trajectories that can be matched in each frame without loss are matched with the target detection results based on IoU. The advantage of doing this is to reduce the matching changes caused by the sudden change of the target appearance or the partial occlusion of the target during the matching process, but there is also a small possibility of causing the target ID to jump, that is, some newly generated trajectories are incorrectly connected to the old trajectories, confusing the target ID. Throughout the process, the matching priority is dynamically adjusted by the cascade matching to improve the matching accuracy. Compared with Mahalanobis distance matching, targets with higher frequency are given the highest matching priority.

[0126] As a feasible method, the specific method of step (6) is as follows:

[0127] Step (6-1), analyze the 6D posture output effect in step (4), control the four-axis manipulator Mecanum wheel robot to perform circular motion with different radii for positioning error analysis at camera heights of 0.5 meters, 1.5 meters, and 2.5 meters, and summarize the X, Y, and Z axis position errors at different camera heights in Table 1 and the X, Y, and Z axis angle errors at different camera heights in Table 2.

[0128]

[0129]

[0130] Table 1

[0131]

[0132] Table 2

[0133] At a camera distance of 0.5 meters, the positioning errors of the x, y, and z axes can reach 0.0039 meters, 0.0025 meters, and 0.0025 meters, and the maximum errors can reach 0.005 meters, 0.011 meters, and 0.008 meters. The average angular errors of the x, y, and z axes can reach 2.5 degrees, 1.2 degrees, and 0.5 degrees, and the maximum angular errors can reach 4.7 degrees, 3.3 degrees, and 1.0 degrees.

[0134] At a camera distance of 1.5 meters, the positioning errors of the x, y, and z axes can reach 0.008 meters, 0.005 meters, and 0.009 meters, and the maximum errors can reach 0.016 meters, 0.013 meters, and 0.021 meters. The average angle errors of the x, y, and z axes can reach 2.2 degrees, 4.2 degrees, and 0.9 degrees, and the maximum angle errors can reach 7.0 degrees, 6.9 degrees, and 2.1 degrees.

[0135] At a camera distance of 2.5 meters, the positioning errors of the x, y, and z axes reach 0.017 meters, 0.017 meters, and 0.036 meters, and the maximum errors can reach 0.057 meters, 0.034 meters, and 0.082 meters. The average angle errors of the x, y, and z axes can reach 8.7 degrees, 3.7 degrees, and 3.9 degrees, and the maximum angle errors can reach 18.2 degrees, 11.0 degrees, and 8.8 degrees.

[0136] It can be further analyzed that the embodiments of the present invention can effectively realize the category recognition and three-dimensional spatial pose estimation tasks of the robot and the target object in a single reasoning process, and can provide efficient pose trajectory tracking support for subsequent multi-target tracking.

[0137] Step (6-2), based on the detection result of step (6-1), further perform posture detection on the four-axis manipulator Mecanum wheeled robot and two isomorphic Mecanum wheeled robots, and further obtain the ID and tracking trajectory of the multiple robots based on the multi-target tracking algorithm described in step (5).

[0138] The GPU device used is NVIDIAGEFORCE RTX3070 8GB. The CPU device is AMD Ryzen 7 5800H processor. To verify the processing effect and processing speed of different resolutions and without adding tracking algorithm, the frame rate test analysis of two image sizes of 640*480 and 1920*1080 is performed, as summarized in Table 3.

[0139]

[0140] Table 3

[0141] Fig. 9 The detection speed curve diagram of whether the multi-target tracking algorithm is added to the four-axis mechanical arm Mecanum wheeled robot and two isomorphic Mecanum wheeled robots in the embodiment of the present invention. When the input image is 640*480, the system frame rate is greater than 30fps, which fully meets the real-time requirements. When the input image is 1920*1080, the frame rate of adding the target tracking algorithm is 38.2fps, which meets the real-time requirements. After adding the multi-target tracking algorithm, the frame rate is 19.8fps, which basically meets the real-time requirements. It can be applied to multi-robot control systems.

[0142] The above method is applicable to multi-target scenes in the room. It can effectively solve the occlusion problem and quickly parse the 6-DOF pose information of targets such as robots. At the same time, it can realize continuous and stable tracking of multi-target IDs. It has high detection accuracy, good real-time performance, high computing efficiency, and significant practical value.

[0143] Fig.10A schematic diagram of the structure of a vision-based dynamic multi-target recognition, pose estimation and tracking system provided by an embodiment of the present invention is shown, and the device includes:

[0144] The video acquisition module 11 is used to obtain a video stream acquired by a camera; the image of the video stream includes at least one target object;

[0145] A key point detection module 12 is used to perform key point detection on the image of the video stream based on a pre-trained convolutional neural network to obtain 2D key point data of the target object;

[0146] A confidence screening module 13 is used to perform confidence screening on the 2D key point data of the target object to obtain 2D key point data with a confidence higher than a threshold;

[0147] A matching module 14, configured to match the 3D key point list pre-calibrated based on the target object with the 2D key point data with a confidence level higher than a threshold, to obtain a 2D-3D key point pair;

[0148] The pose estimation module 15 is used to perform pose estimation on the 2D-3D key point pair based on the PnP pose estimation method to obtain the 6D pose information of the target object.

[0149] The vision-based dynamic multi-target recognition, pose estimation and tracking system provided in the embodiment of the present invention can reduce the system deployment cost and improve practicality, while ensuring a new solution for target detection, pose estimation and tracking accuracy, so as to promote the development and application of multi-heterogeneous robot dynamic capture technology.

[0150] Although the present invention is disclosed as above, the present invention is not limited thereto. Any person skilled in the art can make various changes and modifications without departing from the spirit and scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the scope defined by the claims.

[0151] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.

[0152] In this specification, each embodiment is described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the embodiments can be referred to each other. For the system disclosed in the embodiment, since it corresponds to the method disclosed in the above embodiment, the description is relatively simple, and the relevant parts can be referred to the method part.

[0153] The above description of the disclosed embodiments enables one skilled in the art to implement or use the present invention. Various modifications to these embodiments will be apparent to one skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to the embodiments shown herein, but rather to the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A vision-based dynamic multi-target recognition, pose estimation and tracking method. It is characterized in that The method comprises: Acquire a video stream captured by a camera; the image of the video stream includes at least one target object; Performing key point detection on the image of the video stream based on a pre-trained convolutional neural network to obtain 2D key point data of the target object; Performing confidence screening on the 2D key point data of the target object to obtain 2D key point data with a confidence level higher than a threshold; Matching the 3D key point list pre-calibrated based on the target object with the 2D key point data with a confidence level higher than a threshold to obtain 2D-3D key point pairs; The pose of the 2D-3D key point pair is estimated based on the PnP pose estimation method to obtain 6D pose information of the target object.

2. The method according to claim 1, It is characterized in that The method further comprises: Performing target classification detection on the image of the video stream based on the pre-trained convolutional neural network to obtain a plurality of target detection frames of the target objects; The target detection frames of the multiple target objects are processed by a multi-target tracking algorithm to obtain the ID and tracking trajectory of the target object.

3. The method according to claim 1, It is characterized in that The method further comprises: Acquire a plurality of image sets of the target object, and perform category labeling and key point labeling on the image sets to obtain a data set; the data set includes a training set, a validation set, and a test set; the key point labeling is to label a plurality of feature points at different heights and different positions of the target object, and the plurality of feature points satisfy that the number of feature points covered by any angle of photography is greater than or equal to a quantity threshold; Calibrate and correct the distortion of the camera to determine camera parameters; The convolutional neural network is trained according to the data set and the camera parameters until conditions are met, and a detection model and a weight file of the convolutional neural network are obtained.

4. The method according to claim 3, It is characterized in that The convolutional neural network is a Yolov8 neural network with an attention mechanism added.

5. The method according to claim 2, It is characterized in that The method of processing the target detection frames of the multiple target objects by a multi-target tracking algorithm to obtain the ID and tracking trajectory of the target object includes: Creating a trajectory corresponding to the detection result of the first frame image of the video stream, initializing the motion variable of the Kalman filter, and predicting the corresponding prediction box through filtering; Performing IoU matching between the prediction box and the target detection box of the current frame image, and calculating a corresponding cost matrix; Outputting a linear matching result according to the cost matrix combined with the Hungarian algorithm; the linear matching result includes a track mismatch, a detection frame mismatch, or a successful match between the target detection frame and the prediction frame; If the linear matching result is that the trajectory mismatches, the mismatched trajectory is deleted; if the linear matching result is that the detection frame mismatches, an initialized new trajectory is assigned to the target detection frame; if the linear matching result is that the target detection frame successfully matches the prediction frame, the Kalman filter is used to update the trajectory variable of the target detection frame; The above steps are executed repeatedly until a confirmed track appears or the video stream ends; The frames corresponding to the confirmed state trajectory and the unconfirmed state trajectory are predicted by Kalman filtering, and the frame of the confirmed state trajectory is cascade matched with the target detection frame.

6. The method according to claim 5, It is characterized in that The step of cascading matching the frame of the confirmed trajectory with the target detection frame includes: If the trajectories match, the corresponding trajectory variables are updated through Kalman filtering; If the detection frame mismatches or the trajectory mismatches, the trajectory of the unconfirmed state and the mismatched trajectory are matched with the detection frame mismatch one by one by IoU matching, and then the cost matrix is ​​calculated according to the result of IoU matching; Outputting a linear matching result according to the cost matrix combined with the Hungarian algorithm; If the output linear matching result is a trajectory mismatch, the mismatched trajectory is deleted; if the output linear matching result is a target detection frame mismatch, an initialized new trajectory is assigned to the target detection frame; if the output linear matching result is a successful match between the target detection frame and the prediction frame, the Kalman filter is used to update the trajectory variable of the target detection frame; The above steps are executed repeatedly until the video stream ends, and the target detection frame ID and target tracking trajectory are output.

7. The method according to claim 5, It is characterized in that Before creating a trajectory corresponding to the detection result of the first frame image of the video stream, the method further includes: Confidence screening is performed to obtain target detection frames with confidence levels higher than a threshold, and the target detection frames and corresponding confidence information are output.

8. The method according to claim 3, It is characterized in that The method further comprises: Key point annotation is performed on the image set of the target object to obtain a 3D key point list.

9. The method according to any one of claims 1 to 8, It is characterized in that The target object is a heterogeneous robot.

10. A vision-based dynamic multi-target recognition, pose estimation and tracking system. It is characterized in that The system comprises: A video acquisition module, used to obtain a video stream acquired by a camera; the image of the video stream includes at least one target object; A key point detection module, used to perform key point detection on the image of the video stream based on a pre-trained convolutional neural network to obtain 2D key point data of the target object; A confidence screening module, used to perform confidence screening on the 2D key point data of the target object to obtain 2D key point data with a confidence higher than a threshold; A matching module, configured to match the 3D key point list pre-calibrated based on the target object with the 2D key point data with a confidence level higher than a threshold value to obtain a 2D-3D key point pair; The pose estimation module is used to perform pose estimation on the 2D-3D key point pair based on the PnP pose estimation method to obtain 6D pose information of the target object.

Citation Information

Cited By

  • Unmanned aerial vehicle air pose detection method, equipment and medium

    CN119559254A

  • Multi-person sporting event counting method and system based on multi-key-point detection, and medium

    CN119693840A

  • Multifunctional automatic space point location tracking measurement method and device

    CN120043445A