Global and local spectral matching of 2 or more overlapping rasters
Project description
spectralmatch: Performant Relative Radiometric Normalization toolkit with Pseudo-Invariant Features, seamlines, and other utilities for mosaics and time series
[!IMPORTANT] This library is experimental and still under heavy development.
Overview
spectralmatch provides a Python library, command line interface, and QGIS plugin with multiple algorythms to perform Relative Radiometric Normalization (RRN). It also includes utilities for generating seamlines, cloud masks, Pseudo-Invariant Features, statistics, preprocessing, and more.
Features
-
Automated, Efficient, and Scalable: Designed for large-scale workflows with no manual steps, leveraging multiprocessing and Cloud Optimized GeoTIFF support for fast, efficient processing across images, windows, and bands.
-
Resumable Processing: Save image stats and block maps for quicker reprocessing.
-
Integrated Seamline and Cloud Masking: Generate seamlines and detect clouds within the same workflow.
-
Specify Model Images Include all or specified images in the matching solution to bring all images to a central tendency or selected images spectral profile.
-
Consistent Multi-image Analysis: Performs minimal necessary adjustments to achieve inter-image consistency while preserving the original spectral characteristics.
-
Sensor and Unit Agnostic: Supports optical imagery from handheld cameras, drones, crewed aircraft, and satellites for reliable single sensor and multi-sensor analysis, while preserving spectral integrity across all pixel units—including negative values and reflectance.
-
Enhanced Imagery: Helpful when performing mosaics and time series analysis by blending large image collections and normalizing them over time, providing consistent, high-quality data for machine learning and other analytical tasks.
-
Open Source and Collaborative: Free under the MIT License with a modular design that supports community contributions and easy development of new features and workflows. Accessible through a python library, command line interface, and QGIS plugin.
Current Matching Algorithms
Global to local matching
This technique is derived from 'An auto-adapting global-to-local color balancing method for optical imagery mosaic' by Yu et al., 2017 (DOI: 10.1016/j.isprsjprs.2017.08.002). It is particularly useful for very high-resolution imagery (satellite or otherwise) and works in a two phase process. First, this method applies least squares regression to estimate scale and offset parameters that align the histograms of all images toward a shared spectral center. This is achieved by constructing a global model based on the overlapping areas of adjacent images, where the spectral relationships are defined. This global model ensures that each image conforms to a consistent radiometric baseline while preserving overall color fidelity. However, global correction alone cannot capture intra-image variability so a second local adjustment phase is performed. The overlap areas are divided into smaller blocks, and each block’s mean is used to fine-tune the color correction. This block-wise tuning helps maintain local contrast and reduces visible seams, resulting in seamless and spectrally consistent mosaics with minimal distortion.
Shows the average spectral profile of two WorldView 3 images before and after global to local matching.
Assumptions
-
Consistent Spectral Profile: The true spectral response of overlapping areas remains the same throughout the images.
-
Least Squares Modeling: A least squares approach can effectively model and fit all images' spectral profiles.
-
Scale and Offset Adjustment: Applying scale and offset corrections can effectively harmonize images.
-
Minimized Color Differences: The best color correction is achieved when color differences are minimized.
-
Geometric Alignment: Images are assumed to be geometrically aligned with known relative positions via a geotransform. However, they only need to be roughly aligned as pixel co-registration is not required.
-
Global Consistency: Overlapping color differences are consistent across the entire image.
-
Local Adjustments: Block-level color differences result from the global application of adjustments.
Quick Installation (Other methods)
Installation as a QGIS Plugin
Install the spectralmatch plugin in QGIS and use it in the Processing Toolbox.
Installation as a Python Library and CLI
Before installing, ensure you have the following system-level prerequisites: Python ≥ 3.10, pip, PROJ ≥ 9.3, and GDAL = 3.10.2. Use this command to install the library:
pip install spectralmatch
Documentation
Documentation is available at spectralmatch.github.io/spectralmatch/.
Contributing Guide
Contributing Guide is available at spectralmatch.github.io/spectralmatch/contributing.
License
This project is licensed under the MIT License. See LICENSE for details.
Project details
Release history Release notifications | RSS feed
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 spectralmatch-1.0.0.tar.gz.
File metadata
- Download URL: spectralmatch-1.0.0.tar.gz
- Upload date:
- Size: 33.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
56e6c90e75f08fa71667238a7abcc460c7788324320d9ef2c9417e142f1a8f89
|
|
| MD5 |
442b3a4a48d8c71e7625640b0d0c7ce4
|
|
| BLAKE2b-256 |
a94939be15d45e523e1c56119afc794c0619c0ab4f96d5df3d4df6f5486d8a40
|
Provenance
The following attestation bundles were made for spectralmatch-1.0.0.tar.gz:
Publisher:
publish.yml on spectralmatch/spectralmatch
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
spectralmatch-1.0.0.tar.gz -
Subject digest:
56e6c90e75f08fa71667238a7abcc460c7788324320d9ef2c9417e142f1a8f89 - Sigstore transparency entry: 245818983
- Sigstore integration time:
-
Permalink:
spectralmatch/spectralmatch@2ba24ba42e5a5097c06e3ab17d7b7e0173102583 -
Branch / Tag:
refs/tags/v1.0.0 - Owner: https://github.com/spectralmatch
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@2ba24ba42e5a5097c06e3ab17d7b7e0173102583 -
Trigger Event:
push
-
Statement type:
File details
Details for the file spectralmatch-1.0.0-py3-none-any.whl.
File metadata
- Download URL: spectralmatch-1.0.0-py3-none-any.whl
- Upload date:
- Size: 25.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7bbc3dba19c1373e9fd90cdef57ac542f7f7b336f88de11808cc561e352c0b84
|
|
| MD5 |
235e0aa6a2024cffdb6dd666ac4c9c37
|
|
| BLAKE2b-256 |
36b785d29e2ba530dfdb35dbdfbf8afa4a16f06b45006b90cf1caaaa943bff02
|
Provenance
The following attestation bundles were made for spectralmatch-1.0.0-py3-none-any.whl:
Publisher:
publish.yml on spectralmatch/spectralmatch
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
spectralmatch-1.0.0-py3-none-any.whl -
Subject digest:
7bbc3dba19c1373e9fd90cdef57ac542f7f7b336f88de11808cc561e352c0b84 - Sigstore transparency entry: 245818985
- Sigstore integration time:
-
Permalink:
spectralmatch/spectralmatch@2ba24ba42e5a5097c06e3ab17d7b7e0173102583 -
Branch / Tag:
refs/tags/v1.0.0 - Owner: https://github.com/spectralmatch
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@2ba24ba42e5a5097c06e3ab17d7b7e0173102583 -
Trigger Event:
push
-
Statement type: