https://github.com/opendronemap/cameralib
Python library to perform forward and backward projection of 2D coordinates in camera space to geographic coordinates on ODM datasets
https://github.com/opendronemap/cameralib
camera odm
Last synced: 5 days ago
JSON representation
Python library to perform forward and backward projection of 2D coordinates in camera space to geographic coordinates on ODM datasets
- Host: GitHub
- URL: https://github.com/opendronemap/cameralib
- Owner: OpenDroneMap
- License: agpl-3.0
- Created: 2024-09-07T18:04:45.000Z (10 months ago)
- Default Branch: main
- Last Pushed: 2024-09-16T19:31:20.000Z (10 months ago)
- Last Synced: 2025-06-22T08:32:00.434Z (8 days ago)
- Topics: camera, odm
- Language: Python
- Homepage: https://cameralib.readthedocs.io/
- Size: 122 KB
- Stars: 8
- Watchers: 3
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
# CameraLib
A Python library to perform forward and backward projection of 2D coordinates in camera space to geographic coordinates on [ODM](https://github.com/OpenDroneMap/ODM) datasets. In simple terms, with an ODM dataset at hand you can use this library to ask:
* Given a pixel coordinate in an image, where does it correspond on the map?
* And it's inverse: given a location on the map, which images and pixels correspond to it?
## Install
```bash
pip install -U https://github.com/OpenDroneMap/CameraLib/archive/main.zip
```Note we developed the library using Python 3.12. If you're having issues with other versions of Python, you might need to relax the versions in `requirements.txt`.
## Usage
Check the [documentation](https://cameralib.readthedocs.io/) and [examples](https://github.com/OpenDroneMap/CameraLib/tree/main/examples).
Along with functions for doing coordinates projection, in the `cameralib.utils` package we also offer utilities to read certain annotation file formats. A use case for this is to use a software such as [X-AnyLabeling](https://github.com/CVHub520/X-AnyLabeling/releases) to annotate an image and then use this library to project the polygon/bounding boxes to geographic coordinates.
## Required Files in ODM project
CameraLib requires the following files from an ODM project. It's important that you process a dataset with the `--dsm` or `--dtm` option.
* `odm_dem/dsm.tif` or `odm_dem/dtm.tif`
* `odm_report/shots.geojson`
* `cameras.json`## Running the Examples
After [installing](#install) `cameralib` you can download any of the [examples](https://github.com/OpenDroneMap/CameraLib/tree/main/examples) into a folder of your choice and run:
```bash
python helloworld.py
```## Contributing
We welcome contributions! Pull requests are welcome.
## Support the Project
There are many ways to contribute to the project:
- ⭐️ us on GitHub.
- Help us test the application.
- Spread the word about OpenDroneMap on social media.
- Help answer questions on the community [forum](https://community.opendronemap.org)
- Become a contributor!## License
The code in this repository is licensed under the AGPLv3.