getShifts
Description
getShifts scans every column of an 8-bit OMG1 (JHC_header) raster to locate the uppermost (min_y) and lowermost (max_y) valid (!= 255) pixels in each column, printing a 4-column ASCII shift table to standard output for compacting obliquely oriented strip mosaics.
CLI Options & Usage
getShifts -in <infile> > shifts.txt
-in <infile>: Input 8-bitOMG1(JHC_header) raster file.
Algorithm
- Reads the
JHC_header(dx = head.xmax,dy = head.ymax) and loads the 8-bit image buffer. - For each column
i = 0 .. dx-1, scans verticallyj = 0 .. dy-1to find the first and last row indices (min_y[i],max_y[i]) wherepixel != 255, tracking the global minimum vertical spanmin_shift = min(dy - min_y[i] + max_y[i]). -
Prints one line per valid column:
col_index min_y[i] (dy - min_shift) (max_y[i] - min_y[i])