User's Guide

DIVERGE

Calculates standard or transformed divergences between pairs of classes

Function:

Calculates standard or transformed divergences between pairs of classes in a statistics file. Divergence is a measure of separability between classes and may therefore be used to assess the quality of the statistics prior to image classification. Divergences are calculated for specified feature sets which consist of subsets of the bands in the file.

Parameters:

INSTAT
Input statistics file. This statistics file contains the means and covariances for each class to be analyzed.

NCLASS(--)
Number of classes. The number of classes to be analyzed. The class names are specified interactively.

BANDOPT(--)
Band option. Number of feature sets to be processed. (See User's Note 1).


  = --: All bands
  =  N: All combinations
        of N bands
  = -N: N bands

TYPEOPT(STANDARD)
Type of divergence calculation. Either a standard or transformed divergence is calculated. See the Description/Algorithm section for an explanation of the two divergences.


  = STANDARD:     Standard divergence
  = TRANSFORMED:  Transformed divergence

PRINT(TERM)
Output destination. The destination where the calculated divergences will be written.


  = TERM:     Terminal
  = LP:       Line printer
  = filename: User supplied
              filename

Examples:

  1. LAS> diverge instat=stat.file nclass=3 bandopt=2

    The user is prompted for three class names. Standard divergences are calculated between all possible pairs of the three classes for all possible combinations of two bands from the input statistics file STAT.FILE. The average divergence also is calculated and output to the user's terminal.

  2. LAS> diverge instat=stat.file print=lp bandopt=-3 typeopt=transformed

    The user is prompted to specify three feature sets (subsets) of the bands in the input statistics file STAT.FILE. Transformed divergences between all possible pairs of classes for each of the specified feature sets are calculated. The average transformed divergence is calculated and sent directly to the line printer.

Description/Algorithm:

For each feature set, the pairwise standard divergence is calculated by

                   -1   -1             -1   -1 
 D = .5tr((C1-C2)(C2  -C1  )) + .5tr((C1  +C2  )(M1-M2)(M1-M2)')

     where

     D         =divergence between classes 1 and 2
     C1,C2     =covariance matrix for classes 1 and 2
       -1   -1 
     C1  ,C2   =inverted covariance matrix for classes 1 and 2
     M1,M2     =mean vector for classes 1 and 2
     tr        =trace
     '         =transpose

 and transformed divergence (DTR) is given by

                            -D/8
               DTR = 100(1-e    )

Average standard or transformed divergence for all class pairs is also calculated. The user may specify the number of classes to be analyzed. The user is prompted interactively for class names unless all the classes are being used.

The average divergence (DAV) is calculated by

                     NP                             NP
   DAVtransformed = SUM  DTR/NP  or  DAVstandard = SUM  D/NP
                    k=1                            k=1

   where NP is the number of pairs of classes.

For an explanation of divergence, see P. H. Swain and S. M. Davis, Remote Sensing: The Quantitative Approach, McGraw Hill, 1978.

The user may also select the band subsets (BANDOPT) to be used, by one of two methods.


   1.  All possible combinations of n bands may be processed.  
       If there are four bands in the file and the user elects 
       to process all combinations of three bands, divergences 
       will be calculated in turn for:

                 a.  Bands 1,2,3
                 b.  Bands 1,2,4
                 c.  Bands 1,3,4
                 d.  Bands 2,3,4

   2.  Feature sets may be specified interactively up to a total
       of n feature sets.  If electing to process three feature 
       sets, the user might select:

               a.  # Bands=4    Bands 1,2,3,4
               b.  # Bands=2    Bands 1,4
               c.  # Bands=3    Bands 1,3,4

Nonfatal Error Message:

    None.

Fatal Error Messages:

  1. [diverge-batch] Run interactively with NCLASS > 0 or BANDOPT < 0

    DIVERGE cannot be run in batch mode when the parameter NCLASS or BANDOPT is used to specify values interactively.

  2. [diverge-nclass] Number of classes in file less than number requested

    Check the statistics file or specify for all available classes in the statistics file.

  3. [diverge-class] 3 errors in specifying a class name. Restart

    The user has only three attempts to enter a valid class name.

  4. [diverge-meansiz] Mean has too few bands for class # <xx>

    Check the statistics file for validity.

  5. [diverge-covsiz] Covariance has too few bands in class # <xx>

    Check the statistics file for validity.

  6. [diverge-cov] Error getting covariance matrix for class <xx>

    Regenerate the statistics file containing the statistics for class # <xx>.

  7. [diverge-mean] Error getting mean vector for class <xx>

    Regenerate the statistics file containing the statistics for class # <xx>.

  8. [diverge-alloc] Error allocating dynamic memory

    An error occurred allocating memory. Rerun DIVERGE, and if the error reoccurs, contact the system manager.

  9. [diverge-fatal] Fatal error encountered

    A fatal error was encountered during processing. Processing is terminated. The error message that is displayed immediately preceding this message is the specific error that was encountered.

  10. [diverge-stopen] Error opening the statistics file

    An error occurred opening the stats file. Check the stats file for file protection problems.

User Note:

  1. The user may select the band sub-sets (features) to be analyzed. By default all bands will be used together in a single set.

    If BANDOPT = N, then all possible combinations of N bands will be used. For example, with a 4 band file and BANDOPT = 3 distances will be calculated for:

         (a) BANDS 1,2,3 
         (b) BANDS 1,2,4 
         (c) BANDS 1,3,4 
         (d) BANDS 2,3,4
    

    If BANDOPT = -N, the user will be prompted interactively for N feature sets. This allows the user to vary the number of bands in each set.