Generates buffer zones around target pixels in an image
Generates buffer zones of contour distances or mask values around target pixels in an image. Subcommand -DIST creates an output image whose buffer zones contain the distances of the original image pixels from the nearest target pixel in the input image. Subcommand -MASK generates an output image whose buffer zones contain mask values surrounding the target pixels in the input image.
This function results in distance contours being generated around the target class of interest. If a full 360 degree search is specified, target areas are completely surrounded. If a limited direction search is specified, target areas generate "wedges."
- IN
- Input image. The image may be a BYTE, INTEGER*2, or INTEGER*4 image. Window and/or band options may be specified. For each pixel in this image, SPREAD searches for the nearest target pixel that falls within the user-specified radial and angular limits.
- OUT
- Output image. The name of the output image. It will be a BYTE image containing the same number of bands as specified in IN. Each pixel in this image is assigned either a distance value or the BACKGRND value.
- PIXVAL
- Pixel value. The pixel value being searched for. In the output image, distance contours will be generated around the locations where these pixels occurred so that these areas will have appeared to "spread out."
- SRCHRAD
- Search radius. The maximum radius, measured in pixels, that the program will consider while searching for a target pixel. Specifying a search radius of more than 16 pixels is not permitted. Searching more than 16 pixels can be accomplished through repeated runs of SPREAD-DIST and alternating with appropriate runs of RENUMBER.
- BEGANG(0)
- Beginning angle. The beginning angle for a distance search in a particular direction. It is measured in degrees clockwise from "north," i.e., the top of the image. Restricted angular searches generate "pie wedges" rather than disks around target areas. BEGANG can range from 0 to 359 degrees.
- NDEGREES(360)
- Number of degrees. The number of degrees to search in a clockwise direction. Restricted angular searches generate "pie wedges" rather than disks around target areas.
- BACKGRND(0)
- Background value. The background value to which pixels in the output image will be assigned if no target pixels were found within the user-specified radial and angular limits.
This function results in a mask buffer being generated around each target class of interest.
- IN
- Input image. The image may be a BYTE, INTEGER*2, or INTEGER*4 image. Window and/or band options may be specified. SPREAD generates a buffer of width SRCHRAD around each pixel in this image that is the value of PIXVAL.
- OUT
- Output image. The name of the output image. It will be a BYTE image containing the same number of bands as specified in IN. Each pixel in this image is assigned either the MASKVAL value or the BACKGRND value.
- PIXVAL
- Pixel values. The pixel values being searched for. In the output image, pixels that are up to SRCHRAD distance away from PIXVAL are assigned the MASKVAL value.
- SRCHRAD
- Search radius. The maximum radius of the buffer zone, measured in pixels, that the program will generate around the target pixels. Specifying a search radius of more than 80 pixels is not permitted. Searching more than 80 pixels can be accomplished through repeated runs of SPREAD-MASK alternating with appropriate runs of RENUMBER. A value must be entered for each value specified in PIXVAL unless the same radius is desired for all target pixels; then a single SRCHRAD value may be used.
- QUADNUM(0)
- Quadrant numbers. The quadrants to be processed for a user-specified angular search. The quadrants are set up in a Cartesian coordinate system, with each quadrant consisting of 90 degree "pie wedges." The following combinations may be specified: all four quadrants, one of any four quadrants, two of any four quadrants, three of any four quadrants, or quadrant "0" (zero) which causes all four quadrants to be processed and is the default value. A "0" specification supersedes all others in any combination.
____________________________ | | | | | | | Quadrant 2 | Quadrant 1 | | | | | | | |----------------------------| | | | | | | | Quadrant 3 | Quadrant 4 | | | | |_____________|______________| VALID QUADRANT SPECIFICATIONS _____________________________ 1 or 2 or 3 or 4 (each a 90 degree wedge) Any combination of two consecutive (180 degree wedge) Any combination of two adjacent (left or right diagonal) Any combination of three quadrants (270 degree wedge) A "0" in combination or alone (360 degree wedge)
- MASKVAL(1)
- Mask value. The value assigned to the output image pixels that fall within the SPREAD buffer zone.
- BACKGRND(0)
- Background value. The value assigned to the output image pixels that do not fall within the SPREAD buffer zone.
The program generates image LAND.CLASS.DIST in which each pixel has a value equal to its distance to the nearest target pixel with a value of 4 in the input image LAND.CLASS, provided there was such a pixel within a distance of 10. All other pixels in the output image are given the value of 99.
The program creates the output image LAND.CLASS.WEDGE in which each pixel has a value equal to its distance to the nearest target pixel with a value of 99 in the input image LAND.CLASS, provided there was such a pixel within a distance of 8 and to its north. All other pixels in the output image are given the value of 0. The BEGANG is 270 and NDEGREES is 180, setting the search area to the north.
The output image RIVER.MASK is created and contains the value of 200 for all pixels that fall within a 3 pixel radius of pixels with the value 50 in the input image. All other pixels in the output image contain the value of 100.
The output image RIVER.SPREAD.MASK is created and contains the value of 1 for all pixels that fall within a 5 pixel radius of pixels with the value of 100, 110, or 120 in the input image. All other pixels in the output image contain the value of 0.
The output image RIVER.SPREAD.MASK is created and contains the value of 1 for pixels that fall within a 3 pixel radius of pixels with the value 100. The QUADNUM specification of (1,4) indicates that a search area of 0 to 180 degrees will be used. All other pixels in the output image will contain the value 255.
SPREAD-DIST: The algorithm searches concentrically outward from each pixel using a precomputed address table (either circular or wedged) until a target pixel is encountered. The outward-spiraling concentric search pattern guarantees there are no closer target pixels than the first one found. Images are scanned from left to right. If a target pixel is encountered at a distance D from a given pixel P, then the search from the pixel immediately to P's right need not test for target points closer than distance D-1 due to the triangular inequality.SPREAD-MASK: The algorithm processes the image line by line, sample by sample, generating entries in run-end encoded arrays. For each input image pixel that contains the target value, an entry is made in the arrays showing its location and mask value. Entries are updated to include this pixel in any other pixel entries for the current line being processed, for all lines to the north of (above) the current line that are within the buffer radius, and for all lines to the south of (below) the current line that are within the buffer radius. When the input image has been processed completely, the output image is generated according to the entries in the run-end encoded arrays. Run-end encoding is a compressed raster data structure that stores a code along with the sample number of the last sample using that code.
SPREAD does not allow the input image to be a REAL*4 image.
Convert the input image and rerun the program.
For SPREAD-MASK, an entry must be made in the SRCHRAD parameter for each entry in the PIXVAL parameter, or SRCHRAD must contain only one entry. Correct the number of values in SRCHRAD and rerun the program.
The values to be searched for in the input image must not exceed the range of the data type of the input image. Correct the values in the PIXVAL parameter and rerun the program.
For SPREAD-MASK, the number of entries required to process the input image(s) exceeds the dimension of the run-end encoded arrays in the program. Apply windows to the image and run the program as many times as needed to generate the full size output image, or contact the LAS system manager for assistance.