Pairwise raster coregistration for geospatial imagery
Project description
Coregix
Coregix provides pairwise raster coregistration for geospatial imagery.
Coregix coregisters a source raster to a reference raster while preserving geospatial metadata and multi-band outputs. By default, it estimates a translation followed by a rigid transform using mutual-information optimization, then applies the resulting transform to produce a coregistered GeoTIFF.
Current scope:
- pairwise GeoTIFF coregistration CLI and Python API
- edge-proxy registration for cross-sensor structural alignment
- chunked transform application for large source rasters
- optional postprocess trimming of invalid edge artifacts
Install
Conda environment
conda env create -f environment.yml
conda activate coregix
This installs the runtime stack and the package in editable mode.
Editable install into an existing environment
pip install -e .
The installed CLI entrypoint is:
align-image-pair --help
You can also run the module directly:
python -m coregix.cli.align_image_pair --help
Docker
Build the image from the repository root:
docker build -t coregix .
Release images are published to Docker Hub as iosefa/coregix.
Run the CLI with a mounted data directory:
docker run --rm \
-v "$PWD:/data" \
iosefa/coregix:latest \
--moving-image /data/source.tif \
--fixed-image /data/reference.tif \
--output-image /data/aligned.tif
If you built the image locally, use coregix instead of iosefa/coregix:latest.
CLI usage
Coregister a source image to a reference image
align-image-pair \
--moving-image /path/to/source.tif \
--fixed-image /path/to/reference.tif \
--output-image /path/to/aligned.tif
By default this:
- registers on edge-proxy images
- writes the result on the source-raster grid
- uses no chunking (
--split-factor 0)
Use chunking for large source rasters
--split-factor controls chunked transform application as 2^k total chunks:
0: no split1: halves2: quadrants3: octants
Example with quadrants:
align-image-pair \
--moving-image /path/to/source_large.tif \
--fixed-image /path/to/reference.tif \
--output-image /path/to/aligned_large.tif \
--split-factor 2
Use coarse-to-fine registration for large initial offsets
--solve-resolutions runs multiple registration solves from coarse to fine,
then writes the final raster once from the original source image. Use 0 for
the reference-raster/native solve resolution.
--solve-resolution is deprecated and remains available for single-pass
compatibility. Prefer --solve-resolutions, even for one solve.
align-image-pair \
--moving-image /path/to/source_large.tif \
--fixed-image /path/to/reference.tif \
--output-image /path/to/aligned_large.tif \
--split-factor 2 \
--solve-resolutions 8,4,0.5
Remove invalid edge artifacts after alignment
--trim-edge-invalid runs a raster-space cleanup pass after alignment and sets edge artifacts to nodata.
Example:
align-image-pair \
--moving-image /path/to/source_large.tif \
--fixed-image /path/to/reference.tif \
--output-image /path/to/aligned_large_edgefixed.tif \
--split-factor 2 \
--trim-edge-invalid \
--edge-trim-depth 8 \
--edge-trim-invalid-below -3000
The edge-trim thresholds are dataset-specific. --edge-trim-invalid-below is useful when interpolation artifacts are not equal to the dataset nodata value.
Python usage
Basic alignment
from coregix import align_image_pair
result = align_image_pair(
moving_image_path="/path/to/source.tif",
fixed_image_path="/path/to/reference.tif",
output_image_path="/path/to/aligned.tif",
)
print(result.output_image_path)
Large raster with chunking and edge cleanup
from coregix import align_image_pair
result = align_image_pair(
moving_image_path="/path/to/source_large.tif",
fixed_image_path="/path/to/reference.tif",
output_image_path="/path/to/aligned_large_edgefixed.tif",
split_factor=2,
trim_edge_invalid=True,
edge_trim_depth=8,
edge_trim_invalid_below=-3000,
)
print(result.output_image_path)
Notes
split_factorchanges only transform application, not the registration model.split_factor=2is the direct replacement for the previous quadrant-based large-raster path.- If needed, you can select separate registration bands with
moving_band_indexandfixed_band_indexin Python or--moving-band-indexand--fixed-band-indexin the CLI.
Project details
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 coregix-0.3.0.tar.gz.
File metadata
- Download URL: coregix-0.3.0.tar.gz
- Upload date:
- Size: 32.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8c93e1fbd9053df6c508801d807dd8926bc3de93191ea95fe49d4155e30e2236
|
|
| MD5 |
9c9b7e4cfdd6735aef24d15c4bd75960
|
|
| BLAKE2b-256 |
52eaa5485a8b24969187274685a1e9b52a4d61660d24c998be2718f958eb4a75
|
Provenance
The following attestation bundles were made for coregix-0.3.0.tar.gz:
Publisher:
publish-pypi.yml on iosefa/coregix
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
coregix-0.3.0.tar.gz -
Subject digest:
8c93e1fbd9053df6c508801d807dd8926bc3de93191ea95fe49d4155e30e2236 - Sigstore transparency entry: 1566584869
- Sigstore integration time:
-
Permalink:
iosefa/coregix@c07cc2a8420d57970f017f6eb9259ca071504d3e -
Branch / Tag:
refs/tags/v0.3.0 - Owner: https://github.com/iosefa
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@c07cc2a8420d57970f017f6eb9259ca071504d3e -
Trigger Event:
push
-
Statement type:
File details
Details for the file coregix-0.3.0-py3-none-any.whl.
File metadata
- Download URL: coregix-0.3.0-py3-none-any.whl
- Upload date:
- Size: 31.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2498b9584696b5e218c25a9bffd4c449cc665569bd3d1829a68b82a65728916a
|
|
| MD5 |
c4d5ccb633f11e257ab904406d90996b
|
|
| BLAKE2b-256 |
2adbdc6fcf16c0670ed94e6d81dd231eb659f22f2f4f2bab9ecef950393eec9e
|
Provenance
The following attestation bundles were made for coregix-0.3.0-py3-none-any.whl:
Publisher:
publish-pypi.yml on iosefa/coregix
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
coregix-0.3.0-py3-none-any.whl -
Subject digest:
2498b9584696b5e218c25a9bffd4c449cc665569bd3d1829a68b82a65728916a - Sigstore transparency entry: 1566584887
- Sigstore integration time:
-
Permalink:
iosefa/coregix@c07cc2a8420d57970f017f6eb9259ca071504d3e -
Branch / Tag:
refs/tags/v0.3.0 - Owner: https://github.com/iosefa
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@c07cc2a8420d57970f017f6eb9259ca071504d3e -
Trigger Event:
push
-
Statement type: