User's Guide

WINDOP

Performs systematic pixel or cluster averaging of an image

Function:

Performs systematic pixel or cluster averaging of an image based on a user-specified sample cell size and line and sample increment between the cells. The output image consists of the mean, maximum, or minimum values of the sample regions selected from the input image. The input image may be BYTE, INTEGER*2, INTEGER*4, or REAL*4 data type. The output image data type is determined by ODTYPE. If the mean option is selected, an additional band is generated for each band which is the standard deviation band.

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 KERNDIM.

OUT
Output image. The output image may be a multi-band image. It will have data type ODTYPE.

KERNDIM(10,10)
Kernel dimensions (NL,NS). The window area to be systematically extracted for sampling.

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.

TYPEOPT(MEAN)
Type of operation. The value of the window that is to be inserted into the output location.

  = MEAN:  Average of all pixel values
  = MAX:   The maximum pixel value
  = MIN:   The minimum pixel value

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


  = SAME:  Same as input 
  = BYTE:  BYTE      (8-bit unsigned integer)
  = I*2:   INTEGER*2 (16-bit signed integer)
  = I*4:   INTEGER*4 (32-bit signed integer)
  = R*4:   REAL*4    (32-bit signed real)

MASKVAL(--)
Mask value(s). The pixel value or range of values that is used to designate masked areas or areas of bad data. Samples with this value are not used in the calculations.

PIXVAL(0)
Pixel value. The pixel value that is to be inserted into the output location whenever a mask value is encountered.

Examples:

  1. LAS> windop in=myimg.in out=img.dat skippix=(50,50) odtype=i*2 maskval=(0.0-25.0,400.0-500.0) pixval=999

    The image MYIMG.IN is resampled using the values of 10 x 10, the defaulted 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. Since MEAN is the TYPEOPT default, the output image consists of two bands. The first is the mean band and the second is the standard deviation band. If any pixel values in the sampled area lie within the ranges of 0.0 through 25.0 or 400.0 through 500.0, the pixel value 999.0 will be inserted in IMG.DAT.

  2. LAS> windop in=four.in out=mag.out kerndim=(2,2) skippix=(10,20) typeopt=max 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 with the data type being BYTE.

Description/Algorithm:

WINDOP does a systematic averaging of the input image. The output image has the pixels extracted from the input image by moving the sample cell of size KERNDIM to each successive starting sample location. The cell is moved in the horizontal direction after each sampling and in the vertical direction at the end of each set of image lines, as specified by SKIPPIX. Partial cells near the edges of the image are ignored. If masked values are specified, then each pixel is checked against the masked value(s) and the PIXVAL is assigned to the output image if the masked value exists.

Nonfatal Error Messages:

  1. [windop-warn] Nonfatal error encountered

    A nonfatal error was encountered during processing. The message that is displayed immediately preceding this message is the specific error that was encountered. Processing continues.

Fatal Error Messages:

  1. [windop-fatal] Fatal error encountered

    A fatal error was encountered during processing. Processing is terminated. The message that is displayed immediately preceding this error message is the specific error that was encountered.

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

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

  3. [windop-alloc] Error allocating dynamic memory

    An error occurred while allocating dynamic memory for processing. Rerun the function. If the error reoccurs, notify the system manager.

  4. [windop-mask] Error in mask value range encountered

    The lower mask value is greater than the higher mask value. Rerun specifying the mask value range in ascending order.

  5. [windop-values] KERNDIM values are greater than the SKIPPIX values

    Restart, using SKIPPIX values greater than the KERNDIM values.

  6. [windop-kernel] KERNDIM larger than input image

    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]
    
    	NS = INT [(NSIN - KERNDIM(2)) / SKIPPIX(2) + 1]
    
    	where:
    
    	  NSIN = number of samples per line in the input image
    	  NLIN = number of lines in the input image
    

  3. The mean and standard deviation bands are written as pairs in the output image. For example, calculating the mean of a two-band image will produce the following four-band image.

            Band 1	Mean of band 1 of the input image
            Band 2  Standard deviation of band 1 of the input image
            Band 3  Mean of band 2 of the input image
            Band 4  Standard deviation of band 2 of the input image
    

    When TYPEOPT is equivalent to mean, the maximum number of input image bands is 128 because of this band calculation.

  4. When conversions from a larger data type (such as REAL*4) to a smaller data type (BYTE) are performed, check the output pixels for validity since the conversion is not done by rescaling the input data. See the COPY or MAP modules for better methods of converting between data types.

  5. The mask values and pixel values must be within the ODTYPE range. Unpredictable results may occur if these conditions are not met.