Method and system for tracking vehicle by unmanned aerial vehicle based on computer vision
Through the drone tracking method based on computer vision, deep learning and edge computing technology are used to solve the problem of difficult real-time tracking of traditional vehicle re-identification technology in complex environments, achieve intelligent and real-time monitoring of vehicles, and ensure Accurate tracking and trajectory information acquisition of vehicle targets.
Patent Information
- Application Number
- CN202410590855.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-13
- Publication Date
- 2024-08-23
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
Traditional vehicle re-identification technology suffers from many interference factors, low real-time performance and high complexity when tracking vehicle targets in complex urban or highway environments in real time, making it difficult to achieve accurate tracking.
Using a drone tracking vehicle method based on computer vision, through image preprocessing and deep learning algorithm analysis of the drone's real-time video stream, vehicle information is obtained and the drone's flight speed and attitude are adjusted in real time to keep the vehicle within the drone's field of view. In the center, it combines edge computing and GPS trajectory processing to achieve intelligent and real-time tracking of vehicles.
It achieves accurate tracking and trajectory information acquisition of individual vehicle targets in complex traffic environments, improves the real-time monitoring capabilities of road vehicles, and enhances data processing speed and tracking accuracy.
Smart Images

Figure CN118534934A
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of drone image recognition, and in particular to a method and system for drone vehicle tracking based on computer vision. Background Art
[0002] With the rapid development of the country, the number of motor vehicles continues to increase, making it increasingly difficult to control a single specific vehicle target. When a traffic emergency occurs, it is necessary to track a vehicle target in real time and accurately in a complex urban or highway environment to facilitate the subsequent formulation of emergency measures.
[0003] The traditional vehicle tracking method is to continuously collect the same vehicle trajectory information through vehicle re-identification technology in road electronic police to meet the requirements of monitoring the vehicle location.
[0004] Regarding the above-mentioned related technologies, it is believed that vehicle re-identification technology is subject to many interference factors. The real-time performance and complexity of coordinating and linking multiple regional road electronic police through vehicle identification technology are low, which is not conducive to real-time tracking of vehicles. Summary of the invention
[0005] In order to improve the problem that vehicle re-identification technology is subject to many interference factors, the real-time performance and complexity of coordinating and linking multiple regional road electronic police through vehicle identification technology are low, which is not conducive to real-time tracking of vehicles, the present application provides a method and system for drone vehicle tracking based on computer vision.
[0006] In the first aspect, the present application provides a method for tracking a vehicle by a drone based on computer vision, which adopts the following technical solution: including:
[0007] Receive the real-time video stream from the drone and perform image preprocessing to obtain vehicle images;
[0008] Analyze the vehicle image according to a preset vehicle detection model and output vehicle information;
[0009] Calculating vehicle speed information through changes in the vehicle information;
[0010] Receive GPS information from drones in real time and generate drone trajectories;
[0011] The flight speed and attitude of the drone are adjusted in real time based on the vehicle speed information and the drone trajectory.
[0012] Optionally, receiving a real-time video stream from a camera mounted on a drone and performing image preprocessing to obtain a vehicle image includes:
[0013] Connect the camera and the airborne edge computing platform through the internal Ethernet of the drone, and control the edge computing platform to obtain the real-time video stream collected by the camera through the RTSP video stream address;
[0014] Decode the real-time video stream into a single-frame image in a unified RGB format;
[0015] Perform color space conversion and image filtering and denoising on a single frame image to obtain a vehicle image.
[0016] Optionally, the vehicle information includes: vehicle target frame coordinates and lane line coordinates;
[0017] The analyzing the vehicle image according to the preset vehicle detection model and outputting vehicle information includes:
[0018] Transmitting the vehicle image to the vehicle detection model to obtain the vehicle target frame coordinates;
[0019] The lane lines are accurately identified based on the LaneNet algorithm, and the pixel position information of each lane line in the pixel coordinate system from the perspective of the drone is obtained to obtain the coordinates of the lane lines.
[0020] Optionally, calculating the vehicle speed information according to the change of the vehicle information includes:
[0021] Based on the Deepsrot algorithm, the license plate number is used as the UID tag of the vehicle target, the target vehicle is tracked and identified, and the vehicle target frame coordinate change information is obtained;
[0022] The vehicle speed and moving distance are calculated based on the vehicle target frame coordinate change information and the vehicle UID.
[0023] Optionally, the calculating the vehicle speed and moving distance according to the vehicle target frame coordinate change information and the vehicle UID includes:
[0024] By calculating the pixel distance (y t+m -y t ), according to the scale G of pixel distance and real distance, the vehicle speed V is calculated by the following formula:
[0025]
[0026] Vehicle lateral movement distance S x Calculated by the following formula:
[0027] S x =G*(x t+m -x t ).
[0028] Optionally, the scale G of the pixel distance and the real distance is calculated by the following formula:
[0029]
[0030] Among them, w is the actual lane line width, and the pixel distance between the two lane lines closest to the vehicle target center point is the subtraction of the two horizontal coordinates, that is, x2-x1.
[0031] Optionally, adjusting the flight speed and attitude of the drone in real time based on the vehicle speed information and the drone trajectory includes:
[0032] According to the vehicle speed V and the vehicle lateral movement distance S x , combining the drone trajectory formed by the drone GPS position for structural processing;
[0033] At the same time, the video screenshots are taken at a preset frequency to capture the current images of the road conditions and the target vehicle;
[0034] The edge computing platform and the flight control device use a pre-set protocol format to calculate the vehicle speed V and the lateral movement distance S of the vehicle. x Adjust the drone's flight speed and lateral displacement distance in real time.
[0035] In a second aspect, the present application provides a drone tracking vehicle device based on computer vision, which adopts the following technical solutions, including:
[0036] The video module is used to receive the real-time video stream of the drone and perform image preprocessing to obtain vehicle pictures;
[0037] The vehicle module is used to analyze the vehicle image according to a preset vehicle detection model and output vehicle information;
[0038] An information module, used for calculating vehicle speed information according to changes in the vehicle information;
[0039] Positioning module, used to receive GPS information from the drone in real time and generate the drone trajectory;
[0040] The flight module is used to adjust the flight speed and attitude of the drone in real time based on the vehicle speed information and the drone trajectory.
[0041] In a third aspect, the present application further provides a control device, the device comprising:
[0042] The invention comprises a memory and a processor, wherein the memory stores a computer program which can be loaded by the processor and executed by the method for tracking a vehicle by a drone based on computer vision as described above.
[0043] In a fourth aspect, the present application also provides a computer-readable storage medium storing a computer program that can be loaded by a processor and executed as the above-mentioned computer vision-based drone tracking vehicle method.
[0044] In summary, the system in this application uses edge computing and deep learning technology to perform image recognition and analysis on the real-time video stream of the drone camera, and obtains the real-time driving speed and lateral movement of the vehicle through image processing and target tracking methods, and adjusts the flight status of the drone in real time to always keep the vehicle in the center of the drone's field of view. And the information such as the drone's flight trajectory is processed into structured text to increase the data processing speed, so as to effectively realize the accurate tracking of a single specific vehicle target in a complex traffic environment, and obtain its trajectory information, so as to realize the intelligent, real-time and timely effective monitoring of road vehicles. BRIEF DESCRIPTION OF THE DRAWINGS
[0045] Figure 1 It is a flowchart of a method for tracking vehicles using a drone based on computer vision.
[0046] Figure 2 It is the structural block diagram of the vehicle module and information module.
[0047] Figure 3 It is a schematic diagram used to display the location coordinates of vehicles and drones.
[0048] Figure 4 It is a structural block diagram of a UAV tracking vehicle device based on computer vision.
[0049] Description of reference numerals: 410, video module; 420, vehicle module; 430, information module; 440, positioning module; 450, flight module. DETAILED DESCRIPTION
[0050] The following combination Figure 1 - Figure 3 This application is described in further detail.
[0051] With the rapid development of the country, the number of motor vehicles continues to increase, making it increasingly difficult to control a single specific vehicle target. When a traffic emergency occurs, it is necessary to track a vehicle target in real time and accurately in a complex urban or highway environment to facilitate the subsequent formulation of emergency measures.
[0052] If the camera video stream is processed in real time in the drone device, the deep learning algorithm is used to detect and identify the moving vehicles and license plates on the road, the driving status of the target vehicle is obtained through image processing and target tracking methods, and the flight status of the drone is adjusted in real time, the target vehicle is always kept in the center of the drone's field of view, real-time and accurate vehicle tracking is achieved, and the drone's flight trajectory is organized into a structured message and uploaded to the cloud platform, this is undoubtedly a good solution.
[0053] Based on this, the embodiment of the present application discloses a method for tracking vehicles by drones based on computer vision. The execution subject is a control system. Based on a high-precision vehicle, license plate and lane line recognition model trained by a deep learning algorithm, the Deepsort algorithm is used to achieve target tracking, the real-time speed and movement of the vehicle are obtained through image processing, and the flight speed and posture of the drone are adjusted to achieve accurate tracking of the vehicle target.
[0054] Reference Figure 1 , the embodiment of the present application at least includes step S10 to step S50.
[0055] S10, receiving the real-time video stream of the drone, and performing image preprocessing to obtain the vehicle image.
[0056] S20, analyzing the vehicle image according to a preset vehicle detection model and outputting vehicle information.
[0057] S30, calculating vehicle speed information according to the change of vehicle information.
[0058] S40 receives GPS information from the drone in real time and generates a drone trajectory.
[0059] S50, adjusting the flight speed and attitude of the drone in real time based on the vehicle speed information and the drone trajectory.
[0060] Specifically, the system uses edge computing and deep learning technology to perform image recognition and analysis on the real-time video stream of the drone camera, and obtains the real-time speed and lateral movement of the vehicle, that is, vehicle information, through image processing and target tracking methods. The drone's flight status is adjusted in real time through vehicle information and the drone's GPS positioning, so that the vehicle is always in the center of the drone's field of view. This effectively achieves accurate tracking of a single specific vehicle target in a complex traffic environment, obtains its trajectory information, and realizes effective intelligent, real-time and timely monitoring of road vehicles.
[0061] In some embodiments, step S10 specifically includes the following steps: connecting the camera and the airborne edge computing platform through the internal Ethernet of the drone, controlling the edge computing platform to obtain the real-time video stream captured by the camera through the RTSP video stream address; decoding the real-time video stream into a single-frame image in a unified RGB format; performing color space conversion and image filtering and denoising on the single-frame image to obtain a vehicle image.
[0062] Specifically, the system processes the real-time video stream based on the edge computing platform to obtain complete vehicle images, thereby achieving the purpose of improving vehicle images and facilitating the subsequent road vehicle violation analysis module to further process the image information.
[0063] In some embodiments, step S20 specifically includes the following steps: transmitting the vehicle image to the vehicle detection model to obtain the vehicle target frame coordinates; accurately identifying the lane lines based on the LaneNet algorithm, obtaining the pixel point position information of each lane line in the pixel coordinate system from the perspective of the drone, and obtaining the lane line coordinates.
[0064] The vehicle information includes: vehicle target frame coordinates and lane line coordinates.
[0065] Furthermore, in some embodiments, step S30 specifically includes the following steps: based on the Deepsrot algorithm, the license plate number is used as the UID tag of the vehicle target, the target vehicle is tracked and identified, and the vehicle target frame coordinate change information is obtained; the vehicle speed and moving distance are calculated according to the vehicle target frame coordinate change information and the vehicle UID.
[0066] Furthermore, in some embodiments, step S30 further includes: calculating the pixel distance (y t+m -y t ), according to the scale G of pixel distance and real distance, the vehicle speed V is calculated by the following formula:
[0067]
[0068] Vehicle lateral movement distance S x Calculated by the following formula:
[0069] S x =G*(x t+m -x t ).
[0070] Optionally, the scale G between pixel distance and real distance is calculated by the following formula:
[0071]
[0072] Among them, w is the actual lane line width, and the pixel distance between the two lane lines closest to the vehicle target center point is the subtraction of the two horizontal coordinates, that is, x2-x1.
[0073] In fact, referring to Figure 2 and Figure 3 , the Yolov5 algorithm is used in advance to train a high-precision vehicle detection model, and the coordinate information of each vehicle target box is output, which is the upper left corner (px1, py1) and the lower right corner (px2, py2). The coordinates of the center point of the target box can be calculated according to the following formula:
[0074]
[0075] Next, the license plate number of each vehicle target is obtained through the license plate recognition model based on the OCR algorithm and bound to the vehicle target frame. The vehicle target is tracked based on the Deepsrot algorithm, and the license plate number is used as the UID tag of the vehicle target. The lane line is accurately identified based on the LaneNet algorithm. The pixel position information of each lane line in the pixel coordinate system from the perspective of the drone is obtained.
[0076] Reference Figure 3 When a vehicle target appears, the x-axis pixel position coordinates of the corresponding lane line are obtained based on the y-axis coordinates of the center point of the vehicle, where y m Indicates the y-axis coordinate of the center pixel of the vehicle target. x1, x2, x3 indicate when the y-axis pixel coordinate is y m When the x-axis coordinates of the pixels in each lane are calculated from the origin of the coordinate system along the positive x-axis. The lane width is set to w meters according to different road scenes, so that the distance between the two lanes closest to the center point of the vehicle target can be calculated to obtain the scale G of the pixel and the real distance. It should be understood that the image taken by the drone is set with a pre-set coordinate system.
[0077] In some embodiments, step S50 specifically includes the following steps: according to the vehicle speed V and the vehicle lateral movement distance S x , combined with the drone trajectory formed by the drone GPS position for structural processing; at the same time, video screenshots are taken at a preset frequency to capture the current picture of the road conditions and the target vehicle; the edge computing platform and the flight control device are connected according to the pre-set protocol format, based on the vehicle speed V and the vehicle's lateral movement distance S x The flight speed and lateral displacement of the drone are adjusted in real time, thus ensuring that the vehicle is always in the designated location area of the drone camera.
[0078] The implementation principle of the computer vision-based drone vehicle tracking method in the embodiment of the present application is as follows: the system uses edge computing and deep learning technology to perform image recognition and analysis on the real-time video stream of the drone camera, and obtains the real-time driving speed and lateral movement of the vehicle through image processing and target tracking methods, and adjusts the drone flight state in real time to always keep the vehicle in the center of the drone's field of view. And the information such as the drone flight trajectory is processed into structured text to increase the data processing speed, so as to effectively realize the accurate tracking of a single specific vehicle target in a complex traffic environment, and obtain its trajectory information, so as to realize the intelligent, real-time and timely effective monitoring of road vehicles.
[0079] Figure 1 FIG. 1 is a flow chart of a method for tracking a vehicle using a drone based on computer vision in one embodiment. Figure 1 The steps in the flowchart are shown in sequence as indicated by the arrows, but the steps are not necessarily executed in the order indicated by the arrows; unless otherwise specified in this document, there is no strict order restriction for the execution of the steps, and the steps may be executed in other orders; and Figure 1 At least part of the steps may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily executed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be executed in turn or alternately with other steps or at least part of the sub-steps or stages of other steps.
[0080] Based on the same technical concept, Figure 2 The embodiment of the present application also provides a drone tracking vehicle device based on computer vision, which adopts the following technical solution. The device includes:
[0081] The video module 410 is used to receive the real-time video stream of the drone and perform image preprocessing to obtain the vehicle image;
[0082] The vehicle module 420 is used to analyze the vehicle image according to the preset vehicle detection model and output the vehicle information;
[0083] An information module 430, for calculating vehicle speed information according to changes in vehicle information;
[0084] The positioning module 440 is used to receive GPS information from the drone in real time and generate the drone trajectory;
[0085] The flight module 450 is used to adjust the flight speed and attitude of the drone in real time based on the vehicle speed information and the drone trajectory.
[0086] In some embodiments, the video module 410 is specifically used to connect the camera and the airborne edge computing platform through the internal Ethernet of the drone, and control the edge computing platform to obtain the real-time video stream collected by the camera through the RTSP video stream address;
[0087] Decode the real-time video stream into a single-frame image in a unified RGB format;
[0088] Perform color space conversion and image filtering and denoising on a single frame image to obtain a vehicle image.
[0089] In some embodiments, the vehicle module 420 is specifically used to transmit the vehicle image to the vehicle detection model to obtain the vehicle target frame coordinates;
[0090] The lane lines are accurately identified based on the LaneNet algorithm, and the pixel position information of each lane line in the pixel coordinate system from the perspective of the drone is obtained to obtain the lane line coordinates.
[0091] In some embodiments, the information module 430 is specifically used to use the license plate number as the UID tag of the vehicle target based on the Deepsrot algorithm, track and identify the target vehicle, and obtain the vehicle target frame coordinate change information;
[0092] The vehicle speed and moving distance are calculated based on the vehicle target frame coordinate change information and vehicle UID.
[0093] In some embodiments, the information module 430 is further used to calculate the pixel distance (y t+m -y t ), according to the scale G of pixel distance and real distance, the vehicle speed V is calculated by the following formula:
[0094]
[0095] Vehicle lateral movement distance S x Calculated by the following formula:
[0096] S x =G*(x t+m -x t ).
[0097] In some embodiments, the information module 430 is further used to calculate the scale G of the pixel distance and the real distance by the following formula:
[0098]
[0099] Among them, w is the actual lane line width, and the pixel distance between the two lane lines closest to the vehicle target center point is the subtraction of the two horizontal coordinates, that is, x2-x1.
[0100] In some embodiments, the flight module 450 is specifically configured to calculate the vehicle speed V and the vehicle lateral movement distance S according to the vehicle speed V and the vehicle lateral movement distance S. x ,The UAV trajectory formed by combining the UAV GPS position is structured;
[0101] At the same time, the video screenshots are taken at a preset frequency to capture the current images of the road conditions and the target vehicle;
[0102] The edge computing platform and the flight control device use a pre-set protocol format to calculate the vehicle speed V and the lateral movement distance S of the vehicle. x Adjust the drone's flight speed and lateral displacement distance in real time.
[0103] The embodiment of the present application also discloses a control device.
[0104] Specifically, the control device includes a memory and a processor, and the memory stores a computer program that can be loaded by the processor and execute the above-mentioned computer vision-based drone tracking vehicle method.
[0105] The embodiment of the present application also discloses a computer-readable storage medium.
[0106] Specifically, the computer-readable storage medium stores a computer program that can be loaded by a processor and execute the above-mentioned computer vision-based drone tracking vehicle method. The computer-readable storage medium includes, for example: a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, and other media that can store program codes.
[0107] The above are all preferred embodiments of the present application, and the protection scope of the present application is not limited thereto. Therefore, any equivalent changes made according to the structure, shape, and principle of the present application should be included in the protection scope of the present application.
Claims
1. A method for tracking vehicles by drones based on computer vision, characterized in that: include: Receive the real-time video stream from the drone and perform image preprocessing to obtain vehicle images; Analyze the vehicle image according to a preset vehicle detection model and output vehicle information; Calculating vehicle speed information based on changes in the vehicle information; Receive GPS information from drones in real time and generate drone trajectories; The flight speed and attitude of the drone are adjusted in real time based on the vehicle speed information and the drone trajectory.
2. The method for tracking a vehicle using a drone based on computer vision according to claim 1, characterized in that: The receiving of the real-time video stream of the drone-mounted camera and performing image preprocessing to obtain the vehicle image includes: Connect the camera and the airborne edge computing platform through the internal Ethernet of the drone, and control the edge computing platform to obtain the real-time video stream collected by the camera through the RTSP video stream address; Decode the real-time video stream into a single-frame image in a unified RGB format; Perform color space conversion and image filtering and denoising on a single frame image to obtain a vehicle image.
3. The method for tracking a vehicle using a drone based on computer vision according to claim 1, characterized in that: The vehicle information includes: vehicle target frame coordinates and lane line coordinates; The analyzing the vehicle image according to the preset vehicle detection model and outputting vehicle information includes: Transmitting the vehicle image to the vehicle detection model to obtain the vehicle target frame coordinates; The lane lines are accurately identified based on the LaneNet algorithm, and the pixel position information of each lane line in the pixel coordinate system from the perspective of the drone is obtained to obtain the coordinates of the lane lines.
4. The method for tracking a vehicle using a drone based on computer vision according to claim 3, characterized in that: The calculating the vehicle speed information according to the change of the vehicle information comprises: Based on the Deepsrot algorithm, the license plate number is used as the UID tag of the vehicle target, the target vehicle is tracked and identified, and the vehicle target frame coordinate change information is obtained; The vehicle speed and moving distance are calculated based on the vehicle target frame coordinate change information and the vehicle UID.
5. The method for tracking a vehicle using a drone based on computer vision according to claim 4, characterized in that: The calculating the vehicle speed and moving distance according to the vehicle target frame coordinate change information and the vehicle UID includes: By calculating the pixel distance (y t+m -y t ), according to the scale G of pixel distance and real distance, the vehicle speed V is calculated by the following formula: Vehicle lateral movement distance S x Calculated by the following formula: S x =G*(x t+m -x t )。 6. The method for tracking a vehicle using a drone based on computer vision according to claim 5, characterized in that: The scale G of the pixel distance and the real distance is calculated by the following formula: Among them, w is the actual lane line width, and the pixel distance between the two lane lines closest to the vehicle target center point is the subtraction of the two horizontal coordinates, that is, x2-x1.
7. The method for tracking a vehicle by using a drone based on computer vision according to claim 5, characterized in that: The real-time adjustment of the flight speed and attitude of the drone based on the vehicle speed information and the drone trajectory includes: According to the vehicle speed V and the vehicle lateral movement distance S x , combining the drone trajectory formed by the drone GPS position for structural processing; At the same time, the video screenshots are taken at a preset frequency to capture the current images of the road conditions and the target vehicle; The edge computing platform and the flight control device use a pre-set protocol format to calculate the vehicle speed V and the lateral movement distance S of the vehicle. x Adjust the drone's flight speed and lateral displacement distance in real time.
8. A drone tracking vehicle device based on computer vision, characterized in that: The device comprises: The video module is used to receive the real-time video stream of the drone and perform image preprocessing to obtain vehicle pictures; The vehicle module is used to analyze the vehicle image according to a preset vehicle detection model and output vehicle information; An information module, used for calculating vehicle speed information according to changes in the vehicle information; Positioning module, used to receive GPS information from the drone in real time and generate the drone trajectory; The flight module is used to adjust the flight speed and attitude of the drone in real time based on the vehicle speed information and the drone trajectory.
9. A control device, characterized in that: The device comprises: The method comprises a memory and a processor, wherein the memory stores a computer program which can be loaded by the processor and execute the method according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: A computer program is stored which can be loaded by a processor and execute the method as claimed in any one of claims 1 to 7.
Citation Information
Patent Citations
Vehicle speed estimation system and method based on unmanned aerial vehicle aerial images
CN107067752A
Non-motor vehicle microscopic trajectory data mining method
CN117765416A
Reinforcement Learning Based System for Aerial Imagery Acquisition Using Drone Following Target Vehicle
US20210256255A1
Cited By
Motion observation method, system and device based on creeping track of target organism
CN118762401A
Method, system and device for observing movement based on target biological crawling trajectory
CN118762401B
Method for pruning plants through intelligent unmanned aerial vehicle
CN119384968A
Road scene multi-target tracking system based on visual perception of unmanned aerial vehicle
CN120298460A
Environment image acquisition method and apparatus, vehicle-mounted unmanned aerial vehicle, monitoring system, medium, and product
WO2026227678A1
