User's Guide

MINDIST

Performs classification based on minimum distance from class means

Function:

Produces a single-band image of pixel cluster assignments. An input pixel is assigned to a given cluster if the distance from the cluster mean to the pixel is the smallest of all the clusters. Cluster means are obtained from the statistics file.

Two methods are available for computing the minimum distance: Euclidean or City Block (sum of distances). Pixels with extreme values may be excluded from the classification if their computed distances exceed the specified MAXDIST. Individual weights may be assigned to each input band using the parameter WEIGHTS in order to control the relative contribution that each band has on the classification. The maximum number of bands accepted is 50.

Parameters:

IN
Input image. The multi-band image that is to be classified. It may contain from 2 to 50 bands and its data type may be BYTE, and INTEGER*2, INTEGER*4, or REAL*4.

OUT
Output image. The output single-band classification image. Its data type is always BYTE. Pixel values correspond to the cluster (class) assignments based on the numbering within INSTAT; i.e., if a pixel is assigned to the cluster that is the third entry in the statistics file, that pixel will have a value of 3 in the output image.

INSTAT
Input statistics file. The input statistics file from which the class means are read. The number of mean values for each class in INSTAT must match the number of bands in the input image.

NCLASS(--)
Number of classes. Specifies the number of classes to use in the classification. If defaulted, all classes in the input statistics file are used. When NCLASS > 0, the user is prompted for selection of classes from the input statistics file.

PRINT(LP )
Output destination. Destination for class means, standard deviations, and number of members in each class. If PRINT = LP, the information is printed on the line printer.

  = --      :  No Report
  = TERM    :  Terminal
  = LP      :  Line printer.
  = FILENAME:  User supplied filename

MAXDIST(0.0 )
Maximum distance. Maximum distance that an input pixel can be from a cluster's centroid and still be assigned to that cluster.

  =  0.0:  Any distances.  All output cluster 
           assignments are to the cluster with the closest 
           mean.  
  = -1.0:  Different distances for individual classes.  
           The user is prompted for the maximum distance 
           value for each of the selected classes.  If the 
           distance between a given pixel and its closest 
           mean is greater than the MAXDIST entered for 
           that class, the output cluster assignment
           value is 0.
  >  0.0:  Same distance for all classes.  If MAXDIST is 
           greater than 0.0, the same maximum distance is 
           used for all classes.  If the distance between 
           an input pixel and its closest mean is greater
           than MAXDIST, the output cluster assignment 
           value is 0. 

WEIGHTS(--)
Weight value(s). List of weights to apply to the image bands during distance computations. The contribution of each band in the classification can be controlled by specifying weights. The relative contribution of each band increases as the weighting for that band increases and vice versa.

CALCDIST(EUCLID)
Calculated distance. The type of distance to compute.

  = EUCLID:   Euclidean distance.  The distances
              between pixels and class means is
              computed using EUCLIDEAN distance,
              i.e.,  the square root of the sum of
              the squared distances between class
              means and input pixel values for all
              bands.

  = CITYBLK:  The distances between pixels and class
              means is computed using the sum of the 
              distances for all bands.

Examples:

  1. LAS> mindist in="dc(:1-3,5)" out=dc.mindist instat=dc

    The minimum distance cluster assignments are computed from the means found in the input statistics file DC;STATS. Bands 1, 2, 3, and 5 of the input multi-band image DC are used for processing. Statistics are printed out.

  2. LAS> mindist in="dc(:1-3,5)" out=dc.mindist instat=dc print=-- maxdist=30 weights=(1.0,1.5,1.7,2.0) calcdist=cityblk

    The same image and statistics files used in Example 1 are used in this example. In this case, however, the statistics are not printed. When the minimum distance is found to be greater than 30, the output pixel is set to 0. The CITYBLK algorithm is used to compute the minimum distance, and each of the bands are weighted differently.

Description/Algorithm:

Each multi-band pixel is assigned a cluster number based on one of the following distances:


               CITYBLK                         EUCLID

         n                                      n
          B                                      B              2
CD   =  SUM  W | x  -  m  |       ED   = SQRT [SUM  W (x  - m  ) ]
  j     i=1   i   i     ij          j          i=1   i  i    ij
                                

where

   CD  = "city block" distance between multi-band pixel 
     j
          (vector x) and mean vector for cluster j

   ED  = "Euclidean" distance between multi-band pixel 
     j
          (vector x) and mean vector for cluster j

   n   = number of spectral bands in input image
    B
   x   = value of pixel in ith band
    i
   m   = mean of ith band for class j.
    ij
   W   = weight for ith band
    i


The corresponding output pixel is assigned to the class j, which has
the minimum CD  or ED , depending on the value of the parameter 
              j      j
CALCDIST. If MAXDIST is set (i.e., is not 0) and the minimum CD or ED
                                                               j     j
is greater than the value of MAXDIST, then the output pixel is assigned 
a value of 0.

Nonfatal Error Messages:

  1. [mindist-nclass] NCLASS larger than total number of classes in stats file; number of classes to be used is now reset to: XXX

    The number of classes specified by the user is greater than the number of classes in the statistics file. Only the number of classes XXX in the statistics file will be used for processing.

Fatal Error Messages:

  1. [mindist-bands] Number of bands in input image must be between 2 and 50

    Specify an image with at least 2 and at most 50 bands (may be further limited by the system installation).

  2. [mindist-fatal] Fatal error encountered

    A fatal error was encountered. The previous messages describe the exact error.

  3. [mindist-maxdist] Invalid MAXDIST specified

    The value of MAXDIST should be -1, 0, or any positive real value.

  4. [mindist-noweights] Weights not specified for some bands

    The number of weights specified is less than the number of bands.

  5. [mindist-noclass] No classes in statistics file

    Re-create the statistics file or verify that the correct name for the INSTAT parameter is specified.

  6. [mindist-nomean] No mean for one of classes in statistics file

    Recreate the statistics file or verify that you specified the correct name for the INSTAT parameter.

  7. [mindist-nbands] The number of bands in mean of statistics file does not match image

    Recreate the statistics file or verify that you specified the correct name for the INSTAT parameter.

User Notes:

  1. The input image IN must contain the same number of bands as used in calculating the statistics contained in the input statistics file. The number of bands is limited to the maximum permitted by the system and shall not exceed 50.