distortImage
Description
distortImage geometrically warps (translates, rotates, and isotropically scales) an 8-bit OMG1 (JHC_header) image onto either an existing reference OMG1 image (-ref) or a WGS84 Mercator grid (-geo) using a two-point control file (-coords).
CLI Options & Usage
distortImage -in <infile> -out <outfile> -coords <cfile> \
[-ref <reffile> | -geo [-projlat <deg>]] \
[-blank] [-alternate] [-latshift <deg>] [-lonshift <deg>]
-in <infile>: Input 8-bitOMG1image to be warped.-out <outfile>: Output registered 8-bitOMG1image.-coords <cfile>: ASCII control-point file containing two lines:- With
-ref:in_x1 in_y1 ref_x1 ref_y1(in pixels). - With
-geo:in_x1 in_y1 lon1 lat1(in pixels and decimal degrees).
- With
-ref <reffile>: ReferenceOMG1image onto which<infile>is overlaid.-geo: Warps<infile>into a WGS84 Mercator projection defined by the two geographic control points (-projlatsets the Mercator projection latitude; defaults tolat1).-blank: Initializes the output canvas to255(white/no-data) instead of keeping the-refbackground image.-alternate: Checkerboards overlapping pixels ((i + j) % 2 == 0) between<infile>and<reffile>for visual registration quality control.-latshift <deg> -lonshift <deg>: Applies datum shifts to the control point coordinates in-geomode.
Algorithm
Computes the 2D similarity transform (scale scale = dist_ref / dist_in and rotation angle rot_angle = dir_in - dir_ref) between the two control-point pairs, then inverse-maps every output pixel (i, j) back into source image coordinates (orig_x, orig_y) to sample <infile>.