Gamma DIFF&GEO: Reference Manual


rotate_image

ANSI-C program: rotate_image.c

NAME
rotate_image -  Rotate an image about the image center by a specified angle.

SYNOPSIS
rotate_image <data_in> <width_in> <angle> <data_out> <width_out> <nlines_out> [interp_mode] [format_flag]

<data_in> (input) data file (format as specified by format_flag parameter)
<width_in> width of input data file
<angle> rotation angle, angle > 0: counter-clockwise rotation (deg.)
<data_out> (output) output data file
<width_out> output image width, (enter - for default)
<nlines_out> number of lines in the output image, (enter - for default)
[interp_mode] interpolation mode:
    0: nearest-neighbor
    1: bicubic spline (default)
    2: bicubic-log spline
    3: bicubic spline sqrt(x)
[format_flag] input and output data format
    0: FLOAT (default)
    1: FCOMPLEX
    2: SUN raster/BMP format
    3: UNSIGNED CHAR
    4: SHORT

EXAMPLES:

rotate_image diff_ts_009 600 35. diff_ts_009r35 - - 1 0
disrmg diff_ts_009r35 - 835

Rotate the floating point image of unwrapped phase diff_ts_009 by 35 degrees counter-clockwise. The input image had a width of 600 samples and contained 600 lines.  The output image dimensions are calculated so that they enclose the rotated image. Bicubic spline interpolation is used as the interpolation method. The output image  width is 835 samples and can be displayed using disrmg. The

rotate_image diff_ts_009.ras 600 35. diff_ts_009r35.ras 900 900 0 2
disras
diff_ts_009r35.ras

Rotate the Sun raster image diff_ts_009.ras by 35 degrees counter-clockwise. The input image width is 600 samples and the output image size is specified to be 900 samples wide and to have 900 lines. Nearest-neighbor interpolation is used. The output image is in Sun raster format.

DESCRIPTION
rotate_image is program that rotates images about the image center by a specified angle. The output image size can either be calculated from the input image or specified on the command line. The center of the input image maps to the center of the output image. The user  enters "-" for the size of the output image size parameters to select that these be calculated from the image bounds.  

Valid input/output data formats are float, fcomplex, unsigned char, and raster image (SUN or BMP) format. Either  cubic spline or a nearest neighbor interpolation can be selected. In the case of complex-valued data the real and imaginary partare interpolated independently. In the case of unsigned char and SUN raster format only the nearest-neighbor resampling algorithm isavailable.

The bicubic spline of the log(data) or  bicubic spline of the sqrt(data) interpolation transforms the input values, performs the  interpolation, and converts the interpolated data back to linear scale. For interpolationof  SAR intensity, data converted to log scale or using sqrt()  has the advantage that no negative values are generated in theinterpolation, even for very noisy data. The output is the interpolated values converted back to linear scale. In order to avoid problems withnegative values (log or sqrt not defined) the absolute value of the input values is used.

SEE ALSO
typedef_ISP.h, typedef_DIFF.h.


© Copyrights for Documentation, Users Guide and Reference Manual by Gamma Remote Sensing, 2015.
UW, CW, last change 2-Jul-2015.