A Python library to perform forward and backward projection of 2D coordinates in camera space to geographic coordinates on 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?
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
.
Check the documentation and 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 to annotate an image and then use this library to project the polygon/bounding boxes to geographic coordinates.
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
orodm_dem/dtm.tif
odm_report/shots.geojson
cameras.json
After installing cameralib
you can download any of the examples into a folder of your choice and run:
python helloworld.py
We welcome contributions! Pull requests are welcome.
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
- Become a contributor!
The code in this repository is licensed under the AGPLv3.