Skip to main content

Orthorectification and Affine Transformation

Orthorectification and affine transformation are two common geometric transformation methods in geospatial data processing. They differ significantly in application and purpose.

Orthorectification

Orthorectification is the process of correcting remote sensing imagery or aerial photographs that contain terrain relief and sensor geometric distortion into a nadir ground view, such as a map, so that the position of each pixel in the image strictly corresponds to its real-world ground coordinates. The method starts from a camera or sensor model, such as RPC or a polynomial model, combines it with a digital elevation model (DEM), projects each image pixel into three-dimensional ground space, and then resamples it onto a unified projection plane.

In short:

It straightens a tilted image and corrects for uneven terrain.

CharacteristicDescription
Correction targetTerrain relief, tilt, and sensor imaging distortion
Input dataRaw image + digital elevation model (DEM) + RPC or geometric model
Output imageOrthophoto / orthoimage
AccuracyHighest; suitable for demanding applications such as measurement, cartography, and GIS analysis
Overlay capabilityCan overlay seamlessly with maps and GIS layers without geometric error
Common usesAerial photogrammetry, satellite remote sensing, and UAV mapping

Affine Transformation

An affine transformation is a two-dimensional geometric transformation that preserves straight lines and parallelism. It is used for image geometric correction, such as image registration, mosaicking, and projection transformation. It uses linear algebra to implement an approximate linear mapping between image coordinates and ground coordinates.

Affine Transformation Parameters in GDAL

GDAL uses an array of length 6, called GeoTransform, to describe the affine relationship from pixel space, or raster indices, to geographic space, or map coordinates:

GeoTransform[6] = [GT0, GT1, GT2, GT3, GT4, GT5]

This transformation defines the mapping from raster row and column (i, j) to geographic coordinates (X_geo, Y_geo):

Xgeo=GT0+GT1i+GT2jX_{geo} = GT0 + GT1 * i + GT2 * j Ygeo=GT3+GT4i+GT5jY_{geo} = GT3 + GT4 * i + GT5 * j

Parameter meanings, based on the official GDAL definition:

Parameter indexNameEnglish descriptionMeaning
GT0TopLeftXX coordinate of the top-left corner of the top-left pixelMap X coordinate of the upper-left pixel, usually projected or geographic coordinates
GT1PixelWidthW-E pixel resolution / pixel size in X directionSize of each pixel in the X direction, usually positive
GT2RotationXRow rotation (typically 0)X component affected by row-direction rotation, usually 0
GT3TopLeftYY coordinate of the top-left corner of the top-left pixelMap Y coordinate of the upper-left pixel
GT4RotationYColumn rotation (typically 0)Y component affected by column-direction rotation, usually 0
GT5PixelHeightN-S pixel resolution / pixel size in Y direction (usually negative)Size of each pixel in the Y direction, usually negative to indicate downward image rows

References:

Raster Data Model - GDAL documentation

Affine Transformation in GeoTIFF

Affine transformation is the core mechanism that accurately connects GeoTIFF imagery to real-world geographic coordinate systems. GDAL, and most GIS software, uses six GeoTransform parameters plus projection information, such as WKT or EPSG, to transform an image from pixel-grid space into geographic space.

How affine transformation is stored in GeoTIFF:

  • TIFF tags:
    • ModelPixelScaleTag -> corresponds to GT1 and GT5, the pixel size
    • ModelTiepointTag -> corresponds to GT0 and GT3, the image reference point
  • GeoKeyDirectoryTag:
    • Stores CRS information such as EPSG code, units, and projection type
  • GDAL metadata, in an external .aux or VRT file:
    • GeoTransform explicitly represents all six parameters

Comparison Summary

ItemOrthorectificationAffine Transformation
Accounts for elevationYes; accounts for terrain relief with a DEMNo; ignores terrain height differences
Geometric model accuracyHigh; supports sensor modelingMedium; linear model
Required dataImage + DEM + geometric model/RPCImage + control points
Application scenariosAerial orthophotos and satellite image mappingImage registration and minor terrain correction
Transformation propertyNonlinear projection transformationLinear geometric transformation
Accuracy and costHigh accuracy but computationally complexMedium accuracy but fast