User's Guide

MAGNIFY

Performs fractional zooming along horizontal and/or vertical image axes

Function:

Permits independent fractional magnification or reduction of the lines and samples of an image. This 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.

OUT
Output image. The output image has the same number of bands and the same data type as IN.

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

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

If WINDOPT=IN, the output image size is determined by the input image size (including any window specification) and the magnification factors.

If WINDOPT=OUT, the output image size is specified by WINDOW. Magnification factors are automatically computed from the input size and output image size. SCALFACT is ignored.

WINDOW(512,512)
Window specification. The values specifying the output image size. It is ignored unless WINDOPT=OUT. When WINDOW is specified and WINDOPT=OUT, the magnification factors are computed as follows:

  SCALFACT(2) = WINDOW(1) / number of lines in 
                            input image 

  SCALFACT(1) = WINDOW(2) / number of samples/line 
                            in input image 

SCALFACT(2.0,2.0)
Scale factors. The line expansion factor followed by the sample expansion factor. They are ignored if WINDOPT=OUT. Use values greater than 1.0 for magnifications and fractional values for reductions.

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 
           interpolation 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 
           interpolation  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 
           surround the calculated floating point pixel 
           value to determine the output pixel brightness 
           value.  The dimensions N and M, as well as 
           the resampling kernel (resampling 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> magnify in="sample.dat(1,1,100,100)" out=test.out scalfact=(3.0,3.5)

    The first 100 lines and 100 samples of the input image SAMPLE.DAT are magnified 3 times in the line direction and 3.5 times in the sample direction using the nearest neighbor resampling method. The output image size is 300 samples by 350 lines.

  2. LAS> magnify in="sample.dat(100,100,64,64)" out=test.out windopt=out resamp=cc window=(512,512)

    The specified window of the input image SAMPLE.DAT is magnified using cubic convolution resampling to produce an output image of 512 lines by 512 samples.

  3. LAS> magnify in="sample.dat(64,64,64,64)" out=test.out windopt=out window=(256,256)

    The input image is magnified to produce an output image, which is 256 lines by 256 samples.

  4. LAS> magnify in="sample.dat(64,64,200,200)" out=test.out windopt=out window=(100,100)

    The input image size is 200 x 200, and the output image size is 100 x 100. Thus, the input image is reduced by a factor of 0.5 in both X and Y directions.

Description/Algorithm:

The user-specified magnification is performed using programs ROTRNSCL and RESAMPLE. The output image size is determined by the input window and magnification factors when WINDOPT=IN. If WINDOPT=OUT, the magnification factors are automatically determined by the program from the input image window and the output size, WINDOW.

Nonfatal Error Messages:

    MAGNIFY calls the programs ROTRNSCL and RESAMPLE. See these programs for error messages.

Fatal Error Messages:

    MAGNIFY calls the programs ROTRNSCL and RESAMPLE. See these programs for error messages.

User Notes:

  1. For all resampling methods but nearest neighbor, if some of the samples at the edges of the image are not available, MAGNIFY 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.

  2. For integer magnifications or reductions, use the ZOOM module.

  3. The resampling weight table file may be generated by the RTABLE function. 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.