Performs systematic pixel or cluster averaging of an image
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.
- 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.
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.
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.
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.
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.
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.
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.
An error occurred while allocating dynamic memory for processing. Rerun the function. If the error reoccurs, notify the system manager.
The lower mask value is greater than the higher mask value. Rerun specifying the mask value range in ascending order.
Restart, using SKIPPIX values greater than the KERNDIM values.
Restart, using an input image with a larger dimension than the KERNDIM parameters.
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
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.