A drone tracking method based on SLAM algorithm
By using the SLAM algorithm and convolutional neural network in the drone tracking system to extract environmental features and build a tracking algorithm, it solves the problem of traditional drone tracking methods being unable to track object movements in real time and adapt to complex environments, and achieves seamless Human-machine autonomous navigation and terminal interface automatic adjustment.
Patent Information
- Application Number
- CN202410705649.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-03
- Publication Date
- 2024-09-20
- Estimated Expiration
- 2044-06-03
AI Technical Summary
UAV tracking methods based on traditional SLAM algorithms cannot track object movements in real time, and are difficult to adapt to complex environmental changes.
The UAV tracking method based on the SLAM algorithm is adopted. By obtaining UAV parameters and flight data, the convolutional neural network is used to extract environmental features, build a tracking algorithm, track the tracking target in real time, and adjust the terminal interface layout based on historical operations. Adapt to environmental changes.
It realizes the autonomous navigation and obstacle avoidance of drones, can track object movements in real time, and adapts to complex environmental changes, improving the accuracy and stability of tracking and shooting.
Smart Images

Figure CN118279770B
Abstract
Description
Technical Field
[0001] The invention belongs to the technical field of unmanned aerial vehicles, and in particular relates to a unmanned aerial vehicle tracking method based on a SLAM algorithm. Background Art
[0002] Unmanned aircraft are referred to as drones, which are generally controlled by radio remote control equipment and the drone's own program control device. In recent years, drone technology has developed rapidly and has been widely used in military reconnaissance, geographic surveying and mapping, agricultural monitoring, film and television production and other fields. In particular, the tracking function of drones is particularly important in film and television production and sports events.
[0003] At the same time, SLAM (Simultaneous Localization and Mapping) algorithm, as a method that can achieve self-positioning and environmental mapping in unknown environments, has been widely used in the field of drones and unmanned vehicles. In the field of drones, SLAM algorithm can capture environmental information in real time through cameras and sensors, and assist drones in accurate spatial positioning and path planning.
[0004] However, drone tracking based on traditional SLAM algorithms basically uses a fixed-position tracking method, which has the problems of being unable to track object movement in real time and having difficulty adapting to complex environmental changes. Summary of the invention
[0005] The problem to be solved by the present invention is to provide a drone tracking method based on SLAM algorithm to solve the problem that fixed-position tracking cannot track the object movement in real time and is difficult to adapt to complex environmental changes.
[0006] The present invention adopts the following technical solution: a drone tracking method based on SLAM algorithm, comprising the following steps:
[0007] S1. Obtain the parameters of the drone, obtain the drone flight image in real time, and pre-process it. Based on the pre-processed flight image, obtain the current position of the drone and the camera coverage range, complete image recognition, and lock the target for tracking;
[0008] S2. Obtain UAV flight data, optimize the SLAM graph based on the flight data based on the SLAM algorithm, use convolutional neural network to extract environmental features, and improve the accuracy of the SLAM algorithm;
[0009] S3. Build a tracking algorithm based on the real-time flight data of the drone to track and shoot the target in real time;
[0010] S4. Track the target in real time and adapt to environmental changes. Send the target's motion trajectory and the interface layout adjusted according to historical operations to the user terminal for display.
[0011] Furthermore, in step S1, the drone parameters, including the physical properties, performance indicators, control system and sensor configuration of the drone, are as follows:
[0012] S1.1. Obtain the parameters of the drone to obtain the drone's endurance, coverage, and performance in severe weather conditions; including: drone size and weight, maximum flight time, maximum flight altitude, maximum flight speed, and wind resistance level;
[0013] S1.2. Obtain the parameters of the drone camera and image sensor to obtain the drone camera's battery life and charging efficiency; including: camera sensor type, size, resolution, aperture, angle range covered, and stabilization system;
[0014] S1.3. Obtain the drone's sensors and obstacle avoidance system to obtain the drone's positioning accuracy and flight safety; including: GPS and / or GLONASS sensors for positioning and navigation, obstacle avoidance sensors for automatic obstacle avoidance, and visual sensors for intelligent following and fixed-point hovering;
[0015] Acquire UAV flight images in real time, perform preprocessing, adjust image size and normalize image pixel values;
[0016] The drone parameters and preprocessed drone flight images are used as input data, and the SLAM algorithm is used to obtain the current position of the drone and the camera coverage range, complete image recognition, and lock the tracking target.
[0017] Furthermore, in step S2, the UAV flight data is obtained, the SLAM graph is optimized according to the flight data, and the environmental features are extracted using a convolutional neural network, specifically including:
[0018] S2.1. Based on the sensor data acquired in real time, sensor data fusion is performed to improve the robustness and accuracy of the SLAM algorithm; the sensor data includes lidar data, visual camera data and inertial measurement unit IMU data;
[0019] S2.2, construct an observation map, query the drone path and map configuration through the observation map, perform SLAM map optimization, and find the optimal drone path and landmark location;
[0020] S2.3. Obtain real-time flight data of the UAV, process the flight data through convolutional neural networks, extract environmental features, improve feature extraction and data association, and optimize the SLAM algorithm.
[0021] Furthermore, in step S2.1, the data fusion of different types of sensors adopts the ORB-SLAM3 or VINS-Fusion method to fuse the inertial measurement unit IMU data and the visual camera data, combined with the ekf extended Kalman filter, and adopts the sliding average method to obtain more accurate data, while removing random noise in the data, thereby improving the robustness and accuracy of the SLAM algorithm.
[0022] Furthermore, the observation map in step S2.2 includes observation data and state variables; the state variables include the position and direction of the drone, and the position of the feature points in the map; the observation data is information obtained by the drone through sensors, including distance and angle;
[0023] Build an observation graph based on the sensor data, perform SLAM graph optimization, build the error function F of each edge of the observation graph, which represents the difference between the observation data and the current state variable, perform SLAM graph optimization, integrate all edge error functions, build a nonlinear least squares formula, and minimize the sum of all edge error functions;
[0024] Adjust the state variables. Since the error function is nonlinear, use the iterative linearization method to solve it. In each iteration, update the state variables by solving the linear equations. Perform the next iteration based on the observation data and state variables of the drone at the next moment. When the error no longer decreases significantly or reaches the preset number of iterations, complete the SLAM graph optimization and obtain the optimal drone path and landmark position.
[0025] Furthermore, in step S2.3, environmental features are extracted by using a convolutional neural network to improve feature extraction and data association, and the SLAM algorithm is optimized; the convolutional neural network is a Mask R-CNN instance segmentation model, which is used to identify and track multiple objects in a dynamically changing environment in real time, and simultaneously identify and extract environmental features of multiple tracking targets, including the category, position and contour of the target object; Backbone Network is used as a basic feature extractor to generate a multi-level feature map, which contains low-level feature information from the edge and texture of the target object to high-level visual information of the object part and overall shape; based on the feature map, through convolution operation, first RPN slides on the high-level feature map of the network to generate candidate regions; then the candidate region passes through the RoI Align layer to extract a fixed-size feature vector, ready for further classification and segmentation; finally, the category of each candidate region is determined by the classification branch, and the precise contour of the tracking target is predicted by the mask branch.
[0026] Furthermore, in step S3, a tracking algorithm is constructed according to the real-time flight data of the UAV, which specifically includes:
[0027] S3.1. Based on the real-time flight data of the UAV, data enhancement is used to increase the generalization ability of the image, and the target detection, positioning and identification of the follow-up target are performed through the deep learning model; the deep learning model is the Yolov5 target detection model, which is trained on the COCO dataset, and the test set of the COCO dataset is used to run the Yolov5 target detection algorithm to obtain the detection result of the follow-up target;
[0028] S3.2. Build a tracking algorithm based on the real-time flight data of the drone, track and shoot the target through the tracking algorithm, match the target based on the predicted position and appearance features, solve the problem of temporary disappearance or occlusion of the target, and obtain the tracking result;
[0029] S3.3. Evaluate the tracking result, obtain the evaluation result, compare the evaluation result with the threshold, and if the evaluation result exceeds the threshold, determine that the tracking is inaccurate, and rebuild the tracking algorithm.
[0030] Further, in step S3.2, the tracking algorithm is the DeepSORT algorithm, the DeepSORT algorithm is used on the MOT data set, the MOT test video is used, the DeepSORT algorithm is run, the tracking result is obtained, and the MOTA and MOTP are calculated; the MOTA comprehensively considers the false detection, missed detection and identity switching, and the MOTP measures the matching accuracy of the tracking bounding box and the true value;
[0031] Match the detection results in the continuous frames with the existing tracking targets, and update the tracking target status, including the position and speed of the tracking target, according to the results of data association through the appearance features, motion information or a combination of the two, and perform multi-target tracking, including the following sub-steps:
[0032] S3.2.1. Based on the deep learning Yolov5 target detection model, the detected tracking targets include the bounding box coordinates of each candidate target location;
[0033] S3.2.2, Use the Kalman filter to predict the possible position of the target in the previous frame in the current frame to deal with the situation where the target disappears or is temporarily blocked, and match the target based on the predicted position and appearance features;
[0034] S3.2.3, then update the trajectory and identity information of each target according to the matching results, and handle the newly appeared and disappeared follow-up targets;
[0035] S3.2.4. Finally, a series of tracking target information is output, including bounding boxes and ID identifier information, indicating the continuous tracking trajectory results of each tracking target.
[0036] Furthermore, in step S3.3, the tracking results are evaluated, and the evaluation indicators include: precision, recall, and intersection over union (IoU). For each image, the bounding box detected by the tracking algorithm is first compared with the true value. If the IoU between the detection box and the true value box is greater than 0.5, the detection is considered to be the correct TP. The TP, FP, and FN of all images are counted, and the precision and recall of the entire image data set are calculated. Then, the PR curve is drawn, the IoU threshold is changed, the precision and recall under different thresholds are calculated, and the PR curve is drawn. The area under the curve (AP) is used as a comprehensive evaluation indicator. Finally, the results are analyzed to obtain the performance of the DeepSORT algorithm in dealing with occlusion and interaction.
[0037] Furthermore, step S4, the step of adjusting the terminal interface layout according to the historical operation, sending the adjusted interface layout to the user terminal, and receiving confirmation information from the user terminal, specifically includes:
[0038] S4.1. Obtain drone flight data in real time and display it on the terminal interface; including drone speed, altitude and battery level;
[0039] S4.2. Obtain the user's historical operation records, adjust the terminal interface layout according to the historical operations, and automatically adjust the interface layout and functions according to the user's behavior, preferences and environmental conditions, including the operation process of the drone;
[0040] S4.3. The synchronous tracking results and the adjusted interface layout are sent to the user terminal, and confirmation information from the user terminal is received.
[0041] The technical solution of the present invention also includes: a drone tracking system based on SLAM algorithm, used to implement any of the above-mentioned drone tracking methods, including: a parameter acquisition module, an algorithm optimization module, a target tracking module, and an operation adjustment module.
[0042] Compared with the prior art, the present invention adopts the above technical solution and has the following technical effects:
[0043] The drone tracking method based on the SLAM algorithm of the present invention obtains the drone's endurance, coverage, shooting ability, positioning accuracy and image quality by acquiring the drone's parameters; completes image recognition and locks the tracking target by acquiring the drone's flight images in real time; optimizes the SLAM algorithm by acquiring the drone's historical flight data, extracts environmental features, and realizes real-time establishment of an environmental map to achieve autonomous navigation and obstacle avoidance of the drone; further, a tracking algorithm is constructed according to the drone's flight data, the detection results in the continuous images are matched with the existing tracking targets, the terminal interface layout is adjusted according to the historical operations, and the interface layout and functions are automatically adjusted according to the user's behavior, preference and environmental conditions, thereby solving the problems of being unable to track the object's motion in real time and being difficult to adapt to complex environmental changes. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] Figure 1 This is a flow chart of the drone tracking method based on the SLAM algorithm of the present invention;
[0045] Figure 2 This is a flow chart of the steps of optimizing the SLAM algorithm to extract environmental features based on UAV flight data in the present invention;
[0046] Figure 3 A flow chart of the steps for constructing a tracking algorithm for the present invention;
[0047] Figure 4 A flowchart of the steps of adjusting the terminal interface layout and sending it to the user terminal according to the present invention;
[0048] Figure 5 This is an architecture diagram of a drone tracking system based on a SLAM algorithm according to an embodiment of the present invention;
[0049] Figure 6 This is a diagram of the algorithm optimization module architecture of an embodiment of the present invention;
[0050] Figure 7 This is a diagram of the target tracking module architecture of an embodiment of the present invention;
[0051] Figure 8 This is an architecture diagram of the operation adjustment module according to an embodiment of the present invention. DETAILED DESCRIPTION
[0052] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the application is further elaborated in detail below in conjunction with the accompanying drawings. The described embodiments are only a part of the embodiments involved in the present invention. All non-innovative embodiments of other researchers in the field on this embodiment belong to the protection scope of the present invention. At the same time, for the step numbering in the embodiment of the present invention, it is only set for the convenience of explanation, and the order between the steps is not limited in any way. The execution order of each step in the embodiment can be adaptively adjusted according to the understanding of those skilled in the art.
[0053] In one embodiment of the present invention, a drone tracking method based on a SLAM algorithm is provided. Figure 1 As shown, the following steps are included:
[0054] S100, obtaining drone parameters, obtaining drone flight images in real time, and preprocessing them. Based on the preprocessed flight images, the current position of the drone and the camera coverage range are obtained, image recognition is completed, and the target is locked and followed;
[0055] S200, obtain UAV flight data, optimize SLAM graph based on flight data based on SLAM algorithm, use convolutional neural network to extract environmental features, and improve the accuracy of SLAM algorithm;
[0056] S300, builds a tracking algorithm based on the real-time flight data of the drone to track and shoot the target in real time;
[0057] S400, tracking the target in real time and adapting to environmental changes, sending the movement trajectory of the target and the interface layout adjusted according to historical operations to the user terminal for display.
[0058] In this embodiment, the drone tracking method based on the SLAM algorithm is as follows:
[0059] S100, obtaining drone parameters, including physical properties, performance indicators, control system and sensor configuration, and obtaining drone flight images in real time.
[0060] Among them, obtaining the parameters of the drone refers to obtaining the size and weight of the drone. The size includes the size in the unfolded and folded states, and the weight includes the take-off weight and the maximum take-off weight. The size and weight determine the portability of the drone and the requirements for flight permission.
[0061] Get the maximum flight time of the drone, which refers to the maximum time the drone can fly in a single flight under ideal conditions; the maximum flight time, which refers to the maximum time the drone can fly in a single flight under ideal conditions; the maximum flight altitude, which refers to the highest altitude the drone can reach; the maximum flight speed, which refers to the maximum speed the drone can reach in level flight; the wind resistance level, which refers to the maximum wind speed the drone can withstand. Through the above parameters, you can know the drone's endurance, coverage, and performance in bad weather;
[0062] Get the camera and image sensor parameters of the drone. In this embodiment, the sensor type and size are: 1 / 2.3-inch CMOS; resolution: 4K, 1080p, which affects the quality of videos and photos; field of view (FOV): the angle range that the camera can cover; aperture: f / 2.8, which affects the amount of light entering and the depth of field; stabilization system: three-axis mechanical gimbal, used to reduce jitter. The above parameters can be used to know the drone's flight time and charging efficiency;
[0063] Obtain the drone's sensors and obstacle avoidance system. In this embodiment, they include: GPS / GLONASS for positioning and navigation; obstacle avoidance sensors, such as forward, backward, and downward obstacle avoidance, for automatically avoiding obstacles; and visual sensors for intelligent following and fixed-point hovering. The above parameters can be used to determine the drone's positioning accuracy and flight safety.
[0064] Acquire UAV flight images in real time. Through the flight images, you can know the current location of the UAV and the coverage of the camera. In addition, you can use the flight images to complete image recognition or other sensor recognition and lock the target.
[0065] Preprocess the UAV flight images, adjust the image size and normalize the image pixel values;
[0066] Preprocess the real-time drone flight images, resize and normalize the images taken by the drone,
[0067] The drone parameters and preprocessed drone flight images are used as input data, and the SLAM algorithm is used to obtain the current position of the drone and the camera coverage range, complete image recognition, and lock the tracking target.
[0068] S200, obtains UAV flight data, based on SLAM algorithm, optimizes SLAM graph according to flight data, uses convolutional neural network to extract environmental features, and improves SLAM algorithm accuracy, such as Figure 2 As shown, including:
[0069] S201. Acquire sensor data in real time, where the sensor data includes lidar data, visual camera data, and inertial measurement unit (IMU) data.
[0070] Each sensor makes up for the shortcomings of the other, for example, lidar performs well in low-light environments, while visual SLAM can provide richer environmental details.
[0071] Obtain UAV flight data and optimize the SLAM algorithm through flight data. By utilizing different types of sensor data fusion, the robustness and accuracy of SLAM can be improved, and the accuracy and real-time performance of map building and positioning can be improved.
[0072] Specifically, in this embodiment, the ORB-SLAM3 or VINS-Fusion method is used to fuse the inertial measurement unit IMU data with the visual camera data, combined with EKF (extended Kalman filter), and a sliding average method is used to obtain more accurate data, while removing random noise in the data, thereby improving the robustness and accuracy of the SLAM algorithm, and improving the tracking stability and map accuracy in a dynamic environment.
[0073] S202: construct an observation map based on the sensor data, wherein the observation map includes observation data and state variables, and query the drone path and map configuration through the observation map.
[0074] In this embodiment, an observation graph is constructed based on sensor data, and the problem of optimizing the path and map configuration of the drone is solved by constructing a graph containing all observation data and state variables and optimizing the graph to find the most likely drone path and map configuration, and then finding the best solution through mathematical optimization methods;
[0075] State variables usually include the position and direction of the drone, as well as the location of feature points in the map. Observation data refers to the information obtained by the drone through sensors, such as distance, angle, etc. Each edge has an error function, which represents the difference between the observation data and the current state variable. The state variables are adjusted by minimizing the sum of the error functions of all edges to obtain the optimal path and map configuration.
[0076] Specifically, an observation graph is constructed based on the sensor data. For SLAM graph optimization, an error function F is constructed. The error function is usually based on the difference between the observed data and the predicted state. The formula is as follows:
[0077] ;
[0078] Among them, the state variables include: the position of the drone at different times , and the location of the drone observing the landmark ; The observed data is , indicating that from the position To landmark The actual observation distance; yes and The theoretical distance between them is adjusted by iteratively optimizing this error function. and The position of the drone is minimized to minimize the observation error, thus obtaining a more accurate drone path and landmark position.
[0079] These errors are constructed as a nonlinear least squares problem to perform SLAM graph optimization, integrate all edge error functions, and construct the following nonlinear least squares formula to minimize the sum of all edge error functions:
[0080] ;
[0081] Among them, x represents the set of all state variables, and E is the set of all edges;
[0082] Adjust the state variables. Since the error function is nonlinear, it is usually solved using an iterative linearization method. In each iteration, the state variables are updated by solving a set of linear equations. The formula is:
[0083] ;
[0084] Where H is the Hessian matrix, reflecting the second-order partial derivative of the error function with respect to the state variable, g is the gradient vector, representing the first-order partial derivative of the error function with respect to the state variable, λ is an adjustment parameter used to ensure positive definiteness, and I is the identity matrix;
[0085] Update the state variable x according to the solved Δx, re-evaluate the error, and perform the next iteration based on the observation data and state variables of the drone at the next moment. When the error no longer decreases significantly or reaches the preset number of iterations, complete the SLAM graph optimization and obtain the optimal drone path and landmark position.
[0086] S203, obtaining historical flight data of the UAV, processing the historical flight data through a convolutional neural network to optimize the SLAM algorithm, and extracting environmental features according to the SLAM algorithm.
[0087] By using convolutional neural networks (CNNs) to extract environmental features to improve feature extraction and data association, the SLAM system's adaptability to complex environments can be enhanced, and its accuracy and speed can be improved. CNN is a powerful tool for extracting environmental features, especially for dealing with texture-rich or dynamically changing environments. CNN automatically learns and extracts features through multiple layers of convolutional layers. In texture-rich environments, deeper network structures can be used to capture complex features. Each convolutional layer typically includes a convolution operation, an activation function (such as ReLU), and a pooling layer to reduce the spatial size of the features and improve the invariance of the features. When training CNN, a large amount of historical drone flight data is required, and the network learns to map the input image to its environmental feature representation. The verification phase is used to evaluate the model's generalization ability on unseen data;
[0088] In this embodiment, the CNN used is Mask R-CNN (Instance Segmentation Model), which can simultaneously identify the category, location and outline of objects in an image. In a dynamically changing environment, such as in a crowd or around a moving object, Mask R-CNN can identify and track multiple objects in real time, providing more detailed environmental feature information.
[0089] Specifically, Mask R-CNN uses Backbone Network as the basic feature extractor to generate multi-level feature maps, which contain visual information from low-level (edges, textures) to high-level (object parts, overall shape). Based on the feature map, the RPN (Region Proposal Network) first slides on the high-level feature map of the network to generate a series of RoIs (Region of Interest, candidate regions). This step is implemented through convolution operations, which is efficient and parallel. Then the selected RoI passes through the RoI Align layer to extract a fixed-size feature vector in preparation for further classification and segmentation. Finally, the category of each RoI is determined by the classification branch, and the precise outline of the target is predicted by the mask branch.
[0090] S300, based on the real-time flight data of the drone, builds a tracking algorithm to track and shoot the target in real time, such as Figure 3 As shown, specifically including:
[0091] S301. Acquire UAV flight images in real time, and locate and identify targets through deep learning models.
[0092] By applying data enhancement, the generalization ability of the model is increased, such as rotation and scaling; by selecting appropriate deep learning models for target detection, positioning and recognition of targets.
[0093] Choose a suitable deep learning model for target detection. Commonly used models include YOLO (You Only LookOnce), SSD (Single Shot MultiBox Detector), Faster R-CNN, etc. These models can quickly and accurately locate and identify a variety of targets in images;
[0094] Specifically, in this embodiment, Yolov5 is used for target detection. Yolov5 is a very fast target detection network that can accurately detect multiple targets in real-time videos. COCO (Common Objects in Context) is used for model training.
[0095] COCO is a dataset for target detection, segmentation, and key point detection, containing more than 200,000 images and 80 categories. Prepare data and algorithms: Use the test set of the COCO dataset to run the target detection algorithm and obtain the detection results. By training on the COCO dataset, Yolov5 can recognize and locate 80 different object categories, which provides a strong starting point for target tracking.
[0096] S302: construct a tracking algorithm based on the UAV flight data, track and identify the target through the tracking algorithm, obtain the tracking result, and synchronize the tracking result to the terminal.
[0097] According to the UAV flight data, the tracking algorithm is constructed. After the target is detected, the tracking algorithm can be SORT (Simple Online and Realtime Tracking), DeepSORT, KCF (Kernelized Correlation Filters), etc., to match the detection results in the continuous frames with the existing tracking targets. This can be achieved through appearance features, motion information, or a combination of the two. According to the results of data association, the state of the target, such as position and speed, is updated. In the case of target loss, a prediction model is used to estimate the possible position of the target.
[0098] In this embodiment, the tracking algorithm is the DeepSORT algorithm, which is an enhanced version of SORT that improves data association and target tracking by using features extracted by deep learning.
[0099] When combined with the targets detected by Yolov5, DeepSORT can achieve stable multi-target tracking in complex environments, such as crowds and fast-moving objects, match the detection results in consecutive frames with the existing tracking targets, and update the tracking target status, including the position and speed of the tracking target, according to the results of data association through the drone's appearance features, motion information, or a combination of both, to perform multi-target tracking.
[0100] Specifically: the targets detected based on yolov5 deep learning, including the position (bounding box coordinates) of each candidate target. Then use the Kalman filter to predict the possible position of the target in the previous frame in the current frame to deal with the situation where the target disappears or is temporarily blocked, and match the target based on the predicted position and appearance features. Appearance feature matching plays a key role in this process, especially when solving occlusion problems. Update the trajectory and identity information of each target based on the matching results, and handle newly appeared targets and disappeared targets. Finally, output a series of bounding boxes, ID identifiers and other information of the tracked targets, indicating the continuous tracking trajectory results of each target.
[0101] Evaluating the performance of target detection and tracking algorithms usually involves using standard datasets and a series of quantitative indicators. Standard datasets provide a set of predefined images or videos and their corresponding ground truths for evaluation, which annotate the location and category of the target. Commonly used datasets include:
[0102] MOT (Multiple Object Tracking): A dataset focused on multiple object tracking, providing video sequences and ground truth annotations in multiple scenarios;
[0103] VOT (Visual Object Tracking): A tracking dataset containing short video sequences, each with detailed annotations of a single object;
[0104] Using DeepSORT on the MOT dataset: Use the MOT test video, run the DeepSORT algorithm, obtain the tracking results, and calculate MOTA and MOTP: The MOTA comprehensively considers false detections, missed detections, and identity switching, and the MOTP measures the matching accuracy of the tracking bounding box with the true value.
[0105] Analysis results: These indicators (MOTA, MOTP) are used to understand the performance of the DeepSORT algorithm in dealing with occlusion and interaction.
[0106] S303, evaluating the tracking result to obtain an evaluation result, comparing the evaluation result with a threshold, and if the evaluation result exceeds the threshold, determining that the tracking is inaccurate, and rebuilding the tracking algorithm.
[0107] The tracking results are evaluated. During the tracking process, online learning is used to adapt to changes in the target appearance and improve the robustness of tracking. In order to comprehensively evaluate the performance of detection and tracking, the performance of detection and tracking algorithms is evaluated using standard datasets and evaluation indicators.
[0108] In this embodiment, the evaluation indicators used include precision, recall, IoU, etc.
[0109] Precision: reflects how many of the detected positive classes are true positive classes. The formula is:
[0110] ;
[0111] Among them, TP is the true positive (the number of targets detected correctly) and FP is the false positive (the number of targets detected incorrectly).
[0112] Recall: reflects how many of all positive classes are correctly detected, and the formula is:
[0113] ;
[0114] Where FN is the false negatives (the number of true targets that were not detected).
[0115] IoU (Intersection over Union): Measures the degree of overlap between the predicted bounding box and the true bounding box. The formula is:
[0116] ;
[0117] Among them, Area of Overlap represents the intersection area of the predicted box and the true box, and Area of Union represents the union area of the two.
[0118] Calculate precision and recall: For each image, compare the bounding box detected by the algorithm with the ground truth.
[0119] For detection and tracking, a detection or tracking is usually considered correct only when the IoU exceeds a certain threshold (such as 0.5). If the IoU between the detection box and the true value box is greater than 0.5, the detection is considered correct (TP). The TP, FP, and FN of all images are counted to calculate the precision and recall of the entire dataset.
[0120] Draw the PR curve: Change the IoU threshold, calculate the precision and recall under different thresholds, and draw the PR curve. The area under the curve (AP, Average Precision) is a commonly used comprehensive evaluation indicator.
[0121] S400, real-time tracking of the target, and adapting to environmental changes, the movement trajectory of the target and the interface layout adjusted according to historical operations are sent to the user terminal for display, such as Figure 4 As shown, specifically including:
[0122] S401. Acquire the flight data of the UAV in real time, wherein the flight data includes speed, altitude and battery power.
[0123] Obtain UAV flight data in real time and provide real-time flight data feedback, such as speed, altitude, battery level, etc., so that the operator can better control the flight status.
[0124] For example, on the main interface of the remote control terminal, the speed and altitude of the drone are displayed in real time in the form of a dashboard, making it easier for the operator to adjust strategies.
[0125] S402: Obtain historical operation records, and adjust the terminal interface layout according to the historical operations, wherein the interface layout includes the operation process of the drone.
[0126] Obtain historical operation records, adjust the terminal interface layout according to historical operations, simplify the operation process of the drone, and add intelligent interactive functions so that users can more easily specify the target and style of follow-up shooting;
[0127] For example, in the remote control terminal, icons are used instead of complex text descriptions, so that novices can quickly get started. A variety of flight modes are provided, such as manual, GPS positioning, follow mode, etc., which can be switched according to different flight needs. In urban environments, GPS positioning mode is used for stable flight, and in complex terrain, it is switched to manual mode for more flexible control.
[0128] S403: Send the adjusted interface layout to the user terminal, and receive confirmation information from the user terminal.
[0129] In this step, the tracking results are synchronized, and the tracking results and the adjusted interface layout are sent to the user terminal. After browsing, if the user terminal thinks that the adjusted interface layout is more convenient, it confirms and receives the confirmation information of the user terminal.
[0130] This embodiment also provides a drone tracking system based on SLAM algorithm, which is used to implement the above-mentioned drone tracking method. Figure 5 As shown, including:
[0131] The parameter acquisition module 100 is used to acquire the parameters of the drone, including physical properties, performance indicators, control system and sensor configuration, and to acquire the flight image of the drone in real time.
[0132] The algorithm optimization module 200 is used to obtain UAV flight data and optimize the SLAM algorithm based on historical flight data. The robustness and accuracy of SLAM can be improved by utilizing different types of sensor data fusion, such as lidar, visual camera, inertial measurement unit IMU, etc., to improve the accuracy and real-time performance of map building and positioning. By using convolutional neural network (CNN) to extract environmental features to improve feature extraction and data association, the adaptability of the SLAM system to complex environments can be enhanced, and the accuracy and speed can be improved.
[0133] Furthermore, if Figure 6 As shown, the algorithm optimization module 200 includes:
[0134] The sensor acquisition unit 201 is used to acquire sensor data in real time, wherein the sensor data includes laser radar data, visual camera data and inertial measurement unit IMU data.
[0135] The observation map construction unit 202 is used to construct an observation map based on the sensor data. The observation map includes observation data and state variables, and the drone path and map configuration are queried through the observation map.
[0136] The algorithm optimization unit 203 is used to obtain the historical flight data of the UAV, process the historical flight data through the convolutional neural network to optimize the SLAM algorithm, and extract environmental features according to the SLAM algorithm. CNN automatically learns and extracts features through multiple convolutional layers. In a texture-rich environment, a deeper network structure can be used to capture complex features. Each convolutional layer usually includes a convolution operation, an activation function (such as ReLU), and a pooling layer to reduce the spatial size of the feature and improve the invariance of the feature. When training CNN, a large amount of historical flight data of the UAV is required, and the network learns to map the input image to its environmental feature representation. The verification stage is used to evaluate the generalization ability of the model on unseen data; CNN can effectively extract environmental features in complex and dynamic environments, providing more accurate and robust data support for the SLAM system.
[0137] The target tracking module 300 is used to pre-process the real-time acquired UAV flight images and construct a tracking algorithm based on the UAV flight data, wherein the tracking algorithm is used to track the target.
[0138] Furthermore, if Figure 7 As shown, the target tracking module 300 includes:
[0139] The image preprocessing unit 301 is used to preprocess the real-time acquired UAV flight image, locate and identify the target through a deep learning model, and the deep learning model is used for target detection.
[0140] The tracking algorithm construction unit 302 is used to construct a tracking algorithm according to the UAV flight data, track and identify the target through the tracking algorithm, obtain the tracking result, and synchronize the tracking result to the terminal.
[0141] The evaluation unit 303 is used to evaluate the tracking results. During the tracking process, online learning is used to adapt to changes in the target appearance and improve the robustness of tracking. The performance of the detection and tracking algorithm is evaluated through standard data sets and evaluation indicators, such as precision, recall, IoU, etc. The evaluation result is obtained, and the evaluation result is compared with the threshold. If the evaluation result exceeds the threshold, it is determined that the tracking is inaccurate and the tracking algorithm is rebuilt.
[0142] The operation adjustment module 400 is used to adjust the terminal interface layout according to historical operations, automatically adjust the interface layout and functions according to the user's behavior, preferences and environmental conditions to adapt to the user's habits and needs, send the adjusted interface layout to the user terminal, and determine the interface layout after confirmation by the user terminal to achieve better control of the drone.
[0143] Furthermore, if Figure 8 As shown, the operation adjustment module 400 includes:
[0144] The flight data acquisition unit 401 is used to acquire the UAV flight data in real time and provide real-time flight data feedback, such as speed, altitude, power, etc., so that the operator can better control the flight status.
[0145] The operation adjustment unit 402 is used to obtain historical operation records, adjust the terminal interface layout according to historical operations, simplify the operation process of the drone, and add intelligent interactive functions so that users can more easily specify the tracking target and style.
[0146] The confirmation unit 403 is used to send the adjusted interface layout to the user terminal. After browsing, if the user terminal considers that the adjusted interface layout is more convenient, it will confirm and receive confirmation information from the user terminal.
[0147] In summary, the drone tracking method based on the SLAM algorithm of the present invention obtains the drone's endurance, coverage, shooting capability, positioning accuracy and image quality by acquiring the drone parameters; completes image recognition and locks the tracking target by acquiring the drone's flight images in real time; optimizes the SLAM algorithm by acquiring the drone's historical flight data, extracts environmental features, and realizes real-time establishment of an environmental map to achieve autonomous navigation and obstacle avoidance of the drone; further, by constructing a tracking algorithm based on the drone's flight data, matching the detection results in the continuous images with the existing tracking targets, adjusting the terminal interface layout based on historical operations, and automatically adjusting the interface layout and functions based on the user's behavior, preferences and environmental conditions, the problems of being unable to track the object's motion in real time and being difficult to adapt to complex environmental changes are solved.
[0148] The above is only a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principle of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.
Claims
1. A drone tracking method based on SLAM algorithm, It is characterized in that The steps include: S1. Obtain the parameters of the drone, obtain the drone flight image in real time, and pre-process it. Based on the pre-processed flight image, obtain the current position of the drone and the camera coverage range, complete image recognition, and lock the target for tracking; S2. Obtain UAV flight data, optimize the SLAM graph based on the flight data based on the SLAM algorithm, use convolutional neural networks to extract environmental features, and improve the accuracy of the SLAM algorithm, including: S2.
1. Based on the sensor data acquired in real time, sensor data fusion is performed to improve the robustness and accuracy of the SLAM algorithm; the sensor data includes lidar data, visual camera data and inertial measurement unit IMU data; Fusion of different types of sensor data, using ORB-SLAM3 or VINS-Fusion method, fusing IMU data with visual camera data, combined with ekf extended Kalman filter, and using sliding average method to obtain more accurate data, while removing random noise in the data, improving the robustness and accuracy of SLAM algorithm; S2.2, construct an observation map, query the drone path and map configuration through the observation map, perform SLAM map optimization, and find the optimal drone path and landmark location; The observation map includes observation data and state variables; the state variables include the position and direction of the drone, and the position of feature points in the map; the observation data is information obtained by the drone through sensors, including distance and angle; The observation graph is constructed based on the sensor data, and the SLAM graph is optimized. The error function F of each edge of the observation graph is constructed to represent the difference between the observation data and the current state variable. The formula is as follows: ; Among them, the state variables include: the position of the drone at different times , and the location of the drone observing the landmark ; The observed data is , indicating that from the position To landmark The actual observation distance; yes and The theoretical distance between For drones in position The error function is adjusted and The position of the observation is minimized; Perform SLAM graph optimization, integrate all edge error functions, construct a nonlinear least squares formula, and minimize the sum of all edge error functions, as shown below: ; Among them, x represents the set of all state variables, and E is the set of all edges; Adjust the state variables. Since the error function is nonlinear, the iterative linearization method is used to solve it. In each iteration, the state variables are updated by solving the linear equations. The formula is: ; Where H is the Hessian matrix, reflecting the second-order partial derivative of the error function with respect to the state variable, g is the gradient vector, representing the first-order partial derivative of the error function with respect to the state variable, λ is an adjustment parameter used to ensure positive definiteness, and I is the identity matrix; Update the state variable x according to the solved Δx, re-evaluate the error, and perform the next iteration based on the observation data and state variables of the drone at the next moment. When the error no longer decreases significantly or reaches the preset number of iterations, complete the SLAM graph optimization and obtain the optimal drone path and landmark position; S2.3, obtain real-time flight data of the UAV, process the flight data through convolutional neural network, extract environmental features, improve feature extraction and data association, and optimize the SLAM algorithm; S3. Build a tracking algorithm to track and photograph the target based on the real-time flight data of the drone; S4. Track the target in real time and adapt to environmental changes. Send the target's motion trajectory and the interface layout adjusted according to historical operations to the user terminal for display.
2. The drone tracking method based on SLAM algorithm according to claim 1, It is characterized in that In step S1, the drone parameters include the physical properties, performance indicators, control system and sensor configuration of the drone, as follows: S1.
1. Obtain the parameters of the drone to obtain the drone's endurance, coverage, and performance in severe weather conditions; including: drone size and weight, maximum flight time, maximum flight altitude, maximum flight speed, and wind resistance level; S1.
2. Obtain the parameters of the drone camera and image sensor to obtain the drone camera's battery life and charging efficiency; including: camera sensor type, size, resolution, aperture, angle range covered, and stabilization system; S1.
3. Obtain the drone's sensors and obstacle avoidance system to obtain the drone's positioning accuracy and flight safety; including: GPS and / or GLONASS sensors for positioning and navigation, obstacle avoidance sensors for automatic obstacle avoidance, and visual sensors for intelligent following and fixed-point hovering; Acquire UAV flight images in real time, perform preprocessing, adjust image size and normalize image pixel values; The drone parameters and preprocessed drone flight images are used as input data, and the SLAM algorithm is used to obtain the current position of the drone and the camera coverage range, complete image recognition, and lock the tracking target.
3. The drone tracking method based on SLAM algorithm according to claim 2, It is characterized in that In step S2.3, the SLAM algorithm is optimized by extracting environmental features using a convolutional neural network to improve feature extraction and data association; The convolutional neural network is a Mask R-CNN instance segmentation model, which is used to identify and track multiple objects in real time in a dynamically changing environment, and simultaneously identify and extract environmental features of multiple tracking targets, including the category, position and outline of the target objects; Backbone Network is used as a basic feature extractor to generate a multi-level feature map, which contains low-level feature information from the edge and texture of the target object to high-level visual information of the object's part and overall shape; Based on the feature map, through convolution operation, RPN first slides on the high-level feature map of the network to generate candidate regions; then the candidate regions pass through the RoI Align layer to extract feature vectors of fixed size in preparation for further classification and segmentation; finally, the category of each candidate region is determined through the classification branch, and the precise outline of the tracking target is predicted through the mask branch.
4. The drone tracking method based on SLAM algorithm according to claim 1, It is characterized in that In step S3, a tracking algorithm is constructed based on the real-time flight data of the drone, which specifically includes: S3.
1. Based on the real-time flight data of the UAV, data enhancement is used to increase the generalization ability of the image, and the target detection, positioning and identification of the follow-up target are performed through the deep learning model; the deep learning model is the Yolov5 target detection model, which is trained on the COCO dataset, and the test set of the COCO dataset is used to run the Yolov5 target detection algorithm to obtain the detection result of the follow-up target; S3.
2. Build a tracking algorithm based on the real-time flight data of the drone, track and shoot the target through the tracking algorithm, match the target based on the predicted position and appearance features, solve the problem of temporary disappearance or occlusion of the target, and obtain the tracking result; S3.
3. Evaluate the tracking result, obtain the evaluation result, compare the evaluation result with the threshold, and if the evaluation result exceeds the threshold, determine that the tracking is inaccurate, and rebuild the tracking algorithm.
5. The drone tracking method based on SLAM algorithm according to claim 4, It is characterized in that In step S3.2, the tracking algorithm is the DeepSORT algorithm. The DeepSORT algorithm is used on the MOT data set, the MOT test video is used, the DeepSORT algorithm is run, the tracking results are obtained, and the MOTA and MOTP are calculated; the MOTA comprehensively considers the false detection, missed detection and identity switching, and the MOTP measures the matching accuracy of the tracking boundary box and the true value box; Match the detection results in the continuous frames with the existing tracking targets, and update the tracking target status, including the position and speed of the tracking target, according to the results of data association through the appearance features, motion information or a combination of the two, and perform multi-target tracking, including the following sub-steps: S3.2.
1. Based on the deep learning Yolov5 target detection model, the detected tracking targets include the bounding box coordinates of each candidate target location; S3.2.2, Use the Kalman filter to predict the possible position of the target in the previous frame in the current frame to deal with the situation where the target disappears or is temporarily blocked, and match the target based on the predicted position and appearance features; S3.2.3, then update the trajectory and identity information of each target according to the matching results, and handle the newly appeared and disappeared follow-up targets; S3.2.
4. Finally, a series of tracking target information is output, including bounding boxes and ID identifier information, indicating the continuous tracking trajectory results of each tracking target.
6. The drone tracking method based on SLAM algorithm according to claim 5, It is characterized in that In step S3.3, the tracking results are evaluated, and the evaluation indicators include: S3.3.1, Precision, is used to reflect the true positive class detected in the positive class, the formula is: ; Among them, TP is the true positive, which indicates the number of correctly detected targets, and FP is the false positive, which indicates the number of incorrectly detected targets; S3.3.2, Recall, is used to reflect the positive class that is correctly detected, and the formula is: ; Among them, FN is the false negative example, which means the number of real targets that are not detected; S3.3.3, Intersection over Union (IoU), is used to measure the degree of overlap between the bounding box and the true value box. The calculation formula is: ; in, represents the intersection area of the bounding box and the true value box, Represents the union area of the bounding box and the true value box; For each image, compare the bounding box detected by the tracking algorithm with the true value box. If the IoU between the bounding box and the true value box is greater than 0.5, the detection is considered to be the correct TP. TP, FP and FN of all images are counted, and the precision and recall of the entire image dataset are calculated; draw the PR curve, change the IoU threshold, calculate the precision and recall under different thresholds, draw the PR curve, and use the area under the curve AP as a comprehensive evaluation indicator; analyze the results and obtain the performance of the DeepSORT algorithm in dealing with occlusion and interaction.
7. A drone tracking system based on SLAM algorithm, used to implement the drone tracking method according to any one of claims 1 to 6, It is characterized in that include: Parameter acquisition module, algorithm optimization module, target tracking module, operation adjustment module; The parameter acquisition module acquires the parameters of the drone, including physical properties, performance indicators, control system and sensor configuration, and acquires the flight image of the drone in real time; The algorithm optimization module obtains the sensor data and flight data of the drone, fuses the sensor data according to the flight data, constructs an observation map, improves the robustness and accuracy of the SLAM algorithm, and improves feature extraction and data association by extracting environmental features using a convolutional neural network, thereby enhancing the adaptability of the SLAM system to complex environments; it includes: a sensor acquisition unit that acquires sensor data in real time, including lidar data, visual camera data, and inertial measurement unit IMU data; an observation map construction unit; and an algorithm optimization unit that optimizes the SLAM algorithm by processing flight data through a convolutional neural network; The target tracking module pre-processes the real-time drone flight images, builds a tracking algorithm based on the drone flight data, tracks and shoots the target, and evaluates the tracking results; it includes: an image pre-processing unit, a tracking algorithm building unit, and an evaluation unit; The operation adjustment module adjusts the interface layout according to the user's behavior, preference and environmental conditions to adapt to the user's habits and needs, and sends the adjusted interface layout to the user terminal, and interacts with the user terminal to determine the interface layout; it includes: a flight data acquisition unit, an operation adjustment unit, and a confirmation unit.
Citation Information
Cited By
A UAV tracking processing method and system based on image recognition
CN119206557B
