hnsky_b.gif www.hnsky.org

Reverse Mapping in Image Stacking

In reverse mapping, each pixel in the destination image is computed by sampling the appropriate location in the source image, based on a geometric transformation (e.g. translation, rotation, or affine warp).

Practical benefits for astronomical images:

How It Works:

  1. Loop through each pixel (dx, dy) in the destination image grid.
  2. Apply the inverse transformation to compute the corresponding location (sx, sy) in the source image:
    (sx, sy) = inverse_transform(dx, dy)
  3. The calculated (sx, sy) will typically fall between pixels in the source image.
  4. Use bilinear interpolation to compute the final pixel value at (dx, dy):
    • Identify the four neighboring pixels surrounding (sx, sy).
    • Compute a weighted average based on the subpixel position.

Bilinear Interpolation Formula:

value = 
(1 - fx) * (1 - fy) * I(x, y) +
fx * (1 - fy) * I(x+1, y) +
(1 - fx) * fy * I(x, y+1) +
fx * fy * I(x+1, y+1)

Where:

Why Use Reverse Mapping?


Version: 2025-06-03

© Han Kleijn, www.hnsky.org, 2025.

 Creative Commons License This work is licensed under a Creative Commons Attribution 4.0 International Licensewhich permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited.