User's Guide

CONTABLE

Generates a contingency table from two input images

Function:

Generates a contingency table using two classified input images of equal size. The images must contain BYTE data and contain only one band.

Parameters:

IN
Input images. First image forms the rows of the contingency table. Second input image forms the columns of the contingency table. Images must be single band, BYTE images.

PRINT(TERM)
Destination for contingency table output. The available options are terminal, line printer, or a disk file. The disk file is a text file and may be displayed/printed using the host operating system commands.


  = TERM:     Terminal 
  = LP:       Line printer 
  = Filename: User supplied 
              file name

EXVALFLG(YES)
Expected value flag. Specifies whether or not the output table will contain the expected frequency values as well as the normal frequency values.


  = YES:  Leave expected values
  = NO:   Omit expected values 

Examples:

  1. LAS> contable in=("dc.map1(1,1,100,100)","dc.map2(1,1,100,100)")

    A contingency table is computed using the two input images DC.MAP1 and DC.MAP2 with the specified window. The contingency table is printed on the terminal.

  2. LAS> contable in=(dc.map1,dc.map2) print=contable.prt

    The contingency table is computed using both input images and the output directed to file the CONTABLE.PRT.

  3. LAS> contable in=(qw.dat,as.dat) exvalflg=no

    The table is computed for the entire image and is output to the terminal. Expected values are withheld from the output.

Description/Algorithm:

CONTABLE checks pixel (i,j) of both input images and records the frequency of each different combination of intensity values. The cell (x,y) in the contingency table is incremented if a pixel has a value x in the first image and a value y in the second image.

For each (x,y) cell in the table, the first line shows the number of pixels of class x in the first image that are class y in the second image. The second line shows the expected number, assuming that the the probability of obtaining class x in the first image is independent of the probability of obtaining class y in the second. Thus,

expected (x,y) = prob(x)*prob(y)*(# pixels in image) = (# pixels x)*(# pixels y)/(# pixels in image)

The total number of pixels in each class is tabulated, as are the mean, standard deviation, skewness, and kurtosis.

The following computations are used:

For each column j with n elements,


                   n
                   
                  SUM  x    
			kj
              _   k=1
    mean(j) = x = -------
                     n  


              ---            --- 1/2
              |  n             |
              |            _  2|
              | SUM   (x  -x ) |
              |         kj  j  |
              | k=1            |
   stdev(j) = | ------------   |
              |    (n-1)       |
              ---            ---


                y     
                 3j          
    skew(j) = --------
                   3/2       
              (y  )     
                2j         


               y   
                4j  
    kurt(j) = ---- -3
               2 
              y  
               2j 


 where

    x   are the elements in column j, and
     kj                 

           n          
                   _  m 
          SUM (x  -x )  
                kj  j  
    y     k=1         
     mj = ------------   
               n

Output can be sent to the terminal, line printer, or to a disk file.

Nonfatal Error Messages:

    None.

Fatal Error Messages:

  1. [contable-bands] Images must be single band

    Input images must be single band images.

  2. [contable-size] Input image sizes do not match

    The input images must have the same size.

  3. [contable-type] Image is not a byte image

    Input images must be BYTE images.

User Notes:

  1. Displaying a contingency table with 80 classes on each image can take as long as 10 minutes on a terminal. Users with a large number of classes may wish to route their output directly to the line printer by using the PRINT=LP parameter.