stabilo

🌀 Stabilo is a Python package for stabilizing video frames or object trajectories using advanced transformation techniques. It supports user-defined masks to exclude specific areas, making it ideal for dynamic scenes with moving objects. Unlike traditional stabilization, it stabilizes content relative to a chosen reference frame.

https://github.com/rfonod/stabilo

Science Score: 49.0%

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

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

Keywords

computer-vision feature-extraction feature-matching homography-estimation image-processing image-registration opencv ransac stabilization video-processing video-stabilization
Last synced: 6 months ago · JSON representation

Repository

🌀 Stabilo is a Python package for stabilizing video frames or object trajectories using advanced transformation techniques. It supports user-defined masks to exclude specific areas, making it ideal for dynamic scenes with moving objects. Unlike traditional stabilization, it stabilizes content relative to a chosen reference frame.

Basic Info
Statistics
  • Stars: 9
  • Watchers: 2
  • Forks: 1
  • Open Issues: 0
  • Releases: 3
Topics
computer-vision feature-extraction feature-matching homography-estimation image-processing image-registration opencv ransac stabilization video-processing video-stabilization
Created over 1 year ago · Last pushed 8 months ago
Metadata Files
Readme License Citation

README.md

Stabilo

PyPI Version GitHub Release Python License Development Status Open Access arXiv Archived Code PyPi - Total Downloads PyPI - Downloads per Month

Stabilo is a specialized Python package for stabilizing video frames or tracked object trajectories in videos, using robust homography or affine transformations. Its core functionality focuses on aligning each frame or object track to a chosen reference frame, enabling precise stabilization that mitigates disturbances like camera movements. Key features include robust keypoint-based image registration and the option to integrate user-defined masks, which exclude dynamic regions (e.g., moving objects) to enhance stabilization accuracy. Integrating seamlessly with object detection and tracking algorithms, Stabilo is ideal for high-precision applications like urban traffic monitoring, as demonstrated in the geo-trax trajectory extraction framework. Extensive transformation and enhancement options, including multiple feature detectors and matchers, masking techniques, further expand its utility. For systematic evaluation and hyperparameter tuning, the companion tool stabilo-optimize provides a dedicated benchmarking framework. The repository also includes valuable resources like utility scripts and example videos to demonstrate its capabilities.

Stabilization Visualization GIF

Features

  • Video Stabilization: Align (warp) all video frames to a custom (anchor) reference frame using homography or affine transformations.
  • Trajectory Stabilization: Transform object trajectories (e.g., bounding boxes) to a common fixed reference frame using homography or affine transformations.
  • User-Defined Masks: Allow users to specify custom masks to exclude regions of interest during stabilization.
  • Wide Range of Algorithms: Includes support for various feature detectors (ORB, SIFT, RSIFT, BRISK, KAZE, AKAZE), matchers (BF, FLANN), RANSAC algorithms (MAGSAC++, DEGENSAC, ...), transformation types, and pre-processing options.
  • Customizable Parameters: Fine-tune the stabilization by adjusting parameters such as the number of keypoints, RANSAC parameters, matching thresholds, downsampling factors, etc..
  • Visualization Tools: Generate visualizations of the stabilization process, with frame-by-frame comparisons and trajectory transformations (see the above animation).
  • Threshold Analysis: Analyze the relationship between detection thresholds and keypoint counts for BRISK, KAZE, and AKAZE to fairly benchmark with different detectors.
  • Benchmarking and Optimization: Fine-tune stabilization parameters with stabilo-optimize , which provides ground truth-free evaluation using random perturbations.
Planned Enhancements - **Unit Tests**: Comprehensive unit test suite to ensure package stability and reliability. - **Different Mask Types**: Inclusion of additional mask types (e.g., polygonal, circular) for enhanced precision in stabilization. - **GPU Acceleration**: Integration of GPU acceleration to improve processing speed. - **Documentation**: Detailed documentation covering the packages functionality and usage.

Installation

It is recommended to create and activate a Python Virtual Environment (Python >= 3.9) first using e.g., Miniconda3:

bash conda create -n stabilo python=3.11 -y conda activate stabilo

Then, install the stabilo library using one of the following options:

Option 1: Install from PyPI

bash pip install stabilo

Option 2: Install from Local Source

You can also clone the repository and install the package from the local source:

bash git clone https://github.com/rfonod/stabilo.git cd stabilo && pip install .

If you want the changes you make in the repo to be reflected in your install, use pip install -e . instead of pip install ..

Python API Usage

```python from stabilo import Stabilizer

Create an instance of the Stabilizer class with default parameters

stabilizer = Stabilizer()

Set a reference frame with (optional) mask

stabilizer.setrefframe(refframe, refmask)

Stabilize any frame with (optional) mask

stabilizer.stabilize(curframe, curmask)

Get the stabilized (warped) frame

stabilizedframe = stabilizer.warpcur_frame()

Transform current masks (bounding boxes) if it was provided

stabilizedboxes = stabilizer.transformcur_boxes()

Transform any point (pixel coordinates) from the current frame to reference frame

curpoint = np.array([x, y, 1]) refpoint = stabilizer.getcurtransmatrix() @ curpoint ```

Utility Scripts

Utility scripts are provided to demonstrate the functionality of the Stabilo package. These scripts can be found in the scripts directory and are briefly documented in the scripts README.

Stabilization Examples

  • stabilize_video.py: Implements video stabilization relative to a reference frame.
  • stabilize_boxes.py: Implements object trajectory stabilization relative to a reference frame.

Threshold Analysis

  • find_threshold_models.py: Computes regression models between detection thresholds and average keypoint counts for BRISK, KAZE, and AKAZE feature detectors.

Citing This Work

If you use Stabilo in your research, software, or product, please cite the following resources appropriately:

  1. Preferred Citation: Please cite the associated article for any use of the Stabilo package, 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 Stabilo software itself, please also cite the corresponding Zenodo release:

    bibtex @software{fonod2025stabilo, author = {Fonod, Robert}, license = {MIT}, month = apr, title = {Stabilo: A Comprehensive Python Library for Video and Trajectory Stabilization with User-Defined Masks}, url = {https://github.com/rfonod/stabilo}, doi = {10.5281/zenodo.12117092}, version = {1.0.1}, year = {2025} }

Contributing

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

GitHub Events

Total
  • Release event: 1
  • Watch event: 6
  • Push event: 5
  • Fork event: 1
  • Create event: 1
Last Year
  • Release event: 1
  • Watch event: 6
  • Push event: 5
  • Fork event: 1
  • Create event: 1

Issues and Pull Requests

Last synced: 6 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

Packages

  • Total packages: 1
  • Total downloads:
    • pypi 51 last-month
  • Total dependent packages: 0
  • Total dependent repositories: 0
  • Total versions: 2
  • Total maintainers: 1
pypi.org: stabilo

Stabilizes video or extracted trajectories with respect to a selected reference frame in the video, with optional user-provided masks.

  • Homepage: https://github.com/rfonod/stabilo/
  • Documentation: https://stabilo.readthedocs.io/
  • License: MIT License Copyright (c) 2025 Robert Fonod Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  • Latest release: 1.0.1
    published 10 months ago
  • Versions: 2
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Downloads: 51 Last month
Rankings
Dependent packages count: 10.0%
Average: 33.2%
Dependent repos count: 56.4%
Maintainers (1)
Last synced: 6 months ago

Dependencies

pyproject.toml pypi
  • numpy >=1.26.4,<2.0
  • opencv-python >=4.6.0
  • pyyaml >=5.3.1
  • tqdm >=4.64.0