Ferramenta de coleta automatizada de trajetórias veiculares utilizando imagens de drone e técnicas de visão computacional

Alessandro Macêdo de Araújo, Thiago Passos Oliveira, Manoel Castro-Neto, Diêgo Farias de Oliveira, João P. P. GomesTransportes 2023 · DOI

Abstract

O objetivo principal deste trabalho é propor um procedimento de coleta automatizada de trajetórias veiculares por meio de uma ferramenta de visão computacional, aplicado a filmagens realizadas por drone. Os algoritmos foram preparados para detectar, classificar e rastrear automaticamente os veículos, e os dados foram tratados para obter as trajetórias, em 4 locais de Fortaleza. O teste do modelo indicou um bom desempenho para detectar e classificar principalmente carros, motocicletas e caminhões (98% a 99% de acerto). Verificou-se a importância da correção da posição dos objetos para compensar a movimentação do drone devido aos ventos. Os instantes de passagem dos veículos e os headways obtidos foram similares aos coletados utilizando uma ferramenta semiautomática, com 98,6% das diferenças dos instantes entre 0,0 e 0,2 segundos e 95,3% das diferenças dos headways entre -0,1 e +0,1 s.

Introduction: The Challenge of High-Fidelity Traffic Data

In traffic engineering, high-quality data is the lifeblood of effective modeling and safety analysis. However, collecting precise vehicle trajectories remains a significant challenge. Traditional computer vision (CV) setups using fixed roadside cameras often struggle with occlusions—where one vehicle hides another—and perspective distortion that complicates coordinate mapping.

Unmanned Aerial Vehicles (UAVs), or drones, offer a compelling "bird's-eye" solution, providing a clear view of traffic flow over large areas. Yet, they introduce a new technical hurdle: instability. Even high-end drones experience drift and tilt due to wind, which can make a stationary vehicle appear to be moving on a coordinate map. This research presents an automated pipeline designed to detect, classify, and track vehicles while mathematically "anchoring" the footage to ensure trajectory data is accurate enough for professional traffic analysis.

Methodology: An Automated Trajectory Pipeline

The researchers developed a two-phase pipeline focusing on CV tool adequacy and trajectory extraction.

1. Detection and Classification

The system utilizes YOLOv7 (You Only Look Once), a state-of-the-art real-time object detector. The model was trained to recognize six distinct classes: cars, motorcycles, buses, trucks, vans, and bicycles.

2. Tracking with Deep SORT

To maintain vehicle identities across frames, the pipeline employs Deep SORT. Unlike basic trackers, Deep SORT uses a deep appearance descriptor to "remember" vehicle features. This allows the system to recover a vehicle's ID even if it is briefly obscured or moves erratically, ensuring continuous trajectory data.

3. The Stabilization "Secret Sauce"

To mitigate drone movement, the team implemented a stabilization step using the ORB (Oriented FAST and Rotated BRIEF) algorithm to identify static key points in the environment, such as road markings or curbs. By applying RANSAC to calculate an affine transformation matrix, every frame is mathematically re-aligned to a single reference image. This effectively "freezes" the background, ensuring that recorded coordinates reflect only actual vehicle movement.

Experimental Setup and Datasets

The study was conducted using a DJI Phantom 4 Pro+ V2.0 at four diverse locations in Fortaleza, Brazil, including three signalized intersections and one mid-block segment.

  • Training and Validation: The model was trained on 1,722 manually labeled images.
  • Testing: Performance was evaluated on 232 independent images and 18 minutes of continuous video.
  • Benchmarking: Results were compared against RUBA (Road User Behaviour Analysis), a semi-automatic tool where a human manually logs vehicle passage times. This served as the "ground truth" for temporal accuracy.

Key Insights and Results

The implementation of the automated tool yielded several critical findings:

  • Stabilization is Essential: Without correction, vehicle paths appeared "jittery" due to drone vibration and wind. The affine transformation successfully smoothed these trajectories, revealing true driver behavior.
  • High Precision in Common Classes: The model achieved a mean Average Precision ([email protected]) of 0.919 overall. Performance for the most common classes—cars, motorcycles, and trucks—was exceptional, ranging between 98% and 99.7%.
  • Temporal and Headway Accuracy: When compared to manual human logging, 98.6% of vehicle passage times were within 0.2 seconds of the benchmark. Furthermore, "headway" (the time gap between vehicles) was within ±0.1 seconds of the manual record in 95.3% of cases.
  • Classification Challenges: The model performed slightly lower on buses (81%) and vans (86%). In the local context of Fortaleza, public transport vans share significant visual similarities with small buses, highlighting a common hurdle where local context can confuse advanced neural networks.

Conclusion and Future Directions

This research demonstrates that an automated pipeline using YOLOv7 and Deep SORT, combined with robust stabilization, can produce vehicle trajectory data comparable to labor-intensive manual methods. While the system excels at detecting major vehicle classes, future work will focus on improving detection for smaller or less frequent objects like bicycles (currently at 76.9% mAP).

The authors suggest expanding the dataset to include more diverse lighting conditions and vehicle types. Additionally, they aim to validate the entire spatial trajectory against high-precision GPS sensors to further refine the tool's spatial accuracy beyond simple passage-time validation.

Summary updated

Abstract

O objetivo principal deste trabalho é propor um procedimento de coleta automatizada de trajetórias veiculares por meio de uma ferramenta de visão computacional, aplicado a filmagens realizadas por drone. Os algoritmos foram preparados para detectar, classificar e rastrear automaticamente os veículos, e os dados foram tratados para obter as trajetórias, em 4 locais de Fortaleza. O teste do modelo indicou um bom desempenho para detectar e classificar principalmente carros, motocicletas e caminhões (98% a 99% de acerto). Verificou-se a importância da correção da posição dos objetos para compensar a movimentação do drone devido aos ventos. Os instantes de passagem dos veículos e os headways obtidos foram similares aos coletados utilizando uma ferramenta semiautomática, com 98,6% das diferenças dos instantes entre 0,0 e 0,2 segundos e 95,3% das diferenças dos headways entre -0,1 e +0,1 s.
BibTeX
@inproceedings{araujo2023ferramenta,
  author = {Alessandro Macêdo de Araújo and Thiago Passos Oliveira and Manoel Castro-Neto and Diêgo Farias de Oliveira and João P. P. Gomes},
  title = {{Ferramenta de coleta automatizada de trajetórias veiculares utilizando imagens de drone e técnicas de visão computacional}},
  booktitle = {Transportes},
  year = {2023},
  doi = {10.58922/transportes.v31i3.2886},
}
Figure