Skip to main content

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

alitra-3.0.0.tar.gz (54.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

alitra-3.0.0-py3-none-any.whl (16.6 kB view details)

Uploaded Python 3

File details

Details for the file alitra-3.0.0.tar.gz.

File metadata

  • Download URL: alitra-3.0.0.tar.gz
  • Upload date:
  • Size: 54.7 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

Hashes for alitra-3.0.0.tar.gz
Algorithm Hash digest
SHA256 ac7d3de7433ccabf6bacd15ca4781746b0d81ee42bd8daa30b809ae15080240a
MD5 33532e0569350edf66904edb9024cc0a
BLAKE2b-256 f3c0c426fa0cb1be6c0d1dc56eb08c4a4e0f92ff2aebe3f10a1df844e7a8cb73

See more details on using hashes here.

File details

Details for the file alitra-3.0.0-py3-none-any.whl.

File metadata

  • Download URL: alitra-3.0.0-py3-none-any.whl
  • Upload date:
  • Size: 16.6 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

Hashes for alitra-3.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 7f8e29e24647dbef9837ce589982c736c68d0ebe2eaf2e59cc2e783282cf08c9
MD5 1fdd025791c9c98d82554869a78d4452
BLAKE2b-256 553c824aafc341b54ada25d599ca283de7e76d46fb00d351f241abbf157c490b

See more details on using hashes here.

Release history Release notifications | RSS feed

3.0.1

2 files

This release

3.0.0 This release

2 files

2.0.0

2 files

1.1.5

2 files

1.1.3

2 files

1.1.0

2 files

1.0.16

2 files

1.0.15

2 files

1.0.14

2 files

1.0.13

2 files

1.0.12

2 files

1.0.11

2 files

1.0.9

2 files

1.0.8

2 files

1.0.6

2 files

1.0.4

2 files

1.0.3

2 files

1.0.0

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page