User's Guide

SYSSAMP

Performs systematic pixel or cluster sampling of an image

Function:

Performs systematic pixel or cluster sampling of an image based on a user-specified sample cell size and sampling increment between the cells. Each of the sample regions of the input image are stored in a different area of the output image. The input image may be BYTE, INTEGER*2, INTEGER*4, or REAL*4 data type. The output image data type is determined by the ODTYPE parameter.

Parameters:

IN
Input image. The input image may be BYTE, INTEGER*2, INTEGER*4, or REAL*4 and must have more lines and samples in it than is specified in the KERNDIM parameter.

OUT
Output image. The output image may be a multi-band image with the same data type as that specified in the ODTYPE parameter.

KERNDIM(10,10)
Kernel dimensions (nl,ns). The window area to be systematically extracted for sampling. The KERNDIM dimensions can be from 1 to the image size.

SKIPPIX(100,100)
Number of pixels to skip. Incremental values for changing the upper-left corner line and sample coordinates of the sample cell (line,sample). The new window is offset based upon the beginning of the previous window. The number of pixels to skip must be at least 1; the upper limit is the size of the image.

ODTYPE(SAME)
Output data type. The data type of the output image.


  = SAME:  Same as input 
  = BYTE:  BYTE      (8-bit unsigned integer)
                     (0 through 255)
  = I*2:   INTEGER*2 (16-bit signed integer)
                     (-32768 through 32767)
  = I*4:   INTEGER*4 (32-bit signed integer)
                     (-2147483648 through 2147483647)
  = R*4:   REAL*4    (32-bit signed real)
                     (System dependent)

Examples:

  1. LAS> syssamp in=myimg.in out=img.dat kerndim=(10,10) skippix=(50,50) odtype=i*2

    The image MYIMG.IN is resampled using the values of 10 x 10 for the cell size and 50 for the horizontal and vertical step sizes. The output image is written to the file IMG.DAT and is of data type INTEGER*2.

  2. LAS> syssamp in=four.in out=mag.out kerndim=(2,2) skippix=(10,20) odtype=byte

    The image FOUR.IN is resampled using a 2 x 2 sample cell with a step of 10 in the vertical direction and a step of 20 in the horizontal direction. The output image is written to the file MAG.OUT.

Description/Algorithm:

SYSSAMP does a systematic sampling of the input image. The output image has the pixels extracted from the input image by moving the kernel of size KERNDIM to each successive starting sample location. The cell is moved in the horizontal directions after each sampling and in the vertical direction at the end of each set of image lines, as specified by SKIPPIX. The first sample cell selected starts at image location (1,1); the second sample cell start is based upon the beginning of the previous window (location 1 + SKIPPIX(1)). Partial cells near the edges of the image are ignored. The first sample cell goes into the output image at location (1,1). The second sample is placed in the output image at the row 1 sample location equal to the number of samples specified in KERNDIM + 1. See User Note 2 for the formula to calculate the dimensions (NL,NS) of the output image.

Nonfatal Error Messages:

  1. [syssamp-history] Error accessing the history information

    A nonfatal error occurred during the processing of the history information.

  2. [syssamp-minmax] Error updating minmax information

    The minimum and maximum information within the DDR file could not be updated.

  3. [syssamp-close] Error closing images

    An error occurred in closing the image files.

Fatal Error Messages:

  1. [syssamp-getin] Fatal error encountered

    Unable to get input image.

  2. [syssamp-window] Input images do not have the same window sizes

    Message indicates that the number of lines or samples in image IN are not equal. To correct the error, use the window option to indicate the lines and samples to be used.

  3. [syssamp-getout] Fatal error encountered

    Unable to get output image.

  4. [syssamp-open] Unable to open <XXXXX> image

    Unable to open <XXXXX> image. Verify that the image exists.

  5. [syssamp-alloc] Error allocating dynamic memory

    Cannot access dynamic memory buffer.

  6. [syssamp-values] KERNDIM values are greater than the SKIPPIX values

    Restart, using SKIPPIX values greater than the KERNDIM values.

  7. [syssamp-kernel] KERNDIM larger than input image specified

    Restart, using an input image with a larger dimension than the KERNDIM parameters.

User Notes:

  1. The KERNDIM values must be less than the corresponding SKIPPIX values.

  2. The output image size (NL,NS) can be computed by using the following equations:

         NL = INT [(NLIN - KERNDIM(1)) / SKIPPIX(1) + 1] * KERNDIM(1)
    
         NS = INT [(NSIN - KERNDIM(2)) / SKIPPIX(2) + 1] * KERNDIM(2)
    
         where
    
    	  NSIN = number of samples per line in the input image
    	  NLIN = number of lines in the input image