Alitra
Library for ALIgnment and TRAnsformation between fixed coordinate frames. The transform is described by a translation and a homogeneous rotation.
Developed for transforming between the fixed local coordinate-frame and the asset-fixed coordinate-frame.
Installation
Installation from pip
pip install alitra
import alitra
help(alitra)
Image alignment (see Image alignment below) requires the optional
image-alignment extra:
pip install alitra[image-alignment]
Installation from source
git clone https://github.com/equinor/alitra
cd alitra
uv sync --extra dev
You can test whether installation was successful with pytest
uv run pytest
Dependencies
The dependencies used for this package are listed in pyproject.toml and pinned in uv.lock. This ensures our builds are predictable and deterministic. This project uses uv for dependency management:
uv lock
To update the dependencies to the latest versions, run:
uv lock --upgrade
Image alignment
When two photos of the same scene are taken at different times, small differences in camera position mean a region-of-interest (ROI) polygon drawn on one photo no longer lines up with the same spot in the other. Alitra provides two functions to re-align a reference photo (and its ROI polygon) to a new source photo, so the polygon can be reused without redrawing it:
align_two_images_translation_cv2: estimates a simple (dx, dy) pixel shift using phase correlation. Fast and robust, but only correct when the camera hasn't rotated or changed perspective between the two photos (e.g. a fixed camera with minor positional drift).align_two_images_orb_bf_cv2: detects ORB keypoints and estimates a full homography (rotation, scale and perspective change included). Handles a moved/rotated camera, but needs enough distinct visual features to match between the two photos.
Both functions return the ROI polygon transformed into the new photo's coordinates. If the
transformed polygon has no overlap with the new photo at all, None is returned instead.
If it partially overlaps, the returned coordinates are clamped to valid pixel indices.
Contributing
We welcome all kinds of contributions, including code, bug reports, issues, feature requests, and documentation. The preferred way of submitting a contribution is to either make an issue on GitHub or by forking the project on GitHub and making a pull request.
How to use
The tests in this repository can be used as examples of how to use the different models and functions. The test_example.py is a good place to start.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file alitra-3.0.1.tar.gz.
File metadata
- Download URL: alitra-3.0.1.tar.gz
- Upload date:
- Size: 55.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
uv/0.12.12 {"installer":{"name":"uv","version":"0.12.12","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6a133b169a8e296bd58ac86e8a0c087e50ed33ac23791726d2b5ae56a146d46d
|
|
| MD5 |
0b5f4ca9b3c3296f20ef203099d9e0c6
|
|
| BLAKE2b-256 |
a8d8d1e301f14f3af069c33661c180015d92680e598189ef18a66cce18d88303
|
File details
Details for the file alitra-3.0.1-py3-none-any.whl.
File metadata
- Download URL: alitra-3.0.1-py3-none-any.whl
- Upload date:
- Size: 16.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
uv/0.12.12 {"installer":{"name":"uv","version":"0.12.12","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6ef402f43f616c8d931f10bca535c45fd53f87ccf06b50f795af3e8d4e356fbb
|
|
| MD5 |
75ddd0ef17ca7e6b3ca1df772e9eee91
|
|
| BLAKE2b-256 |
8afee77b48ff6124f66640ebdcec463e74923f3c67e770ce66821b1b678a013a
|