Target trajectory visualization method oriented to unmanned aerial vehicle platform motion condition
By using the SORT algorithm and SIFT feature point matching to calculate the perspective transformation homography matrix on the UAV platform, the problem of UAV motion interference is solved, and a method for accurately drawing the true movement trajectory of ground vehicles under the UAV platform is realized. , ensuring the continuity and stability of the trajectory.
Patent Information
- Application Number
- CN202410635529.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-22
- Publication Date
- 2024-08-30
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
Under the movement conditions of the UAV platform, the traditional target trajectory extraction method is easily affected by external factors such as wind speed and air flow, resulting in the drawn trajectory including the influence of the UAV's own movement and unable to accurately represent the true movement trajectory of the ground vehicle.
The SORT algorithm is used for target association, and the perspective transformation homography matrix is calculated through SIFT feature point matching to correct the inter-frame transformation, eliminate the impact of UAV motion on trajectory drawing, and ensure the continuity and stability of the trajectory.
It effectively eliminates the interference of the UAV movement on the trajectory, and the drawn trajectory results are continuous and stable, which can accurately present the real movement situation of the ground target and adapt to the situation of UAV displacement and small rise and fall.
Smart Images

Figure CN118570252A
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer vision technology, and more specifically, to a method for visualizing target trajectories under motion conditions of an unmanned aerial vehicle platform. Background Art
[0002] With the continuous development and popularization of drone technology, drones are increasingly being used in many fields such as environmental monitoring, agricultural plant protection, rescue and search. Among them, drone monitoring technology for ground vehicles is an urgent need to achieve intelligent security and intelligent transportation.
[0003] For moving targets such as ground vehicles, their position change is a key information. The dynamic change of the target position is generally achieved through trajectory visualization. Intuitively and accurately drawing the target trajectory and showing the movement route of the target object can better help humans perceive the situation changes in the drone's field of view.
[0004] At present, in UAV ground observation missions, the trajectory extraction of moving targets is generally achieved by connecting the image pixel positions of the same target in the historical frames in the current frame. However, in practical applications, the motion state of the UAV platform is easily affected by fluctuations in external factors such as wind speed and airflow. These factors will cause the target trajectory drawn by the traditional trajectory generation method to be not the real motion trajectory of the target, but a relative trajectory that includes the influence of the UAV's own motion, which will inevitably interfere with the accuracy of the target trajectory. In addition, operations such as image rotation and scale transformation that may occur during human control will also cause deviations in the observed target trajectory. Therefore, how to effectively eliminate the interference factors caused by the UAV movement and accurately present the real motion trajectory of the target has become a key issue that needs to be solved urgently. Summary of the invention
[0005] The purpose of the present invention is to provide a method for visualizing target trajectories under the motion conditions of an unmanned aerial vehicle platform, so as to overcome the defects existing in the prior art.
[0006] In order to achieve the above object, the technical solution adopted by the present invention is as follows:
[0007] A method for visualizing target trajectories under UAV platform motion conditions includes the following steps:
[0008] S1. Input the current frame image of the video into the trained target detection model to obtain the vehicle target detection result, and use the SORT algorithm to perform target association on the vehicle target detection result of the current frame and the vehicle target detection result of the previous frame to determine the position of each target in the current frame in the previous frame image;
[0009] S2, calculate the SIFT feature points and descriptors of the current frame image and the previous frame image, remove the feature points in the moving target frame, perform descriptor matching on the remaining feature points of the previous and next frames, and solve the perspective transformation homography matrix between the current frame image and the previous frame image;
[0010] S3, mapping all target frame positions of the previous frame image to the current frame image through perspective transformation homography matrix transformation, and connecting the center points of the detection frames of the same target in the current frame image to obtain the true motion trajectory of all targets in the current frame image from the previous frame image to the current frame image;
[0011] S4, looping steps S1 to S3, iteratively mapping the positions of all targets in the current frame image that have appeared in the historical frame images to the current frame image, and connecting the center points of the same target in sequence in time to draw the real motion trajectories of all targets in the current frame in the historical video.
[0012] Furthermore, the step S1 specifically includes:
[0013] S10, record the current frame image of the video as F c , the current frame image F of the video c Input the trained target detection model and output the detection results of all vehicle targets in the current frame: in, represents the i-th target bounding box detected in the current frame image, which includes 4 elements: the horizontal coordinate of the upper left corner of the target box, the vertical coordinate of the upper left corner of the target box, the width of the target box, and the height of the target box; Φ c is the set of all target frames in the current frame image. Similarly, for the previous frame video image F c-1 The test result can be recorded as Φ c-1 ;
[0014] S11, using the SORT algorithm to convert the detection result of the current frame image Φ c The detection result of the previous frame image Φ c-1 Association is performed to determine whether each target in the current frame image appears in the previous frame image and its position in the previous frame image.
[0015] Furthermore, the step S2 specifically includes:
[0016] S20, calculate the current frame image F c SIFT feature points and descriptors:
[0017]
[0018] In the formula, Indicates the mth SIFT feature point descriptor detected in the current frame video image, the previous frame image Fc-1 The SIFT feature points and descriptors are recorded as:
[0019]
[0020] S21, after removing the feature points on the vehicle target, the remaining feature point set Denoted as:
[0021]
[0022] In the formula, |Φ c | represents the set of points in all target boxes detected in the current frame;
[0023] S22, get the current frame feature point set With the feature point set of the previous frame For any two descriptors in , the Euclidean distance is used to calculate the similarity:
[0024]
[0025] In the formula, ||·|| 2 Represents the 2-norm. The higher the similarity, the more likely the two feature points are a matching point pair. By setting the threshold, all the matching point pairs of SIFT feature points in the previous and next frames can be obtained.
[0026] S23, assuming that the arbitrary coordinate position of the previous frame is recorded as The coordinate position mapped to the current frame is Then the mapping relationship between the two is written as:
[0027]
[0028] in, is the perspective transformation homography matrix H.
[0029] Theoretically, as long as four non-collinear matching point pairs can be extracted from the previous and next frames, the matrix can be solved.
[0030] Furthermore, the step S3 specifically includes:
[0031] Use the perspective transformation homography matrix H to transform the j-th target detection box in the previous frame image The center point Map to the current frame image and get the new coordinates:
[0032]
[0033] According to the target association results of the previous and next frames, if the jth target frame of the previous frame image The i-th target box of the current frame image If the targets included are the same target, and They are displayed simultaneously in the current frame image and connected to draw the trajectory of the i-th target in the current frame image in the two previous and next frames.
[0034] Furthermore, the step S4 is specifically as follows: looping steps S1 to S3, iteratively mapping the positions of all targets in the current frame image that have appeared in the historical frame images to the current frame image, and connecting the center points of the same target in sequence in time to draw the real motion trajectories of all targets in the current frame in the historical video.
[0035] Compared with the prior art, the advantages of the present invention are as follows: the present invention is aimed at the UAV ground observation task, and aims to draw the real motion trajectory of the ground target in the field of view, so as to help people more intuitively grasp the motion situation of the moving target in the UAV field of view. Moreover, in order to eliminate the influence of the UAV movement on the drawing of the ground target motion trajectory, the present invention offsets the field of view changes caused by the UAV movement by correcting the perspective transformation between frames, and the drawn trajectory result is continuous and stable, which can effectively deal with the displacement of the UAV, small amplitude rise and fall, etc. BRIEF DESCRIPTION OF THE DRAWINGS
[0036] 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 some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0037] Figure 1 It is a flow chart of the target trajectory visualization method under the motion conditions of the UAV platform of the present invention.
[0038] Figure 2 This is a comparison of the target trajectory drawing results of the present invention and other trajectory drawing methods under the condition of UAV motion. DETAILED DESCRIPTION
[0039] The preferred embodiments of the present invention are described in detail below in conjunction with the accompanying drawings so that the advantages and features of the present invention can be more easily understood by those skilled in the art, thereby making a clearer and more definite definition of the protection scope of the present invention.
[0040] See also Figure 1 As shown, this embodiment discloses a method for visualizing target trajectories under the motion conditions of a UAV platform, comprising the following steps:
[0041] Step S1, input the current frame image of the video into the trained target detection model to obtain the vehicle target detection result, and use the SORT algorithm to perform target association on the vehicle target detection result of the current frame and the vehicle target detection result of the previous frame to determine the position of each target in the current frame in the previous frame image;
[0042] Step S2, calculating the SIFT feature points and descriptors of the current frame image and the previous frame image, removing the feature points in the moving target frame, performing descriptor matching on the remaining feature points of the previous and next frames, and solving the perspective transformation homography matrix between the current frame image and the previous frame image;
[0043] Step S3, mapping all target frame positions of the previous frame image to the current frame image through perspective transformation homography matrix transformation, and connecting the center points of the detection frames of the same target in the current frame image to obtain the true motion trajectory of all targets in the current frame image from the previous frame image to the current frame image;
[0044] Step S4, looping steps S1 to S3, iteratively mapping the positions of all targets in the current frame image that have appeared in the historical frame images to the current frame image, and connecting the center points of the same target in sequence in time to draw the real motion trajectories of all targets in the current frame in the historical video.
[0045] In conjunction with the UAV infrared imaging situation awareness task, specifically, the step S1 specifically includes:
[0046] Step S10: Collect the infrared imaging data of the drone, mark the vehicle targets, and train the YOLOv5 target detection model. The fully trained YOLOv5 model has good detection performance for vehicle targets.
[0047] The current frame of the video is recorded as F c , the current frame image F of the video c Input the trained target detection model and output the detection results of all vehicle targets in the current frame: in, represents the i-th target bounding box detected in the current frame image, which includes 4 elements: the upper left corner abscissa of the target box, the upper left corner ordinate of the target box, the target box width and the target box height; Φc is the set of all target boxes in the current frame image. Similarly, for the previous frame video image F c-1 The test result can be recorded as Φ c-1 .
[0048] Step S11, based on the target detection results, the SORT algorithm is combined with the Kalman filter and the Hungarian algorithm to associate the targets of the previous and next frames. Among them, the Kalman filter is used to predict the motion trajectory of the target. It can predict the target position of the current frame based on the target position and speed information of the previous frame, and can maintain continuous tracking of the target even if the target is temporarily blocked or lost. The Hungarian algorithm is used for data association, and by calculating the similarity matrix between the targets, the target that truly matches between the previous and next frames is found.
[0049] Use the SORT algorithm to convert the detection result of the current frame image into c The detection result of the previous frame image Φ c-1 Association is performed to determine whether each target in the current frame image appears in the previous frame image and its position in the previous frame image.
[0050] Figure 2 The first line is the original image sequence of the drone's infrared imaging of the ground. From the figure, we can see that the background such as buildings is moving upwards. Therefore, during this imaging process, the drone is moving downwards. If we directly use the above target association results to connect the position coordinates of the same target in consecutive frames in the current frame, the result will be as follows: Figure 2 As shown in the second row, the bus with ID number 26 is a stationary target, but it has an obvious moving track. Obviously, this "conventional" trajectory drawing method is unreasonable under the condition of drone movement.
[0051] The reason why the "conventional" trajectory drawing method is not feasible is that the method does not take into account the movement of the drone. Therefore, the present invention adopts a method of correcting the perspective transformation between frames through SIFT feature point matching to overcome the influence of the drone movement on the drawing trajectory.
[0052] Specifically, in step S2:
[0053] Step S20: SIFT feature points are scale and rotation invariant, so the present invention uses SIFT feature point matching to correct the subsequent inter-frame perspective transformation. Calculate the current frame image F c SIFT feature points and descriptors:
[0054]
[0055] In the formula, Indicates the mth SIFT feature point descriptor detected in the current frame video image, the previous frame image F c-1 The SIFT feature points and descriptors are recorded as:
[0056]
[0057] Step S21: Considering the movement of the vehicle target, the feature points detected on the vehicle target will have a negative impact on the correct registration between the previous and next frame images (such as Figure 2 As shown in the third row, the specific analysis is shown below). Therefore, in order to improve the robustness of the method, the present invention removes the feature points in the target frame.
[0058] After removing the feature points on the vehicle target, the remaining feature point set Denoted as:
[0059]
[0060] In the formula, |Φ c | represents the set of points within all target boxes detected in the current frame.
[0061] Step S22: SIFT feature point matching between the previous and next frames can be achieved by measuring the similarity of the descriptors. With the feature point set of the previous frame For any two descriptors in , the Euclidean distance is used to calculate the similarity:
[0062]
[0063] In the formula, ||·|| 2 It represents the 2-norm. The higher the similarity, the more likely the two feature points are a matching point pair. By setting the threshold, all the matching point pairs of SIFT feature points in the previous and next frames can be obtained.
[0064] Step S23, the extraction of SIFT feature point matching pairs is to solve the perspective transformation of the previous and next frames of the video. This perspective transformation originates from the movement of the drone and is essentially used to describe the imaging changes of the same scene from different perspectives. The perspective transformation can be specifically represented by a 3×3 homography matrix. In the perspective transformation model, it is assumed that any coordinate position of the previous frame is recorded as The coordinate position mapped to the current frame is Then the mapping relationship between the two can be written as:
[0065]
[0066] in, is the perspective transformation homography matrix H.
[0067] As shown in the above formula, the homography matrix H has a total of 8 unknowns. Theoretically, as long as four pairs of non-collinear matching points can be extracted from the previous and next frames, the matrix can be solved.
[0068] Specifically, the step S3 specifically includes:
[0069] After obtaining the perspective transformation homography matrix H, the perspective transformation homography matrix H is used to transform the j-th target detection frame in the previous frame image The center point Map to the current frame image and get the new coordinates:
[0070]
[0071] According to the target association results of the previous and next frames, if the jth target frame of the previous frame image The i-th target box of the current frame image If the targets included are the same target, and They are displayed simultaneously in the current frame image and connected to draw the trajectory of the i-th target in the current frame image in the two previous and next frames.
[0072] Specifically, step S4 is as follows: looping steps S1 to S3, iteratively mapping the positions of all targets in the current frame image that have appeared in the historical frame images to the current frame image, and connecting the center points of the same target in sequence in time to draw the true motion trajectories of all targets in the current frame in the historical video.
[0073] Figure 2 The third line is a motion trajectory diagram drawn based only on the feature points detected on the vehicle target. At this time, the bus with ID number 26 still has a motion trajectory, and the trajectories of other moving targets are also jittery and not smooth. This shows that the feature points detected on the vehicle target will indeed have a negative impact on the correct registration between the previous and next frame images; the fourth line is a motion trajectory diagram drawn according to the complete steps of the present invention. It can be seen that the stationary target basically does not produce a trajectory, the trajectory direction of the moving target is correct, and the trajectory line is smooth and coherent, with good results.
[0074] Although the embodiments of the present invention are described in conjunction with the accompanying drawings, the patent owner may make various variations or modifications within the scope of the appended claims. As long as they do not exceed the protection scope described in the claims of the present invention, they should be within the protection scope of the present invention.
Claims
1. A method for visualizing target trajectories under UAV platform motion conditions, characterized in that: The following steps are involved: S1. Input the current frame image of the video into the trained target detection model to obtain the vehicle target detection result, and use the SORT algorithm to perform target association on the vehicle target detection result of the current frame and the vehicle target detection result of the previous frame to determine the position of each target in the current frame in the previous frame image; S2. Calculate the SIFT feature points and descriptors of the current frame image and the previous frame image, remove the feature points within the moving target frame, perform descriptor matching on the remaining feature points of the previous and next frames, and solve the perspective transformation homography matrix between the current frame image and the previous frame image; S3, mapping the positions of all target boxes in the previous frame image to the current frame image through perspective transformation homography matrix transformation, and connecting the center points of the detection boxes of the same target in the current frame image to obtain the true motion trajectory of all targets in the current frame image from the previous frame image to the current frame image; S4. Loop steps S1 to S3, iteratively map the positions of all targets in the current frame image that have appeared in historical frame images to the current frame image, and connect the center points of the same target in sequence in time to draw the real movement trajectory of all targets in the current frame in the historical video.
2. The target trajectory visualization method under the motion conditions of the UAV platform according to claim 1 is characterized in that: The step S1 specifically includes: S10, record the current frame image of the video as F c , the current frame image F of the video c Input the trained target detection model and output the detection results of all vehicle targets in the current frame: in, represents the i-th target bounding box detected in the current frame image, which includes 4 elements: the horizontal coordinate of the upper left corner of the target box, the vertical coordinate of the upper left corner of the target box, the width of the target box, and the height of the target box; Φ c is the set of all target frames in the current frame image. Similarly, for the previous frame video image F c-1 The test result can be recorded as Φ c-1 ; S11, using the SORT algorithm to convert the detection result of the current frame image Φ c Compared with the detection result of the previous frame image Φ c-1 Association is performed to determine whether each target in the current frame image appears in the previous frame image and its position in the previous frame image.
3. The target trajectory visualization method under the motion conditions of the UAV platform according to claim 1 is characterized in that: The step S2 specifically includes: S20, calculate the current frame image F c SIFT feature points and descriptors: Where, Indicates the mth SIFT feature point descriptor detected in the current frame video image, the previous frame image F c-1 The SIFT feature points and descriptors are recorded as: S21, after removing the feature points on the vehicle target, the remaining feature point set Denoted as: In the formula, |Φ c | represents the set of points within all target boxes detected in the current frame; S22, get the current frame feature point set and the feature point set of the previous frame For any two descriptors in , the Euclidean distance is used to calculate the similarity: In the formula, ||·|| 2 Represents the 2-norm. The higher the similarity, the more likely the two feature points are a matching point pair. By setting the threshold, all the matching point pairs of SIFT feature points in the previous and next frames can be obtained. S23, assuming that the arbitrary coordinate position of the previous frame is recorded as The coordinate position mapped to the current frame is Then the mapping relationship between the two is written as: in, is the perspective transformation homography matrix H.
4. The target trajectory visualization method under the motion conditions of the UAV platform according to claim 1 is characterized in that: The step S3 specifically includes: Use the perspective transformation homography matrix H to transform the j-th target detection frame in the previous frame image Center point Map to the current frame image to get the new coordinates: According to the target association results of the previous and next frames, if the j-th target frame of the previous frame image and the i-th target box of the current frame image If the target contained is the same target, and They are displayed simultaneously in the current frame image and connected to draw the trajectory of the i-th target in the current frame image in the two previous and next frames.
5. The target trajectory visualization method under the motion condition of the UAV platform according to claim 1 is characterized in that: The step S4 is specifically as follows: looping steps S1 to S3, iteratively mapping the positions of all targets in the current frame image that have appeared in the historical frame images to the current frame image, and connecting the center points of the same target in sequence in time to draw the real motion trajectories of all targets in the current frame in the historical video.
Citation Information
Patent Citations
Dynamic target tracking and positioning method of unmanned plane based on vision
CN103149939A
Open road traffic participant data acquisition method based on computer vision
CN110222667A
Multi-target tracking positioning and motion state estimation method based on unmanned aerial vehicle
CN113269098A
Vehicle track and course angle extraction method based on high-altitude unmanned aerial vehicle video
CN114972767A
Unmanned aerial vehicle multi-target long-term tracking method
CN117152206A
Cited By
Low-cost vehicle trajectory stable extraction method based on road monitoring video
CN119672603A
Multi-target tracking method and system under fast motion view angle of unmanned aerial vehicle
CN121236119A
Target tracking method and system based on unmanned aerial vehicle
CN122335914A
