User's Guide

CLUSTER

Generate a clustered LAS image

Function:

Performs an unsupervised classification using a modified isodata type clustering algorithm. Output consists of a single-band BYTE image of sample cluster assignments and a labeled table file with means, covariance matrices, and the number of samples for the clusters. The input image data may only be BYTE.

Parameters:

IN
Input image. Only BYTE data is allowed. Window and/or band options may be specified. The window size of all input images are required to be the same.

OUT
Output image. The output single-band classification image. Its data type is always BYTE. Pixel values correspond to the cluster (class) assignment based on the numbering within the internally generated look up table of cluster means; i.e., if a pixel is assigned to the cluster that is the third entry in the look up table, that pixel will have a value of 3 in the ouput image. A labeled table file that is associated with the output image will be created with an ;LT extension. An formated ASCII statistics file will be created with an ;DAT extension.

NCLUST(3)
Number of clusters. Specifies the number of clusters to use in the classification.

NITER(2)
Number of iterations. The number of data sampling passes to make through the input image.

MULTFACT(1)
Multiplicity factor. MULTFACT is used to vary the number of pixels actually sampled per iteration. See User Note 3.

PRINT("TERM")
Output destination. The destination of the history report. The history report file contains image processing parameters, image sampling summaries, and elapsed CPU time.


  = --:         No Report
  = TERM:       Terminal.  Output is sent to the
                user's terminal.
  = LP:         Line printer.  Output is sent to the
                printer defined by $PRINTER.
  = Filename:   User-supplied filename.  Output is
                sent to the user-supplied file with
                the default extension ".prt".

Examples:

  1. LAS> cluster in=tm.byte out=class nclust=50 niter=10 multfact=100 print=class;hst

    Clustering is performed on the input image TM.BYTE. The resulting cluster assignment image, CLASS;IMG is created. Output statistics are stored in CLASS;LT. The output history report is stored in CLASS;HST. The number of clusters to be created is 50. The number of iterations is 10. The multiplicity factor is 100 (See User Note 3). This choice of parameter settings will allow about 7% of the scene to be sampled in generating the clusters. This percentage is based on an average seven band TM scene.

  2. LAS> cluster in=tm.byte out=claxy nclust=50 print=claxy

    Clustering is performed on the input image TM.BYTE. The resulting cluster assignment image is CLAXY;IMG. An output labeled table file, CLAXY;LT is created. The output clustering history report is stored in CLAXY;PRT. There are 50 clusters created. The number of iterations is 1. The multiplicity factor is 1. This choice of parameter settings will allow about 0.07% of the scene to be sampled in generating the clusters.

Description/Algorithm

The input image is opened and a random sampling is done in a psuedo linear manner. A one dimensional array that has values from zero to number of samples times number of pixels is used for the random sampling range. Once the random values have been found (not to exceed MAXSAMP), the random values are sorted into ascending value. These sorted values are then converted back into line/sample values from the input image. The pixel vectors for the specified line/sample pairs will be copied to memory and used to determine the class cluster mean vectors by processing them through a Monte-Carlo statistics process (See User Note 2).

The class cluster means are organized in increasing value of absolute euclidian value to speed nearest neighbor searches during the image classification. For each pixel vector of the imput image, an approximation of which cluster the pixel belongs to based on its absolute euclidian distance. Only the clusters in the vicinity of the estimated cluster are searched for the correct cluster.

A single band BYTE clustered image is generated, and the cluster means and covariance matrices are written to a labeled table file and an ASCII formatted text file.

Nonfatal Error Messages:

  1. [cluster-close] Error closing <XXXXX>

    An error was encountered closing the specified file. Processing continues.

Fatal Error Messages:

  1. [cluster-alloc] Error allocating memory

    An error was encountered allocating dynamic memory. Contact the system manager.

  2. [cluster-dtype] Invalid data type

    The data type of the input image cannot be processed by CLUSTER. Valid data type is BYTE.

  3. [cluster-fatal] Fatal error encountered

    A fatal error was encountered during processing. The message displayed immediately preceding this message specifies the specific error encountered. Processing terminates.

  4. [cluster-lookup] PC magnitude error

    An error was encountered during euclidian distance calculation. A magnitude of less than 1.0E-10 was found. A pixel vector composed entirely of zeros will cause this error. Verify that the input image was not corrupted.

  5. [cluster-nolut] Mean vectors not present

    An error occured in passing the cluster mean vectors to the classification portion of CLUSTER. Contact the system administrator.

  6. [cluster-open] Error opening <XXXXX>

    An error was encountered opening the specified file. Check file and directory protections and re-run the program.

  7. [cluster-read] Error reading <XXXXX>

    An error was encountered reading the specified file. Check file and directory protections and re-run the program.

  8. [cluster-window] Input images do not have same window sizes

    An error occurs if multiple input images are specified with different window sizes. Respecify the windows and re-run.

  9. [cluster-write] Error writing <XXXXX>

    An error was encountered writing the specified file. Check file and directory protections and re-run the program.

User Notes:

  1. This algorithm was extracted from code provided by Jim White, Los Alamos National Labs.

  2. The Monte-Carlo method is described in "Survey Sampling in the Environmental Sciences, A Computer Approach", by J. Barrett and M. Nutt, Wentworth, NH, COMPres, Inc, 1979.

  3. The multiplicity factor is used to vary the number of pixels sampled per iteration. The maximum number of pixels sampled is equal to ten times the specified number of clusters times the multiplicity factor. The first iteration will only sample two times the number of cluster pixels, and this will double for each successive iteration until the maximum is reached. The multiplicity factor allows the user to increase the maximum number of pixels sampled, although the iterative step increase still applies. The following equation is used to determine the maximum number of samples extracted per iteration:

                maxsamp = (MULTFACT * 10 * NCLUST)
     
        Example 1>  MULTFACT = 1
                    NCLUST = 240
                    ITERATIONS = 12
                       
                    Iteration   Pixels sampled
                    ---------   --------------
                        0           0   (2400 is maxsamp result) 
                        1         480
                        2         960
                        3        1920
                        4        2400
                        5        2400
                        :        :
                        :        :
                       12        2400
                     
    
         Example 2> MULTFACT = 100
                    NCLUST = 5
                    ITERATIONS = 10
    
                    Iteration   Pixels sampled
                    ---------   --------------
                        0           0  (5000 is maxsamp result)   
                        1          10
                        2          20
                        3          40
                        :          :
                        9        2560
                       10        5000