User's Guide

ROTATE

Rotates an image by a specified angle.

Function:

Performs a rotation of an image to a specified angle. Resampling is performed using either nearest neighbor interpolation, parametric cubic convolution interpolation, bilinear interpolation, or a user-entered table of resampling weights.

Parameters:

IN
Input image. The input image is a single- or multi-band image with BYTE, INTEGER*2, INTEGER*4, or REAL*4 data type. Windowing is allowed.

ROTANG
Rotation angle. The positive or negative rotation angle in degrees relative to the image center. A positive angle represents a clockwise rotation and a negative angle represents a counterclockwise rotation.

OUT
Output image. The output image is a single- or multi-band image with the same data type as IN. The output image size is defined by the mapping grid, the input window specification, or the output window specification.

WINDOPT(IN)
Window option. The rectangular image window to be transformed may be specified either in terms of the input image or the output image.


  = IN:   Input window.
  = OUT:  Output window.

Regardless of WINDOPT, the image area subsection is specified with the input image, e.g., IN="IMAGE1.B1(25,25,100,100)." If WINDOPT=IN, the size of the output image is determined from the (25,25,100,100) input image window and the amount of rotation. If WINDMODE=OUT, the program rotates the entire original input image and extracts the specified window (25,25,100,100) from the rotated output image.

RESAMP(NN)
Resampling method. Pixel values in the output image are determined by finding the corresponding location in the input image. The pixel location in the input image is a floating point value, i.e., it can fall between pixels. A method of interpolating a brightness value for that pixel location is therefore needed.


  = NN:     Nearest neighbor.  Nearest neighbor inter-
            polation uses the brightness value of the 
            pixel closest to the calculated floating 
            point pixel value.
  = BI:     Bilinear.  Bilinear interpolation uses a 
            2 x 2 block of input pixels which surround
            the calculated floating point pixel value 
            to determine the output pixel brightness 
            value.
  = CC:     Cubic convolution.  Cubic convolution in-
            terpolation  uses a 4 x 4 block of input 
            pixels which surround the calculated 
            floating point pixel value to determine 
            the output pixel brightness value.
  = TABLE:  Table-based.  Table-based resampling uses
            a N x M block of input pixels which sur-
            round the calculated floating point pixel 
            value to determine the output pixel 
            brightness value.  The dimensions N and M, 
            as well as the resampling kernel (resam-
            pling weights), are contained in the user-
            entered file of resampling weights.

INRWT(--)
Input resampling weight table file. File containing externally generated table of resampling weights. This parameter is valid when RESAMP=TABLE. It is ignored for all other resampling methods.

PCCALPHA(-0.5)
Parametric cubic convolution alpha parameter. Commonly used values are -1.0 and -0.5; values -3.0 through 3.0 produce reasonable results. Other values may cause unpredictable results but are permitted for experimental purposes.

Examples:

  1. LAS> rotate in=dc out=rotdc rotang=45 windopt=in

    The input image DC is rotated 45 degrees using nearest neighbor resampling. The result is placed in the image ROTDC. The size of ROTDC is determined from the input image size and the rotation angle.

  2. LAS> rotate in="dc(1,1,100,100)" out=rotdc rotang=30.3 windopt=out resamp=cc

    The input image DC is rotated 30.3 degrees using the cubic convolution resampling method. The result is placed in the image ROTDC, which is 100 x 100 in size.

Description/Algorithm:

ROTATE is a procedure that uses the programs ROTRNSCL and RESAMPLE. ROTRNSCL generates a mapping grid file that is then used by RESAMPLE to perform the rotation. The mapping grid file is deleted automatically. See the documentation for ROTRNSCL and RESAMPLE for more information.

Nonfatal Error Messages:

    Error messages are issued by RESAMPLE and ROTRNSCL. The user should refer to the RESAMPLE and ROTRNSCL user's guides for error message information.

Fatal Error Message:

    Error messages are issued by RESAMPLE and ROTRNSCL. The user should refer to the RESAMPLE and ROTRNSCL user's guides for error message information.

User Notes:

  1. For a 90, 180, or 270 degree rotation the user should use FLIP.

  2. For all resampling methods but nearest neighbor, if some of the pixels at the edges of the image are not available, then ROTATE fills zeros at the edges of the image. This should not exceed half the size of the resampling kernel. Cubic convolution, for example, should have at the most two rows/columns of fill on each image edge.

  3. The resampling weight table file may be generated by the function RTABLE. A description of the file is given in the LAS Programmer's Manual. For further information on resampling and resampling weight tables, refer to the Geometric Manipulation Package Overview Document, GEOMPOD.