Skip to content

Band alignment

In general, image alignment is about measuring the transformation or deformation that exists between two images. In this particular case, when talking about band alignment, the compared images are actually representations of the same content in different ranges of frequencies along the electromagnetic spectrum.

Approach

Two main approaches exist in the industry for band alignment assessment:

a) Fixed reference approach: A single reference band is chosen and other bands (or a subset of them) are compared against it using pairwise comparisons. The reference band is typically selected based on its position in the electromagnetic spectrum and/or its characteristics for feature detection, such as lower noise levels or higher sharpness.

b) Sequential reference approach: Bands are ordered by frequency (light frequency or frequency interval), and each band is sequentially taken as a reference against the next, resulting in dynamic reference bands.

Our implementation follows approach (a), using the Green band as the fixed reference. Alignment measurements are computed for:

  • Red band relative to Green
  • Blue band relative to Green
  • NIR band relative to Green

This fixed reference approach simplifies interpretation and ensures consistency: any alignment issues with any target band are directly measured against a single, stable reference, avoiding potential error accumulation from sequential comparisons.

Background

As we ought to compare two images, the exact same background holds as for the geoaccuracy estimator. See here for details.

KPIs

1. Maximum circular error at the 95th percentile

The primary alignment KPI is the maximum CE95 across all band pairs. This metric represents the worst-case alignment error.

The 95th percentile of the radial (2D) shift magnitudes across all valid measurements. This means that 95% of the estimated band displacements fall within a circle of this radius.

For computing the error, we take the following steps:

  1. For each band pair (red-green, blue-green, NIR-green), compute the radial shift magnitude for each measurement: $$ \text{shift}_{\text{radial}} = \sqrt{\Delta x^2 + \Delta y^2} $$ where:

    • \(\Delta x\) = easting shift is the eastward displacement (in metric units) of the target band relative to the reference band, computed by phase correlation
    • \(\Delta y\) = northing shift is the northward displacement (in metric units) of the target band relative to the reference band, computed by phase correlation
  2. Calculate the 95th percentile of these magnitudes: \(\text{CE95}_{\text{band}} = \text{quantile}(\text{shift}_{\text{radial}}, 0.95)\), where \(\text{band}\) is the target band compared to the green band.

  3. Report the maximum CE95 across all band pairs: \(\text{shift\_max\_ce95} = \max(\text{CE95}_{\text{red}}, \text{CE95}_{\text{blue}}, \text{CE95}_{\text{NIR}})\)

This worst-case approach ensures that potential registration problems with any spectral band are captured in the overall quality assessment.

Measurement procedure

The procedure for measuring alignment between two bands involves multiple processing steps, combining spatial filtering, phase correlation analysis, and statistical aggregation. The following steps are implemented:

1. Reference map acquisition and preparation

The land-use-land-cover (LULC) class map (source: 10m Annual Land Use Land Cover derived from ESA Sentinel-2) corresponding to the extent of the image is obtained. If necessary, the map is reprojected to the coordinate reference system (CRS) of the input image. This map is used in subsequent filtering stages to exclude unreliable measurements from water bodies and other problematic terrain types.

2. Image division into windows

For efficiency and parallel processing, the image is divided into a regular grid of non-overlapping (or partially overlapping) windows. Window parameters include:

  • Window size: 200×200 pixels
  • Window step: The spacing between window centers (we take it to be equal to the window size for non-overlapping windows)
  • Statistical information: For each window, basic statistics (total number of pixels and how many of those are valid, mean and standard deviation) are precomputed on the reference band

3. Window pre-classification and filtering (part 1)

Before computing shifts, windows are pre-classified using the LULC map and cloud mask as follows:

  • 3.1 Cloud coverage: Windows with cloud coverage above 10% according to the provided cloud mask are discarded. This prevents shift measurements from cloudy or partially obscured areas.

  • 3.2 Water bodies: Using the LULC map, windows with water coverage above 10% are excluded. Water areas lack sufficient texture for reliable feature correspondence.

  • 3.3 Texture quality: Windows with uniform intensity patterns are filtered out based on two criteria:

    • Standard deviation threshold: Windows with a standard deviation below \(50DN\) are excluded, as they contain insufficient texture for reliable shift estimation.
    • Mean brightness threshold: Windows with mean pixel values below \(10DN\) are excluded to avoid measurements in very dark areas.

These filters ensure that only windows with sufficient cloud-free, visible, and textured content are included in the phase correlation analysis.

4. Phase correlation computation

For each remaining window, a pair-wise phase correlation computation is performed between the reference band (green) and the target band (red, blue, or NIR). The phase correlation algorithm includes the following steps:

  1. Image preparation: Extracts the corresponding window regions from both the reference and target bands
  2. Coordinate system handling: If the two bands have different CRS or geotransforms, the target band window is reprojected to match the reference band's georeferencing
  3. Nodata handling: Checks the amount of nodata pixels and avoids computing the phase correlation when nodata pixels are more than half of the image
  4. Phase correlation: Computes the shift (in pixels) using OpenCV's phaseCorrelate function with nodata masking, which returns:
    • Shift vector: \((\text{shift}_x, \text{shift}_y)\) in pixels
    • Confidence score: A value between 0 and 1 indicating the reliability of the estimated shift
  5. Metric conversion: Converts the pixel-based shift to metric units (meters) using the raster's pixel resolution

The result is a local shift measurement for each window, expressed as:

  • Easting shift: The eastward displacement of the target band relative to the reference band (in metric units)
  • Northing shift: The northward displacement of the target band relative to the reference band (in metric units)
  • Confidence: A reliability score between 0 and 1 for the estimated shift

5. Phase correlation filtering (part 2)

Shifts estimated with low confidence are considered unreliable and are discarded. Specifically:

  • Shifts with a confidence value below 0.1 are removed
  • This filtering is applied independently for each band pair, allowing windows to contribute shifts for some band pairs while being excluded from others

6. Aggregation

The valid shifts are aggregated both per-band-pair and globally to produce the final alignment metrics:

Per-band-pair aggregation (computed for each of red, blue, and NIR relative to green):

  • Shift statistics: Mean, absolute mean, standard deviation, minimum, and maximum of eastward and northward shifts
  • Magnitude statistics: Root-mean-square (RMSE) of the radial shift components, mean and standard deviation of shift magnitudes
  • Circular error metrics:
    • CE90 (90th percentile of radial shifts)
    • CE95 (95th percentile of radial shifts) – this is the primary per-pair KPI
  • Directional distribution: Count of shifts in each quadrant (for understanding systematic directional biases)
  • Match count: The number of valid measurements used in the aggregation

Global aggregation:

  • Maximum CE95: The maximum CE95 value across all band pairs, representing the worst-case band alignment error.

The CE95 metric represents the radius within which 95% of all measured shifts fall, expressed in metric units (meters). For example, a CE95 of 2.5 meters means that 95% of the estimated band displacements are contained within a 2.5-meter radius circle.