GRASS logo

NAME

p.coregister - Co-register two rasters by translational shift estimation.
Estimates and corrects a sub-pixel translational offset between two rasters using FFT-based phase correlation (Foroosh et al. 2002). Optionally refines the estimate with normalised cross-correlation. Both rasters must share the same location and resolution; use g.region before running to ensure alignment. Output: a registered (shifted) version of the slave raster and an optional CSV shift report (dx, dy in pixels and map units).

KEYWORDS

Planetary, co-registration, image matching, phase correlation, sub-pixel, raster

SYNOPSIS

p.coregister
p.coregister --help
p.coregister [-nw] master=name slave=name output=name [report=string] [search=integer] [--overwrite] [--help] [--verbose] [--quiet] [--ui]

Flags:

-n
Refine phase-correlation peak with normalised cross-correlation (slower but more robust for noisy/low-contrast images)
-w
Do NOT apply Hann window before FFT. By default the Hann window is applied to reduce spectral leakage. Disable for images that already have smooth boundary conditions.
--overwrite
Allow output files to overwrite existing files
--help
Print usage summary
--verbose
Verbose module output
--quiet
Quiet module output
--ui
Force launching GUI dialog

Parameters:

master=name [required]
Master (reference) raster
slave=name [required]
Slave raster to be registered onto master
output=name [required]
Output registered raster (shifted slave)
report=string
Output CSV shift report (dx_pix, dy_pix, dx_m, dy_m, method). Default: print to stdout.
search=integer
NCC refinement search radius [pixels] around the phase-correlation peak (used only when -n is given)
Default: 5

Table of contents

DESCRIPTION

p.coregister co-registers two raster maps by estimating and correcting a translational pixel shift using FFT-based phase correlation (Foroosh et al. 2002, IEEE Trans. Image Process. 11:188-200).

Both rasters must share the same GRASS location, mapset and resolution. Use g.region to align them before running.

Algorithm

  1. Both rasters are loaded into memory and NULL cells replaced by band mean.
  2. A 2-D Hann window is applied (unless -w is given) to reduce spectral leakage from non-periodic boundary conditions — recommended for real remote-sensing imagery.
  3. Both windowed rasters are mean-subtracted and forward-FFT'd (FFTW3).
  4. The normalised cross-power spectrum is formed: C = S·conj(M) / |S·conj(M)|
  5. The inverse FFT of C is the phase-correlation surface; its peak at (dy, dx) is the translational shift of slave relative to master.
  6. A 2-D parabolic fit around the peak gives sub-pixel precision.
  7. Optionally (-n), a normalised cross-correlation (NCC) search over a search= pixel window refines the estimate — useful for low-contrast or noisy images.
  8. The registered slave is written using bilinear interpolation.
  9. A CSV shift report is written (or printed to stdout).

Limitations

PARAMETERS

Parameter Default Description
master= required Reference raster
slave= required Raster to be registered
output= required Registered (shifted) slave output
report= stdout CSV shift report file
search= 5 NCC refinement search radius [pixels] (with -n)
-n off Refine with NCC (slower, more robust)
-w off Disable Hann window (use for DFT-aligned or noise-free signals)

OUTPUT

The shift report CSV contains one data row:

dx_pix, dy_pix, dx_m, dy_m, method

EXAMPLES

Co-register two CTX strips over the same region:

g.region raster=ctx_2012
p.coregister master=ctx_2012 slave=ctx_2015 output=ctx_2015_reg \
    report=ctx_shift.csv

Co-register CRISM with HiRISE (NCC refinement for noisy hyperspectral):

p.coregister master=hirise_red slave=crism_summary \
    output=crism_reg report=crism_shift.csv \
    search=10 flags=n

NOTES

REFERENCES

Foroosh H., Zerubia J.B. & Berthod M. (2002). Extension of phase correlation to subpixel registration. IEEE Trans. Image Process. 11(3):188–200.

SEE ALSO

p.change, i.rectify, i.corr

SOURCE CODE

Available at: p.coregister source code (history)

Accessed: Sunday Nov 15 11:05:56 2026


Main index | Paint index | Topics index | Keywords index | Graphical index | Full index

© 2003-2026 GRASS Development Team, GRASS 8.5.1dev Reference Manual