geo-trax

🚀 Geo-trax is a comprehensive pipeline for extracting and analyzing high-accuracy georeferenced vehicle trajectories from quasi-stationary, bird’s-eye view drone footage. Using advanced computer vision and deep learning, it enables detailed urban traffic analysis and supports scalable, precise studies of vehicle dynamics.

https://github.com/rfonod/geo-trax

Science Score: 67.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • ✓
    CITATION.cff file
    Found CITATION.cff file
  • ✓
    codemeta.json file
    Found codemeta.json file
  • ✓
    .zenodo.json file
    Found .zenodo.json file
  • ✓
    DOI references
    Found 11 DOI reference(s) in README
  • ✓
    Academic publication links
    Links to: arxiv.org, zenodo.org
  • â—‹
    Committers with academic emails
  • â—‹
    Institutional organization owner
  • â—‹
    JOSS paper metadata
  • â—‹
    Scientific vocabulary similarity
    Low similarity (12.7%) to scientific vocabulary

Keywords

birds-eye-view computer-vision georeferencing object-detection object-tracking opencv-python stabilo traffic-analysis trajectory-extraction ultralytics vehicle-detection-and-tracking video-analytics yolo
Last synced: 4 months ago · JSON representation ·

Repository

🚀 Geo-trax is a comprehensive pipeline for extracting and analyzing high-accuracy georeferenced vehicle trajectories from quasi-stationary, bird’s-eye view drone footage. Using advanced computer vision and deep learning, it enables detailed urban traffic analysis and supports scalable, precise studies of vehicle dynamics.

Basic Info
Statistics
  • Stars: 8
  • Watchers: 1
  • Forks: 0
  • Open Issues: 0
  • Releases: 5
Topics
birds-eye-view computer-vision georeferencing object-detection object-tracking opencv-python stabilo traffic-analysis trajectory-extraction ultralytics vehicle-detection-and-tracking video-analytics yolo
Created over 1 year ago · Last pushed 6 months ago
Metadata Files
Readme License Citation

README.md

Geo-trax

GitHub Release Python License Development Status Open Access arXiv Archived Code YouTube

Geo-trax (GEO-referenced TRAjectory eXtraction) is a comprehensive pipeline for extracting high-accuracy georeferenced vehicle trajectories from high-altitude drone imagery. Designed specifically for quasi-stationary aerial monitoring in urban traffic scenarios, Geo-trax transforms raw, bird's-eye view video footage into precise, real-world vehicle trajectories. The framework integrates state-of-the-art computer vision and deep learning modules for vehicle detection, tracking, and trajectory stabilization, followed by a georeferencing stage that employs image registration to align the stabilized video frames with an orthophoto. This registration enables the accurate mapping of vehicle trajectories to real-world coordinates. The resulting pipeline supports large-scale traffic studies by delivering spatially and temporally consistent trajectory data suitable for traffic behavior analysis and simulation. Geo-trax is optimized for urban intersections and arterial corridors, where high-fidelity vehicle-level insights are essential for intelligent transportation systems (ITS) and digital twin applications.

Geo-trax Visualization GIF

This animation previews some of the capabilities of Geo-trax. Watch the full demonstration (~4min) on YouTube.

Pipeline diagram

Geo-trax pipeline diagram: raw drone video  detection  tracking  stabilization  georeferencing  dataset

This diagram shows a high-level overview of the Geo-trax processing pipeline from raw drone footage to georeferenced vehicle trajectories; it also highlights optional human annotation and auxiliary vision-data generation steps.

Features

  1. Vehicle Detection: Utilizes a pre-trained YOLOv8 model to detect vehicles (cars, buses, trucks, and motorcycles) in the video frames.
  2. Vehicle Tracking: Implements a selected tracking algorithm to follow detected vehicles, ensuring robust trajectory data and continuity across frames.
  3. Trajectory Stabilization: Corrects for unintentional drone movement by aligning trajectories to a reference frame, using bounding boxes of detected vehicles to enhance stability. Leverages the stabilo library, fine-tuned by stabilo-optimize , to achieve reliable, consistent stabilization.
  4. Georeferencing: Maps stabilized trajectories to real-world coordinates using an orthophoto and image registration technique.
  5. Dataset Creation: Compiles trajectory and related metadata (e.g., velocity, acceleration, dimension estimates) into a structured dataset.
  6. Visualization Tools: Visualizes extracted trajectories, overlays paths on video frames, and generates plots for traffic data analysis.
  7. Auxiliary Tools: Data wrangling, analysis, and model training scripts/tools provided to support dataset preparation, advanced analytics, and custom model development.
  8. Customization and Configuration: Flexible configuration options to adjust pipeline settings, including detection/tracking parameters, stabilization methods, and visualization modes.

Note: This is a preliminary version of the pipeline. Some functionalities, especially auxiliary tools for data wrangling, analysis, and model training, are under development () and will be included in future releases.

Planned Enhancements ### Release Plan - **Version =1.0.0** - Tools for comparing extracted trajectories with on-board sensor data. - Release all auxiliary tools for data wrangling, analysis, and (re-)training the detection model. - Basic documentation and examples covering all core functionalities. - Sample data for testing and demonstration purposes. - **Version >1.0.0** - Pre-processing tools for raw video input. - Expanded documentation, tutorials (docs folder), and sample examples. - List of known limitations, e.g., ffmpeg backend version discrepancies in OpenCV. - Comprehensive unit tests for critical functions and end-to-end tests for the entire pipeline. - Publishing on PyPI for simplified installation and distribution. - **Version 2.0.0** - Upgrades to the latest ultralytics (>8.2) and numpy (>2.0) versions. - Support for additional tracking algorithms and broader vehicle type recognition. - Transition to a modular package layout for enhanced maintainability. - Implementation of batch inference and multi-thread processing to improve scalability. - Automated testing workflows with GitHub Actions.

Field Deployment

Geo-trax was validated in a large-scale urban traffic monitoring experiment conducted in Songdo, South Korea. In this study, Geo-trax was used to process aerial video data captured by a fleet of 10 drones, resulting in the creation of the Songdo Traffic dataset. The underlying vehicle detection model in Geo-trax was trained using the Songdo Vision dataset. Both datasets are described in detail in the associated publication, see the citation section below.

Demo video of Geo-trax applied to the Songdo field experiment: https://youtu.be/gOGivL9FFLk

Installation

  1. Create and activate a Python virtual environment (Python >= 3.9 and <= 3.12), e.g., using Miniconda3:

    bash conda create -n geo-trax python=3.11 -y conda activate geo-trax

    or using venv:

    bash python3.11 -m venv .venv source .venv/bin/activate # On Windows, use `.venv\Scripts\activate`

  2. Clone or fork the repository:

    bash git clone https://github.com/rfonod/geo-trax.git cd geo-trax

  3. Install dependencies from pyproject.toml:

    bash pip install -e .

    Note: Installing in editable mode (-e) is recommended, as it allows immediate reflection of code changes.

  4. [Optional] Install development dependencies (for development, testing, or other non-core auxiliary scripts):

- In `bash`:

  ```bash
  pip install -e .[dev]
  ```

- In `zsh` (quotes required to prevent shell expansion of `[]`):

  ```zsh
  pip install -e '.[dev]'
  ```

Batch Processing Example

The batch_process.py script can process multiple videos in a directory, including subdirectories, or a single video file.

Example 1: Process all files in a directory without georeferencing

bash python batch_process.py path/to/videos/ --no-geo

Example 2: Customize arguments for a specific video

bash python batch_process.py video.mp4 -c cfg/custom_config.yaml

Example 3: Process and save visualization for a specific video

bash python batch_process.py video.mp4 --save

Example 4: Save tracking results in video without re-running extraction

bash python batch_process.py video.mp4 --viz-only --save

Example 5: Overwrite existing files with no confirmation prompt

bash python batch_process.py path/to/videos/ -o -y

[!TIP] For more details and usage instructions, run:

bash python batch_process.py -h

Output File Formats Suppose the input video is named `video.mp4`. The output files will be saved in the `results` folder relative to the input video. The following files will be generated: - **video.txt**: Contains the extracted vehicle trajectories in the following format: ```text frame_id, vehicle_id, x_c(unstab), y_c(unstab), w(unstab), h(unstab), x_c(stab), y_c(stab), w(stab), h(stab), class_id, confidence, vehicle_length, vehicle_width ``` where: - `frame_id`: Frame number (0, 1, ...). - `vehicle_id`: Unique vehicle identifier (1, 2, ...). - `x_c(unstab)`, `y_c(unstab)`: Unstabilized vehicle centroid coordinates. - `w(unstab)`, `h(unstab)`: Unstabilized vehicle bounding box width and height. - `x_c(stab)`, `y_c(stab)`: Stabilized vehicle centroid coordinates. - `w(stab)`, `h(stab)`: Stabilized vehicle bounding box width and height. - `class_id`: Vehicle class identifier (0: car (incl. vans), 1: bus, 2: truck, 3: motorcycle) - `confidence`: Detection confidence score (0-1). - `vehicle_length`, `vehicle_width`: Estimated vehicle dimensions in pixels. - **video_vid_transf.txt**: Contains the transformation matrix for each frame in the format: ```text frame_id, h11, h12, h13, h21, h22, h23, h31, h32, h33 ``` where - `frame_id`: Frame number (1, 2, ...). - `hij`: Elements of the 3x3 homography matrix that maps each frame (`frame_id`) to the reference frame (frame 0). - **video.yaml**: Video metadata and the configuration settings used for processing the `video.mp4`. (this file is saved in the same directory as the input video.) - **video_mode_X.mp4**: Processed video in various visualization modes (X = 0, 1, 2): - **Mode 0**: Results overlaid on the original (unstabilized) video. - **Mode 1**: Results overlaid on the stabilized video. - **Mode 2**: Results plotted on top of the static reference frame. Each version can display vehicle bounding boxes, IDs, class labels, confidence scores, and short trajectory trails that fade and vary in thickness to indicate the recency of the movement. If an input `video.csv` file is available in the same directory as the input video, i.e., the converted flight logs, vehicle speed and lane information can be also displayed. - **video.csv**: Contains the georeferenced vehicle trajectories in a tabular format. This file includes both geographic and local coordinates, estimated real-world dimensions, kinematic data, road section, and lane information. The columns are: ```text Vehicle_ID, Timestamp, Ortho_X, Ortho_Y, Local_X, Local_Y, Latitude, Longitude, Vehicle_Length, Vehicle_Width, Vehicle_Class, Vehicle_Speed, Vehicle_Acceleration, Road_Section, Lane_Number, Visibility ``` where: - `Vehicle_ID`: Unique vehicle identifier. - `Timestamp`: Timestamp of the frame (YYYY-MM-DD HH:MM:SS.ms). - `Ortho_X`, `Ortho_Y`: X and Y coordinates of the vehicle centroid in the orthophoto's pixel coordinate system. - `Local_X`, `Local_Y`: X and Y coordinates of the vehicle centroid in a local projected coordinate system (e.g., EPSG:32633 for UTM zone 33N). - `Latitude`, `Longitude`: Geographic coordinates of the vehicle centroid (WGS84). - `Vehicle_Length`, `Vehicle_Width`: Estimated vehicle dimensions in meters. - `Vehicle_Class`: Vehicle class identifier (0: car (incl. vans), 1: bus, 2: truck, 3: motorcycle). - `Vehicle_Speed`: Estimated vehicle speed in km/h. - `Vehicle_Acceleration`: Estimated vehicle acceleration in m/s$^2$. - `Road_Section`: Identifier for the road segment the vehicle is on. - `Lane_Number`: Identifier for the lane the vehicle is in. - `Visibility`: Boolean indicating if the vehicle's bounding box is fully visible within the frame. - **video_geo_transf.txt**: Contains the 3x3 georeferencing transformation matrix (homography) that maps points from the video's reference frame to the orthomap. The format is a comma-separated list of the 9 matrix elements: ```text h11, h12, h13, h21, h22, h23, h31, h32, h33 ``` **Note:** *All output files (except `video.yaml`) are saved in the `results` folder relative to the input video.*

Citation

If you use Geo-trax in your research, software, or to generate datasets, please cite the following resources appropriately:

  1. Preferred Citation: Please cite the associated article for any use of the Geo-trax framework, including research, applications, and derivative work:

    bibtex @article{fonod2025advanced, title = {Advanced computer vision for extracting georeferenced vehicle trajectories from drone imagery}, author = {Fonod, Robert and Cho, Haechan and Yeo, Hwasoo and Geroliminis, Nikolas}, journal = {Transportation Research Part C: Emerging Technologies}, volume = {178}, pages = {105205}, year = {2025}, publisher = {Elsevier}, doi = {10.1016/j.trc.2025.105205}, url = {https://doi.org/10.1016/j.trc.2025.105205} }

  2. Repository Citation: If you reference, modify, or build upon the Geo-trax software itself, please also cite the corresponding Zenodo release:

    bibtex @software{fonod2025geo-trax, author = {Fonod, Robert}, license = {MIT}, month = may, title = {Geo-trax: A Comprehensive Framework for Georeferenced Vehicle Trajectory Extraction from Drone Imagery}, url = {https://github.com/rfonod/geo-trax}, doi = {10.5281/zenodo.12119542}, version = {0.6.0}, year = {2025} }

Contributions

The georeferencing code was developed with contributions from Haechan Cho.

Contributions from the community are welcome! If you encounter any issues or have suggestions for improvements, please open a GitHub Issue or submit a pull request.

License

This project is distributed under the MIT License. See the LICENSE file for more details.

Owner

  • Name: Robert Fonod
  • Login: rfonod
  • Kind: user

Citation (CITATION.cff)

cff-version: 1.2.0
title: "Geo-trax: A Comprehensive Framework for Georeferenced Vehicle Trajectory Extraction from Drone Imagery"
message: "If you use this software, please cite the software and the paper."
type: software
authors:
  - given-names: Robert
    family-names: Fonod
    email: robert.fonod@ieee.org
    affiliation: EPFL
    orcid: 'https://orcid.org/0000-0002-9434-3156'
identifiers:
  - type: doi
    value: 10.5281/zenodo.12119542
    description: Zenodo archive
repository-code: 'https://github.com/rfonod/geo-trax'
url: 'https://github.com/rfonod/geo-trax'
license: MIT
version: 0.6.0
date-released: '2025-07-07'
preferred-citation:
  type: article
  title: "Advanced computer vision for extracting georeferenced vehicle trajectories from drone imagery"  
  authors:
    - family-names: Fonod
      given-names: Robert
    - family-names: Cho
      given-names: Haechan
    - family-names: Yeo
      given-names: Hwasoo
    - family-names: Geroliminis
      given-names: Nikolas
  year: 2025
  journal: "Transportation Research Part C: Emerging Technologies"
  volume: 178
  start: 105205
  end: ""
  publisher:
    name: "Elsevier"
  doi: "10.1016/j.trc.2025.105205"
  url: "https://doi.org/10.1016/j.trc.2025.105205"

GitHub Events

Total
  • Release event: 4
  • Watch event: 12
  • Push event: 11
  • Fork event: 3
  • Create event: 4
Last Year
  • Release event: 4
  • Watch event: 12
  • Push event: 11
  • Fork event: 3
  • Create event: 4

Committers

Last synced: 10 months ago

All Time
  • Total Commits: 14
  • Total Committers: 1
  • Avg Commits per committer: 14.0
  • Development Distribution Score (DDS): 0.0
Past Year
  • Commits: 14
  • Committers: 1
  • Avg Commits per committer: 14.0
  • Development Distribution Score (DDS): 0.0
Top Committers
Name Email Commits
Robert Fonod 7****d 14

Issues and Pull Requests

Last synced: 9 months ago

All Time
  • Total issues: 0
  • Total pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Total issue authors: 0
  • Total pull request authors: 0
  • Average comments per issue: 0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 0
  • Pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Issue authors: 0
  • Pull request authors: 0
  • Average comments per issue: 0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
Pull Request Authors
Top Labels
Issue Labels
Pull Request Labels

Dependencies

pyproject.toml pypi