User's Guide

COMPOSIT

Generate a composite using up to 52 different images.

Function:

Generates a composite image using up to 52 different images. The input images may be any data type. To generate a composite image, the input images are compared pixel by pixel within the specified band. The values for each pixel in the output image are taken from the image with the minimum or maximum value as specified by the user. By default, the last band of the output image identifies the image from which each pixel was selected, or if the user wishes, this last band is not created.

Parameters:

Subcommand -AUTO:
The starting line and sample for each input image are calculated from the projection information in the DDR. This subcommand will not run correctly unless all of the input images have VALID projection fields.

IN
Input images. The list of input images to be composited. The images may have window and band options specified and can be of any data type. When an output image is specified all of the entries must have the same number of bands. If OUT is set to NULL (--) then the first entry of IN will be updated. In this case if BANDFLG is set to YES, the first image must contain 1 more band than all the other images. The extra band will be used to store the number of the image from which the pixel values are taken. IN may contain up to 52 images.

OUT
Output image. If an output image is supplied it will have the largest data type of all the input images and will contain one more band than the input images. The size of the output image can be set by specifying OUTSIZE.

If OUT is set to NULL (--) then the first image specified in IN will be updated. In this case the data type and size of the image will remain the same.

BAND
Band number. The pixel values from the specified band will be used to compare the images.

UPLEFT(--)
Upper left coordinates. The coordinates of the upper left corner of the output image in projection units. If defaulted, the upper left corner is calculated from the upper left corners of the input image(s).

OUTSIZE(--)
Output image size. The size of the output image in projection units. The first value should be the size in the line direction and the second value should be the size in the sample direction. If defaulted, the output size is calculated from the lower right corners of the input image(s). If OUTSIZE is allowed to default then the output image will be large enough to contain all the input images.

REPLOPT(FIRST)
Replacement option. Provides the user with the option of using either the first image with the minimum or maximum pixel value or the last image when several images have the same pixel value.

  = FIRST: Select first image
           when a tie occurs
  = LAST:  Select last image
           when a tie occurs

SELOPT(MAX)
Selection option. Provides the option of using either the minimum or the maximum pixel value when comparing images.

  = MAX:   Select pixel with
	   maximum value
  = MIN:   Select pixel with
	   minimum value

BANDFLG(YES )
Band flag. Provides the option of generating the identifer band on the output image. This identifer band is used to specify from which input image the pixel values were selected.

  = YES:   Include identifier 
	   band
  = NO:    Do not include
	   identifier band
Subcommand -MANUAL:
The starting line and sample of each input image is entered manually.

IN
Input images. The list of input images to be composited. The images may have window and band options specified and can be of any data type. When an output image is specified all of the entries must have the same number of bands. If OUT is set to NULL (--) then the first entry of IN will be updated. In this case if BANDFLG is set to YES, the first image must contain 1 more band than all the other images. The extra band will be used to store the number of the image from which the pixel values are taken. IN may contain up to 52 images.

OUT
Output image. If an output image is supplied it will have the largest data type of all the input images and will contain one more band than the input images. The size of the output image can be set by specifying NL and NS.

If OUT is set to NULL (--) then the first image specified in IN will be updated. In this case the data type and size of the image will remain the same.

BAND
Band number. The pixel values from the specified band will be used to compare the images.

SL
Starting line. The line where the input image is to be positioned in the output image. SL must contain at least as many values as IN.

SS
Starting sample. The sample where the input image is to be positioned in the output image. SS must contain at least as many values as IN.

NL(--)
Number of lines. The number of lines desired in the output image. When creating a new output image a value must be supplied for this parameter but when updating an image this parameter should be allowed to default to NULL.

NS(--)
Number of samples. The number of samples desired in the output image. When creating a new output image a value must be supplied for this parameter but when updating an image this parameter should be allowed to default to NULL.

REPLOPT(FIRST)
Replacement option. Provides the user with the option of using either the first image with the minimum or maximum pixel value or the last image when several images have the same pixel value.

  = FIRST: Select first image
           when a tie occurs
  = LAST:  Select last image
           when a tie occurs

SELOPT(MAX)
Selection option. Provides the option of using either the minimum or the maximum pixel value when comparing images.

  = MAX:   Select pixel with
	   maximum value
  = MIN:   Select pixel with
	   minimum value

BANDFLG(YES )
Band flag. Provides the option of generating the identifer band on the output image. This identifer band is used to specify from which input image the pixel values were selected.

  = YES:   Include identifier 
	   band
  = NO:    Do not include
	   identifier band

Examples:

  1. LAS> composit-auto in=(img1 img2 img3) out=comp band=3

    This example will use COMPOSIT-AUTO to composite the 3 images IMG1, IMG2 and IMG3. Each pixel of band 3 will be compared among the 3 images and the image that contains the maximum value for each position will have its values taken from all bands and placed in the output image for that individual pixel. If a tie occurs the values will be taken from the first image that contains the maximum value. All 3 images must have the same number of bands, valid corner coordinates, valid projection distances and valid projection units. The output image COMP will be large enough to contain all input images, will have 1 more band than the input images and will have the largest data type of the input images. The extra band will contain the number of the image that the pixel was taken from, with 0 indicating that pixel was filled in because it was not located within an input image.

  2. LAS> composit-auto in=(img1 img2) out=-- band=1 replopt=last selopt=min

    This example will also use COMPOSIT-AUTO in the same manner as in example 1, however, image IMG1 will be updated with the results of the compositing. In this example the minimum values will be selected from band 1 with equal values being taken from IMG2. IMG1 must contain one more band than IMG2 with the last band being used to store the numbers indicating which image the pixels were chosen from. Both images must have valid corner coordinates, valid projection distances and valid projection units. The pixel values from IMG2 will be converted to the data type of IMG1 and any portion of IMG2 that lies outside of IMG1 will automatically be omitted from the composite operation.

  3. LAS> composit-manual in=(img1 img2 img3 img4) out=-- band=2 sl=(1 1 10 10) ss=(1 1 1 1) replopt=last bandflg=no

    COMPOSIT-MANUAL will composite IMG1, IMG2, IMG3 and IMG4 with the results being placed in IMG1. The comparison will be carried out in band 2 with ties taken from the last image that contains the maximum value. The images need not have valid DDRs as the user is supplying the starting line and sample location for each image. Because IMG1 is being updated, the first value of SL and SS are ignored. IMG2 will be composited into IMG1 starting at line 1, sample 1, and IMG3 and IMG4 will be composited into IMG1 at line 10, sample 1. The pixel values from IMG2, IMG3 and IMG4 will be converted to the data type of IMG1 and any portion that lies outside of IMG1 will automatically be omitted from the composite operation. The band that usually contains the image number from which each pixel came from is not created.

Description/Algorithm:

The data type of the output image is largest data type of all the input images except when updating an image, then all of the input images are converted to the data type of the image being updated. All input images are composited to the output image one by one. If the global variable $MINMAX is set then the minimum and maximum values are calculated for the output image after the compositing is finished.

The following example shows a pixel value for 5 input images each with 4 bands and the resulting composite image. For this example assume that BAND=3 and that SELOPT=MAX. Look across for the largest pixel value in band 3. Since the largest value is located in image 4 the value of this pixel, for all bands, is taken from image 4 and placed in the composite image. Notice that the new band of the composite image contains the value 4 indicating that the values were selected from that image.


                      IMAGE             COMPOSITE
    BAND  |   1    2    3    4    5   |   IMAGE
   -----------------------------------------------
      1   |  10   15   12   14   11   |    14
      2   |  20   22   21   25   26   |    25
      3   |  31   34   33  <36>  33   |    36
      4   |  44   45   44   47   44   |    47
      5   |                           |     4

   NOTE: The largest value in band 3 is enclosed with <>

Nonfatal Error Messages:

  1. [composit-close] Error closing image

    An error occurred while closing an image. If the error persists consult the LAS system manager.

  2. [composit-history] Error occurred while updating the history file for <xxxxx>

    An error occurred while updating the history file for image <xxxxx>. The history file may be out of date.

  3. [composit-minmax] Error occurred while calculating the min/max values

    An error occurred while calculating the minimum and maximum values for each band of the output image. The images have already been composited and are saved but the minimum and maximum values may be invalid. To ensure their validity, recalculate them.

  4. [composit-outside] Image <x> lies outside the output image

    The image supplied in position <x> of IN lies outside of the output image. None of the pixels from this image will appear in the output. Processing continues with the next input image.

  5. [composit-svmnmx] Error occurred while invalidating min/max values

    An error occurred while invalidating the min/max values for the image being updated. The images have already been composited and are saved but the min/max values for each band may be invalid. Use EDITDDR to invalidate them.

Fatal Error Messages:

  1. [composit-alloc] Error allocating dynamic memory

    An error occurred while allocating dynamic memory. If the error persists consult the system administrator.

  2. [composit-band] Band specified for compositing is greater than number of bands in the input image(s)

    The value supplied for BAND is greater than the total number of bands in the input image(s). Check BAND to make sure its value is less than or equal to the number of bands in the input image(s).

  3. [composit-fatal] Fatal error encountered

    A fatal error was encountered. The error messages printed prior to this message describe the actual error that occurred. Processing is terminated and the output file is removed if $DELFLG is set to "YES".

  4. [composit-invalid] Corner projection <xxxxxx> of image <yyyyyy> are invalid

    The projection coordinates/distances validity flag of image <yyyyyy> is invalid. The starting line and sample location of this image cannot be automatically calculated. Use the -MANUAL subcommand or place valid coordinates/distances in the DDR of image <yyyyyy>.

  5. [composit-location] Starting <xxxxxx> is outside the output image

    The starting line/sample is located outside the output image. When using the -MANUAL subcommand, all of the starting lines/samples must lie within the output image. Check the appropriate values to ensure that they are correct or remove the corresponding image from the list of images to composite.

  6. [composit-nbands] Image <x> has <y> bands, expecting <z>

    The image specified in position <x> of IN contains <y> bands but COMPOSIT was expecting <z>. When creating a new output image all of the entries in IN must contain the same number of bands. All of these bands will be composited into the new image and a new band will be created to indicate which image the corresponding pixels came from.

    When updating an image the first entry of IN must contain one more band than all of the other images specified in IN. The last band of this image will be used to indicate which image the corresponding pixels came from.

  7. [composit-numimage] First entry of IN contains <x> images. Must contain 1 when updating

    <x> images were specified for image one. When updating an image only one image can be specified in the first position of IN. Respecify the first image or specify an output image.

  8. [composit-pdist] The projection distance of <xxxxxx> does not equal the projection distance of the other input images

    The projection distance of <xxxxxx> is not the same as the distance of the other input images. The starting line and sample of these images cannot be automatically calculated. Use the -MANUAL subcommand.

  9. [composit-required] <xx> must be specified when creating an output image

    The parameter NL/NS cannot be allowed to default when creating an output image. Specify the number of lines/samples to be contained in the output image.

  10. [composit-tolerance] The projection coordinates of <xxxxxx> are not within tolerance of the other input images

    The projection coordinates of <xxxxxx> are not within the tolerance of the other input images that make up one logical image. All images that are used to form one logical image have to have the corner projection coordinates within the specified tolerance. Increase the tolerance with $PROJTOL or use an image with corner coordinates that are within tolerance of the other images.

  11. [composit-unequal] <xx> and IN must have the same number of entries

    The parameter SL/SS must contain the same number of entries as IN. When using the -MANUAL subcommand each image group must have a starting line and starting sample supplied. If too many values are supplied then only the first ones will be used.

  12. [composit-window] Images in position <xx> of IN do not have equal window sizes

    The images specified in position <xx> of IN do not have equal size windows. Images specified with the + operation must have windows that are the same size. Check the window sizes.

User Notes:

  1. If subbands are specified for the input images, BAND will not be the number of the band specified but the position of that band. For example, if only the 12th and 15th bands are to be processed for image IMG1, specified by "IMG1(:12,15)", BAND=1 would specify band 12 and BAND=2 would specify band 15.

  2. To add an extra band to an image so that it can be updated when composited with other images simply run COMPOSIT with the image as the only input and specify an output image. The result will be a copy of the image with one extra band.