User's Guide

INSERT

Places polygonal areas of image data from one image into another image

Function:

Places polygons from one image into another image; the polygon coordinates are obtained from a statistics file. Alternatively, the inside and/or the outside of the polygons may be filled with a specified gray-level value. Also, the polygon boundaries may be outlined with a specified gray-level value.

Parameters:

IN
First input image supplies the interior of the polygons (unless INTER is invoked). May be any data type. (see User's Note 2).

Second input image supplies the exterior of the polygons (unless EXTER is invoked) and determines the size of the output image. Should have same data type and number of bands as first image.

INSTAT
Input statistics file. Supplies the polygon coordinates. The polygons should have been defined with reference to the first image.

OUT
Output image. Data type and the number of bands are the same as the input images.

CLASSNAM(*)
Class name of polygons in the statistics file. Default is all classes in the statistics file.

INTER(--)
Gray-level value of interiors of polygons in the output image. Default uses IN(1) for interiors.

EXTER(--)
Gray-level value of the region in the output image exterior to the polygons. Default uses IN(2) for pixel values exterior to the polygon boundaries.

BOUND(--)
Gray-level value for the outline of the polygon boundaries. Default is no outline; interior values are used on the polygon boundaries.

Examples:

  1. LAS> insert in=(image1,image2) instat=statfile out=image.out classnam=water

    The output image, IMAGE.OUT, consists of pixel values from IMAGE2, except for the sites from class WATER, which contains pixel values from IMAGE1.

  2. LAS> insert in=(image1,image2) instat=statfile out=imageout exter=150 bound=255

    The output image, IMAGEOUT, is the same size as IMAGE2. The interiors of the polygons from STATFILE contain IMAGE1, but the exterior is set to 150. The edges of the polygons are delineated with a gray level of 255. All classes are used.

  3. LAS> insert in=("im1.dat(100,100,250,250)", "im2.dat(100,100,250,250)") instat=ins.stat out=image.dat inter=100

    The windowed area defined with IM2.DAT sets IMAGE.DAT to size 250 x 250. All classes are used. The insides of the polygons are set to 100; the boundaries are not outlined.

Description/Algorithm:

INSERT places a "cutout" from the first image into the second image. The shape of the "cutout" is determined by the polygonal coordinates supplied by the statistics file, INSTAT. A constant gray-level fill may be used for the interior or exterior regions of the polygon instead of IN(1) or IN(2), respectively.

The coordinates of the vertices of the polygons are read from the statistics file. Then the interceptions of the polygon boundaries on each line are computed and the determination is made whether each pixel should be regarded as interior or exterior to the polygons. The pixels from the second input image are copied until the first polygon boundary is reached (or the EXTER value is used if specified); boundary pixels are copied from the first input image (or the BOUND value is used if specified); pixels interior to the polygons are filled with values from the first input image (or the INTER value is used if specified).

The size of the second input image is used as the size of the output image. When the two input images have different sizes, the upper left corners of two images are lined up.

Nonfatal Error Messages:

  1. [insert-vert] Class mm site nn polygon vertices outside of first image

    Some polygon coordinates were outside the first image window.

  2. [insert-wind1] Window of first input image containing all polygons: xxx xxx xxx xxx

    To improve performance only a window of the first input image that contains all the polygons, and not the whole image, is processed .

Fatal Error Messages

  1. [insert-polyout1] All polygons are outside of first image

    Increase the size of the input image window.

  2. [insert-polyout2] All polygons are outside of second image

    Increase the size of the output image window.

  3. [insert-inter] INTER value exceeds valid range of image data type

    Respecify a value within the range of the data type of the image.

  4. [insert-exter] EXTER value exceeds valid range of image data type

    Respecify a value within the range of the data type of the image.

  5. [insert-bound] BOUND value exceeds valid range of image data type

    Respecify a value within the range of the data type of the image.

  6. [insert-bands] Input images do not have the same number of bands

    Check input images.

  7. [insert-type] Input images are not the same data type

    Check input images.

  8. [insert-stopen] Error opening statistics file

    The statistics file could not be opened. Check that the file is a statistics file.

  9. [insert-noclass] No class found in the statistics file

    Check the statistics file.

  10. [insert-nopolygon] No polygon found in this statistics file

    The statistics file does not contain any polygons in the specified class or classes.

  11. [insert-noclass] Specified class does not exist

    The specified class was not found in the statistics file. Use EDITSTAT to check that the name of the class is correct.

  12. [insert-numpoints] Number of polygon vertices exceeds 10000

    The statistics file contained polygons with a combined total of more than 10,000 vertices. A file with fewer points must be used.

User's Notes:

  1. The combined total number of vertices of all the polygons should not exceed 10,000.

  2. All the points in the polygons should be inside the first input image and, if a window is input on the first image, inside the window.