User's Guide

WAVEMERGE

Merge high resolution data into a lower resolution RGB image using wavelets.

Function:

Merge high resolution data into a lower resolution RGB image. The merge process uses the wavelet transform to extract detail information. An example would be the merging of three TM bands, representing an RGB image at 30 meter resolution, with a SPOT panchromatic image at 10 meter resolution.

Parameters:

LOW
Input low resolution RGB (3-band BYTE) image. The three-band image into which the detail information from HIGH will be merged. Windowing is allowed.

HIGH
Input high resolution grayscale image. The high(er) resolution one-band image to be merged into LOW. Windowing is allowed.

OUT
Output merged image (3-band BYTE). A three-band image representing LOW with the detail information of HIGH merged in.

NLEVELS(0)
Number of transform levels. If the user specifies a value (other than zero), this value will be used. Otherwise, WAVEMERGE will compute a value for NLEVELS based on the difference in resolution between LOW and HIGH. See User Note 1.

HPFACTOR(1.0)
High pass contribution factor. The merge process combines detail (high pass) information from LOW and HIGH. HPFACTOR is the fraction of the dominant details (whether coming from LOW or HIGH) that will be retained in the merged image. The subordinate details contribute one minus HPFACTOR. A value of 0.7 means that if, for a given image location, the detail in HIGH is more pronounced than the detail in LOW, 70% of the detail in HIGH and 30% of the detail in LOW will be retained in the merged image (and vice versa). The default is 1.0, which means that the merged high pass details represent the larger of the two components from LOW and HIGH.

RESAMP(CC)
Resampling method. Pixel values in the output image are determined by finding the corresponding location in the input image. The pixel location in the input image is a floating point value, i.e., it can fall between pixels. A method of interpolating a brightness value for that pixel location is therefore needed.


  = BI:     Bilinear.  Bilinear interpolation uses a 2 x 2 block
            of input pixels which surround the calculated floating
            point pixel position to determine the output pixel
            brightness value.

  = CC:     Cubic convolution.  Cubic convolution interpolation
            uses a 4 x 4 block of input pixels which surround the
            calculated floating point pixel position to determine
            the output pixel brightness value.

  = TABLE:  Table-based.  Table-based resampling uses a N x M
            block of input pixels which surround the calculated
            floating point pixel position to determine the output
            pixel brightness value.  The dimensions N and M, as
            well as the resampling kernel (resampling weights),
            are contained in the user-entered file of resampling
            weights.  See User Note 2 for more information.

  = NN:     Nearest neighbor.  Nearest neighbor interpolation uses
            the brightness value of the pixel closest to the
            calculated floating point pixel position.

Warning: In general, nearest neighbor resampling will produce poor results in WAVEMERGE because the low resolution image retains "blocky" artifacts representing large high pass components that may be larger than the corresponding high resolution image details. Therefore NN should not be used unless the user has a specific intention for which nearest neighbor resampling is appropriate.

The default value is CC.

INRWT(--)
Input resampling weight table file. A file containing an externally generated table of resampling weights. This parameter is required when RESAMP=TABLE. It is ignored for all other resampling methods.

Examples:

  1. LAS> wavemerge low=tmimage high=spotimage out=mergeimage nlevels=2 hpfactor=0.7 resamp=bi

    The input image TMIMAGE consists of three bands representing red, green, and blue (RGB). The input image SPOTIMAGE is a higher resolution grayscale image. TMIMAGE will be resampled using bilinear resampling to be the same resolution as SPOTIMAGE. The resampled RGB image will be converted to hue, intensity, and saturation bands, and the intensity band and SPOTIMAGE will then be run through two levels of the wavelet transform, merging the high pass (detail) information at each level. The high pass data is merged using the factor of 0.7 which means that 70% of the dominant details (whether coming from TMIMAGE or SPOTIMAGE) will be retained and combined with 30% of the subordinate details.

  2. LAS> wavemerge low="tmimage(101,101,500,500:6,4,2)" high="spotimage(501,501,1000,1000:7)" out=mergeimage

    Bands 6, 4, and 2 of TMIMAGE will be used for the red, green, and blue bands, respectively. A window (starting line=101, starting sample=101, number of lines=500, number of samples=500) will be extracted from these three bands to comprise the low resolution image. A window (starting line=501, starting sample=501, number of lines=1000, number of samples=1000) from band 7 of SPOTIMAGE comprises the high resolution image.

    LOW will be resampled using the default cubic convolution resampling to be in the same projection and resolution as SPOTIMAGE. The HIGH window will be extracted from the resampled LOW. The resampled RGB image will be converted to hue, intensity, and saturation bands, and the intensity band of the resampled image and SPOTIMAGE will then be run through the number of wavelet transform levels computed based on the difference in resolutions between LOW and HIGH. The high pass data is merged using the default method of retaining the dominant details (whether coming from TMIMAGE or SPOTIMAGE).

Description/Algorithm:

The low resolution image is first resampled to the same projection, resolution, and window as the high resolution image. For images that do not contain valid projection information, the input images are assumed to be in the same projection and coregistered at the upper left window coordinate. The resultant image is then converted from RGB format to HIS format. The intensity band and the high resolution band are then passed through the actual wavelet merge process, yielding a merge band. The merge band replaces the intensity band in the HIS image, which is then converted back to RGB format.

Nonfatal Messages:

  1. [wavemerge-hist] Error writing the history for <filename>.

    An error occurred while writing the history file for <filename>. Contact LAS personnel.

  2. [wavemerge-info] Using N levels of wavelet transform.

    An informational note stating that N levels of the wavelet transform are to be applied during the merge process. If the user specified a value (other than zero) for NLEVELS, this value should equal N. Otherwise, WAVEMERGE will compute a value for N based on the difference in resolution between LOW and HIGH. See User Note 1.

  3. [wavemerge-minmax] Error updating the min/max DDR for <filename>.

    An error occurred while updating the min/max pixel information in the DDR. Contact LAS personnel.

  4. [getddrinfo-valid] Input images are assumed to be in same projection and coregistered at upper left corner.

    This warning accompanies nonfatal messages 5 and 6. It warns the user that, since some of the input image projection information is invalid, processing will continue, but the input image windows are assumed to be in the same projection and coregistered at the upper left corner.

  5. [getddrinfo-valid] LOW DDR contains invalid projection information.

    The low resolution image DDR did not contain valid projection information. Processing will continue.

  6. [getddrinfo-valid] HIGH DDR contains invalid projection information.

    The high resolution image DDR did not contain valid projection information. Processing will continue.

Fatal Error Messages:

  1. [getddrinfo-bands] Number of low resolution bands not equal to three.

    The LOW image specification does not contain precisely three bands. This image is assumed to represent a three-band red, green, blue (RGB) image. Ensure that the LOW image specifies exactly three bands.

  2. [getddrinfo-bands] More than one high resolution band.

    The HIGH image specification contains more than one band. This image is assumed to represent a single-band grayscale image. Ensure that the HIGH image specifies only one band.

  3. [getddrinfo-ddr] Error retrieving DDR for <filename>.

    An error occurred while reading the image DDR information. Ensure that <filename>;ddr exists and is correct. Try using "LAS> DSPDDR <filename>" to verify the DDR correctness.

  4. [getddrinfo-getin] Error parsing input image specification for XXX.

    The image specification for the input parameter XXX could not be parsed. Ensure that the input format is proper.

  5. [getddrinfo-pixsiz] Pixel has illegal size.

    The projection distance (pixel dimension) is not a positive number, which does not represent a valid pixel dimension.

  6. [getddrinfo-update] Error updating variable block.

    An error occurred while updating the variable block to pass values back to the main PDF. Notify LAS personnel.

  7. [wavemerge-alloc] Error allocating memory.

    An error occurred while trying to allocate system memory. This may be due to applying a large number of wavelet levels (NLEVELS) or running on a system with very limited available resources. Contact LAS personnel if the problem persists.

  8. [wavemerge-bands] Input image <filename> has more than one band.

    The input image <filename> contains more than one band. During the actual image merge process, the two input images are the intensity band of the (windowed) RGB image (LOW) and the (windowed) grayscale image (HIGH). Contact LAS personnel.

  9. [wavemerge-buffer] Error creating transform buffer.

    An error occurred while creating a transform buffer. If a preceding message concerns memory allocation errors, check the available memory, retry, and, optionally, contact the system administrator. Otherwise, notify LAS personnel.

  10. [wavemerge-buffer] Reached end of buffer list prematurely.

    An error occurred while working through the list of transformation buffers. Notify LAS personnel.

  11. [wavemerge-close] Error closing output image <filename>.

    An error occurred while closing the output file. Verify that the image size will fit in the available disk space. Contact LAS personnel if the problem persists.

  12. [wavemerge-exists] Error: <filename> already exists.

    The file noted already exists and will not be overwritten. Either delete the existing file (and its associated files) or use another name for the corresponding parameter.

  13. [wavemerge-fatal] Fatal error encountered.

    A fatal error has occurred. Refer to the preceding error message for details of the actual error. Processing is terminated.

  14. [wavemerge-getin] Error parsing input image specification for XXX.

    The image specification for the input parameter XXX could not be parsed. Contact LAS personnel.

  15. [wavemerge-getout] Error parsing output image specification for OUT.

    The image specification for the input parameter OUT could not be parsed. Contact LAS personnel.

  16. [wavemerge-invtrans] Error encountered during inverse transform process.

    An error has occurred during the inverse wavelet transform process. Contact LAS personnel.

  17. [wavemerge-isidwt] Error computing the ISIDWT.

    An error occurred while computing the inverse shift-invariant discrete wavelet transform (ISIDWT). Notify LAS personnel.

  18. [wavemerge-merge] Error merging image blocks.

    An error occurred while merging a pair of image blocks from LOW and HIGH. Contact LAS personnel.

  19. [wavemerge-parm] Error retrieving parameters.

    An error occurred while retrieving the input parameters. Verify the correctness of the input parameters, and contact LAS personnel if the problem persists.

  20. [wavemerge-read] Error reading input image <filename>.

    An error occurred while reading an image block from <filename>. Contact LAS personnel.

  21. [wavemerge-transform] Error encountered during transform-merge process.

    An error has occurred during the wavelet transform and high pass merge process. Contact LAS personnel.

  22. [wavemerge-upddr] Error updating the DDR for <filename>.

    An error occurred while updating the image DDR. Contact LAS personnel.

  23. [wavemerge-window] Input images are not same size.

    During the actual merge process, the input images should have been windowed to the same, coregistered size. Contact LAS personnel.

  24. [wavemerge-write] Error writing output image <filename>.

    An error occurred while writing an image block to <filename>. Contact LAS personnel.

User Notes:

  1. Each wavelet transform level extracts image details at a given resolution. The resolution is reduced by a factor of two with each level. The number of levels required is dictated by the difference in resolution of the two original images. For example, say we have a TM RGB image with 30 meter pixel resolution and a SPOT panchromatic image with 10 meter resolution. The TM image will be resampled to the same resolution as the SPOT image (10 meters). The first transform level will extract details at 10 meter resolution. The second transform will extract details at 20 meter resolution. The transform process must continue until all details have been extracted at resolutions up to and including the original low resolution. Therefore, in our example, one more transform must be computed to extract details at 40 meter resolution. The default is zero, which will notify WAVEMERGE to compute the number of levels based on the resolution difference.

  2. A file description for the resampling weight table file may be found in the LAS Programmer's Manual. Resampling weight table files may be generated with the RTABLE module.