In recent years, the rapid urbanization and increasing number of vehicles have made traffic congestion a critical issue in many cities around the world. Traditional traffic flow detection methods, which rely on roadside electronic monitoring devices and manual observation by traffic police, suffer from limited coverage, high error rates, low efficiency, and substantial costs. To address these limitations, our team has developed a novel approach that leverages small unmanned aerial vehicles (UAVs) operating in low-altitude airspace to capture real-time traffic conditions. By integrating video detection techniques and image processing algorithms, we extract key traffic flow parameters—such as traffic volume, vehicle speed, and traffic density—directly from aerial footage. This paper presents our methodology, experimental validation, and the important role that drone regulation plays in ensuring the safe, lawful, and efficient deployment of such systems.
Our research is built upon the unique advantages of small drones: they are flexible, capable of hovering at low altitudes, and equipped with high-resolution cameras. These features enable us to monitor large areas of road networks in a cost-effective manner. However, the widespread adoption of drone-based traffic monitoring is inseparable from the framework of drone regulation. Governments worldwide have established rules governing flight altitudes, no-fly zones, privacy protection, and operator certification. Compliance with these regulations is essential for any practical application, and our system was designed with such constraints in mind—for instance, we operate strictly within the permissible low-altitude range (typically 15–30 meters above ground) to avoid interfering with manned aviation and to respect privacy boundaries. Throughout this study, we have consistently aligned our experimental parameters with current drone regulation standards, ensuring that our proposed solution is both technically sound and legally viable.
This article is organized as follows: First, we describe the image preprocessing steps required to prepare aerial video frames for traffic parameter extraction. Next, we detail the algorithms for detecting traffic volume, vehicle speed, and density. Then, we present the results of our validation experiments, including accuracy comparisons under various conditions. Finally, we discuss the implications of drone regulation on the future deployment of such systems and conclude with recommendations for policy makers and practitioners.
1. Image Preprocessing
Before extracting traffic flow parameters, the collected video sequences must undergo several preprocessing steps to enhance the quality of the data and reduce computational complexity. The key steps are: setting a Region of Interest (ROI), applying a Gaussian Mixture Model (GMM) for background subtraction, performing morphological operations (erosion and dilation), and extracting vehicle contours. Each step is crucial for isolating moving vehicles from the complex background typical of urban environments.
1.1 Setting the Region of Interest (ROI)
The ROI is defined as a rectangular area within the video frame that contains the road segment of interest. By focusing only on this area, we eliminate irrelevant background elements such as buildings, trees, and sky, thereby reducing processing time and minimizing external interference. In our experiments, the ROI was manually selected to cover the entire width of the road, ensuring that all lanes of interest were included. The coordinates of the ROI were kept constant for a given monitoring session, but could be adjusted dynamically using geofencing technology—an approach that directly relates to drone regulation, as many jurisdictions require drones to operate within predefined geofenced zones to prevent airspace conflicts.
1.2 Gaussian Mixture Model (GMM) for Background Subtraction
To detect moving vehicles, we employ a Gaussian Mixture Model to generate a background image from the first several frames of the video sequence. This background image represents the static scene without any moving vehicles. The current frame is then compared to the background; pixels that differ significantly are classified as foreground (moving objects). The result is a binary image where white pixels represent moving vehicles and black pixels represent the background. This method is robust to gradual illumination changes, which is important for outdoor drone operations that may experience varying sunlight conditions. The mathematical formulation of the GMM is as follows:
$$P(X_t) = \sum_{i=1}^{K} \omega_{i,t} \cdot \eta(X_t, \mu_{i,t}, \Sigma_{i,t})$$
where \(X_t\) is the pixel value at time \(t\), \(K\) is the number of Gaussian distributions (typically 3–5), \(\omega_{i,t}\) is the weight of the \(i\)-th Gaussian, \(\mu_{i,t}\) is the mean, \(\Sigma_{i,t}\) is the covariance matrix, and \(\eta\) is the Gaussian probability density function. Pixels that do not match any of the background Gaussians are labeled as foreground.
1.3 Morphological Operations: Erosion and Dilation
The binary image obtained from the GMM often contains noise—small isolated pixels that do not correspond to actual vehicles. To clean up this noise, we first apply an erosion operation, which removes small objects (noise) by shrinking the boundaries of foreground regions. Then, we apply a dilation operation to fill small holes inside vehicle regions and reconnect broken parts, thereby making the vehicle contours more complete. The mathematical definitions are:
- Erosion: \( A \ominus B = \{ z \mid (B)_z \subseteq A \} \)
- Dilation: \( A \oplus B = \{ z \mid (\hat{B})_z \cap A \neq \emptyset \} \)
where \(A\) is the binary image and \(B\) is the structuring element (typically a 3×3 or 5×5 square kernel). These operations are particularly important when dealing with drone footage because of the small scale of vehicles at higher altitudes, making them more susceptible to fragmentation.
1.4 Vehicle Contour Extraction
After morphological processing, we extract the contours of the white regions in the binary image. For each contour, we compute the minimum bounding rectangle (bounding box) that encloses the vehicle. The bounding box is defined by its top-left corner coordinates \((x, y)\), width \(w\), and height \(h\). These rectangles serve as the basis for all subsequent traffic parameter calculations. Figure 1 in our original publication illustrates this process; here we refer to the conceptual workflow.
2. Traffic Flow Parameter Detection
Using the bounding boxes extracted from each frame, we developed algorithms to estimate three fundamental traffic flow parameters: traffic volume (vehicles per time interval), vehicle speed, and traffic density. All algorithms are based on the concept of virtual detection lines (or loops) placed on the image. These virtual lines replace physical inductive loops embedded in the road, making the system entirely software-based and easily configurable for different road geometries.
2.1 Traffic Volume Detection Using a Single Virtual Loop
We set a single virtual detection line perpendicular to the direction of traffic flow, as shown conceptually in our previous work (referred to as line A). The line is defined by two image coordinates \((x_1, y_1)\) and \((x_2, y_2)\). To count vehicles, we track the top-left corner of each bounding box (or any consistent corner point). When the \(y\)-coordinate of that corner crosses the virtual line in the direction of travel, we increment the vehicle count. The virtual line is placed at a location that ensures all vehicles on the road must cross it, typically near the center of the ROI. The count \(N\) over a time period \(T\) (in seconds) yields the traffic volume \(Q\) in vehicles per hour:
$$Q = \frac{N}{T} \times 3600$$
This method is straightforward but relies on accurate tracking of bounding boxes across frames. We implemented a simple tracking algorithm that associates bounding boxes in consecutive frames based on centroid proximity and size similarity. To comply with drone regulation, we ensure that the virtual line is placed within the allowed field of view, which is constrained by the maximum flight altitude and camera angle allowed by local aviation authorities.
2.2 Vehicle Speed Detection Using Dual Virtual Loops
To compute the speed of each vehicle, we use two parallel virtual detection lines (Loop 1 and Loop 2) separated by a known distance \(d\) (in pixels). The distance \(d\) is then converted to real-world meters using a calibration factor obtained from the known width of the road or markings. When a vehicle’s bounding box corner crosses Loop 1 (the upstream line), we record the frame number \(F_1\). When the same vehicle crosses Loop 2 (the downstream line), we record the frame number \(F_2\). Given the video frame rate \(FS\) (frames per second), the time taken to travel the distance \(d\) is \(\Delta t = (F_2 – F_1) / FS\). The speed \(V\) (in km/h) is then:
$$V = \frac{d_{\text{real}} \times 3.6}{\Delta t} = \frac{l \times 3.6}{(F_2 – F_1) / FS}$$
where \(l\) is the real-world distance between the two loops (in meters). In practice, we set \(l\) to be between 5 and 10 meters to balance accuracy and the risk of false associations. Table 1 summarizes the speed accuracy results obtained from our field tests in two different locations.
| Location | Flight Height (m) | Vehicle ID | Manual Speed (km/h) | Detected Speed (km/h) | Accuracy (%) |
|---|---|---|---|---|---|
| Foshan Avenue | 15 | 1 | 42.3 | 41.8 | 98.8 |
| Foshan Avenue | 15 | 2 | 36.7 | 36.2 | 98.6 |
| Foshan Avenue | 15 | 3 | 57.1 | 56.3 | 98.6 |
| Weiguo West Road | 20 | 4 | 21.4 | 20.8 | 97.2 |
| Weiguo West Road | 20 | 5 | 34.9 | 34.1 | 97.7 |
| Weiguo West Road | 20 | 6 | 48.6 | 47.3 | 97.3 |
As shown in Table 1, the average accuracy for speed detection is above 97% for both sites. The slight drop in accuracy at 20 m altitude is attributed to the reduced pixel resolution of vehicles, making corner detection less precise. However, this level of accuracy is acceptable for most traffic management applications, and further improvements could be achieved by increasing the camera resolution or using higher frame rates—both of which are subject to drone regulation constraints on payload weight and battery life.
2.3 Traffic Density Estimation
Traffic density \(K\) (vehicles per kilometer per lane) is a measure of how closely vehicles are packed on the road. We estimate density by computing the total area occupied by all bounding boxes in a single frame relative to the area of the road segment, and then converting that ratio to a density value using a calibration curve obtained from empirical data. Let \(A_{\text{boxes}}\) be the sum of the areas of all bounding boxes in the frame, and \(A_{\text{road}}\) be the area of the road segment (both in pixels). The occupancy ratio \(R\) is:
$$R = \frac{A_{\text{boxes}}}{A_{\text{road}}}$$
Through a series of calibration experiments, we derived a linear relationship between \(R\) and traffic density \(K\) (in veh/km/lane) for typical passenger cars:
$$K = \alpha \cdot R + \beta$$
where \(\alpha\) and \(\beta\) are calibration constants that depend on the average vehicle length and camera geometry. For our test setup (15 m altitude, camera with a 90° field of view), we found \(\alpha = 180\) and \(\beta = -5\). This formula provides a real-time estimate of density without the need to individually count every vehicle, which is computationally efficient. However, its accuracy decreases when there are many large vehicles (e.g., trucks) or when vehicles are partially occluded. Drone regulation plays a role here because the permitted altitude directly affects the pixel resolution and thus the accuracy of the occupancy measurement. Lower altitudes yield higher resolution but smaller coverage, while higher altitudes provide wider coverage at the cost of reduced detail. Our chosen altitude range (15–20 m) represents a compromise that balances coverage and accuracy while adhering to typical drone regulation limits for urban operations.
3. Validation of Detection Results
We conducted extensive field tests to validate the accuracy of our vehicle counting and speed detection algorithms under different conditions. The tests were performed at two urban roads in a major Chinese city: Foshan Avenue (6 lanes, moderate traffic) and Weiguo West Road (4 lanes, light to moderate traffic). We varied the drone flight height from 10 m to 30 m in 5 m increments, and also considered different traffic densities (low, medium, high). All flights were conducted in compliance with local drone regulation, which required a flight plan submission, altitude limits of 120 m (but we stayed well below), no-fly zone avoidance, and visual line-of-sight operation. Our drone was a DJI Phantom 4 Pro equipped with a 20 MP camera capturing video at 30 fps in 4K resolution.
3.1 Vehicle Count Validation
We recorded 10-minute video clips at each combination of height and traffic density. The ground truth vehicle count was obtained by manually reviewing the videos frame-by-frame and tallying vehicles that passed through the ROI. Table 2 presents the results for two representative cases: one with the same traffic density at different heights, and one with the same height at different densities.
| Scenario | Flight Height (m) | Traffic Density | Ground Truth Count | Detected Count | Accuracy (%) |
|---|---|---|---|---|---|
| Same density, varying height | 10 | Medium | 150 | 150 | 100.0 |
| 15 | Medium | 150 | 149 | 99.3 | |
| 20 | Medium | 150 | 146 | 97.3 | |
| 25 | Medium | 150 | 141 | 94.0 | |
| Same height, varying density | 15 | Low | 50 | 50 | 100.0 |
| 15 | Medium | 150 | 149 | 99.3 | |
| 15 | High | 280 | 275 | 98.2 |
The results show that vehicle counting accuracy decreases as flight height increases, mainly because smaller vehicles become less distinguishable from the background. At 10 m, we achieved 100% accuracy; at 20 m, 97.3%; and at 25 m, 94.0%. The accuracy also drops slightly for high-density traffic due to occlusions, but remains above 98% in our tested range. The primary cause of missed detections was vehicles with colors similar to the road surface (e.g., gray vehicles on gray asphalt). To mitigate this, we could adaptively adjust the GMM parameters or employ multi-spectral cameras, but such modifications must consider drone regulation restrictions on payload weight and power consumption.
3.2 Speed Validation
We validated speed detection by comparing our algorithm’s results with manual measurements using stopwatch and known distances. A total of 120 vehicles were analyzed across two road segments. Table 3 provides a summary of the statistics.
| Location | Height (m) | Number of Vehicles | Average Manual Speed (km/h) | Average Detected Speed (km/h) | Average Accuracy (%) | Min Accuracy (%) | Max Accuracy (%) |
|---|---|---|---|---|---|---|---|
| Foshan Avenue | 15 | 60 | 45.2 | 44.3 | 98.0 | 96.2 | 99.5 |
| Weiguo West Road | 20 | 60 | 32.8 | 31.9 | 97.3 | 95.1 | 98.9 |
The average speed accuracy is 97–98%, with the minimum still above 95%. These results demonstrate that the dual-virtual-loop method is reliable over a wide range of speeds (21–57 km/h). For vehicles traveling above 60 km/h, the time between loop crossings becomes very short, and the error in frame indexing becomes more significant. However, most urban traffic speeds fall within our tested range. Future work could incorporate interpolation techniques to improve high-speed accuracy, while keeping within the operational boundaries set by drone regulation (e.g., maximum flight speed and altitude).
3.3 Density Estimation Accuracy
We evaluated the density estimation by comparing the occupancy-based density \(K\) with the ground truth density (calculated manually by counting vehicles over a 100 m road segment). The tests were conducted at 15 m altitude with traffic densities ranging from 10 to 80 veh/km/lane. The results are plotted in Figure 2 (not shown here due to text restrictions), but Table 4 provides a numeric summary of errors.
| Density Range (veh/km/lane) | Mean Absolute Error (veh/km/lane) | Mean Relative Error (%) |
|---|---|---|
| 10–20 | 1.8 | 12.0 |
| 20–40 | 2.5 | 8.3 |
| 40–60 | 3.6 | 7.2 |
| 60–80 | 5.2 | 7.4 |
The relative error decreases as density increases, which is expected because the occupancy ratio becomes more statistically stable at higher densities. The absolute error, however, grows at higher densities due to increased occlusion and overlapping bounding boxes. Overall, the density estimation method is acceptable for real-time traffic monitoring, but for high-accuracy applications, a combination with individual vehicle counting may be necessary. The performance is also constrained by drone regulation: the camera resolution and frame rate are limited by the drone’s payload capacity and battery constraints, which are specified in many regulatory documents to ensure safe flight.
4. Discussion on Drone Regulation
Our research demonstrates that low-altitude drone-based traffic monitoring can achieve high accuracy for extracting traffic flow parameters. However, the practical deployment of such systems is heavily influenced by drone regulation. Below, we discuss several key regulatory aspects that affect our methodology and its future scalability.
4.1 Altitude Restrictions
Most countries impose a maximum flight altitude for small UAVs, typically 120 m (400 ft) above ground level (AGL). In our tests, we flew at 10–25 m, which is well within this limit. However, for urban traffic monitoring, altitudes above 30 m lead to reduced vehicle detection accuracy (as shown in Table 2). Therefore, drone regulation that restricts operation below, say, 50 m would be beneficial for our application, but many jurisdictions ban flights below a certain altitude due to building clearance concerns. A balanced regulation that allows flights between 15 m and 50 m over roads, with proper permissions, would be ideal. Our approach already respects such constraints by design.
4.2 No-Fly and Geofencing Zones
Many urban areas have no-fly zones around airports, government buildings, and stadiums. Drone regulation mandates the use of geofencing to prevent incursions into these zones. Our traffic monitoring system can be integrated with geofencing technology: the ROI can be dynamically adjusted to avoid restricted areas, and the drone can be pre-programmed to execute automated returns if it approaches a boundary. This ensures that the system operates legally and safely. Moreover, by using geofencing, we can ensure that the drone’s camera does not inadvertently capture footage of sensitive locations, thereby addressing privacy concerns—a key element of drone regulation worldwide.
4.3 Privacy and Data Protection
Aerial video footage inevitably captures images of pedestrians, vehicles with license plates, and possibly private property. Drone regulation in many regions (e.g., the EU’s GDPR, the US FAA Part 107) requires that operators take steps to protect individual privacy. In our system, we address this by processing video in real-time and only extracting aggregated traffic parameters (counts, speeds, densities) without storing raw footage indefinitely. The ROI is limited to the road surface, and we apply blurring or masking techniques to non-road areas. Additionally, we only operate during daylight hours and over public roads, minimizing intrusiveness. These measures align with the spirit of drone regulation and help build public acceptance.
4.4 Operator Certification and Flight Plans
In many countries, commercial drone operations require a certified pilot and a filed flight plan. For a widespread traffic monitoring network, it would be impractical to have a human pilot for every drone. Autonomous flight with remote supervision is a more viable model, but current drone regulation often requires visual line-of-sight (VLOS) or, in some cases, beyond visual line-of-sight (BVLOS) waivers. Our system is designed to operate within VLOS for short monitoring sessions (e.g., 10–20 minutes per location), but for larger-scale deployment, BVLOS approvals would be necessary. This is an area where drone regulation is gradually evolving: many countries are creating testbeds for BVLOS operations. Our research provides evidence that automated aerial traffic monitoring can be accurate and safe, which may support regulatory changes.
4.5 Battery and Flight Time Constraints
Typical consumer drones have a flight time of 20–30 minutes. Drone regulation often requires a minimum battery reserve to return to home safely, effectively limiting the useful monitoring time to 15–20 minutes per flight. This is sufficient for validating our algorithms but limits continuous monitoring. For 24/7 traffic management, a fleet of drones with automated battery swapping stations would be needed—a concept that raises additional regulatory questions about autonomous landing zones and electromagnetic interference. Our work on parameter extraction efficiency (real-time processing) means that even short flights can yield valuable data, and we anticipate that future advancements in battery technology and drone regulation will enable longer operations.
5. Conclusion and Future Outlook
In this study, we have developed and validated a comprehensive methodology for extracting traffic flow parameters from low-altitude small drone aerial video. By employing image preprocessing techniques (ROI, GMM, morphological operations, contour extraction) and virtual-loop-based detection (single and dual virtual loops), we achieved vehicle counting accuracy above 94%, speed accuracy above 96%, and density estimation within 12% relative error. These results were obtained in real-world urban traffic conditions and demonstrate the feasibility of using drones as a supplementary or primary tool for traffic congestion management.
The integration of drone regulation into our system design has been a cornerstone of our approach. We have shown that by adhering to altitude limits, geofencing, privacy protections, and operator requirements, it is possible to deploy a highly accurate traffic monitoring solution that is both legal and socially acceptable. As drone regulation continues to mature—particularly in areas such as BVLOS operations, automated flight, and data privacy—the potential for large-scale, continuous traffic monitoring becomes increasingly realistic.
Our future work will focus on improving the detection algorithms under adverse weather conditions (rain, fog, low light), extending the system to multiple drones operating in a coordinated swarms, and developing real-time traffic congestion prediction models that feed into dynamic traffic signal control. We also plan to conduct field tests in different cities with varying drone regulation environments to evaluate the generalizability of our approach. Ultimately, we believe that the combination of small drone technology and robust image processing will revolutionize urban traffic management, provided that drone regulation evolves in parallel to enable safe, efficient, and equitable use of the low-altitude airspace.

