Gamma LAT: Reference Manual


validate

ANSI-C program: validate.c

NAME
validate - Validate a landuse map with an available landuse inventory (both maps use the 8-bit SUN raster or BMP format).

SYNOPSIS
validate <ras1> <nclass1> <class1[1]> ... <class1[n]> <ras2> <nclass2> <class2[1]> ... <class2[n]> <rasf_out> <poly> <matrix> [matrix_flag] [accuracy_flag]

<rasf_map> first input data file with INSAR landuse map (SUN raster: *.ras, BMP: *.bmp)
<nclass1> number of classes to use for first input file (max. 16), 0 for all
<class1[1]> value for first class
<class1[2]> value for second class
... further classes of first input file
<class1[n]> value for last class
<rasf_inventory> second input data file with available landuse inventory (SUN raster: *.ras, BMP: *.bmp)
<nclass2> number of classes to use for second input file (max. 16), 0 for all
<class2[1]> value for first class
<class2[2]> value for second class
... factors for further input files
<class2[n]> value for last class
<rasf_out> output 8-bit raster image file (SUN raster: *.ras, BMP: *.bmp)
<poly> data file (input) with the polygons specifying where to validate the classification
<matrix> confusion matrix in percent (output)
[matrix_flag] confusion matrix output flag (default = 1)
0 : number of points
1 : normalized to 1
2 : normalized to 100 (percent)
[accuracy_flag] compute user/prod./over. accuracies (1=YES, 0=NO, default=YES)

EXAMPLES

validate landuse.tm.ras 1 5 land-use_mod.ras 4 7 8 9 10 validation.ras poly forest.perc

Validate the forest class 5 of the landuse map landuse.tm.ras with the four forest classes 7, 8, 9, and 10 of the landuse inventory land-use_mod.ras in the test areas specified by poly. Write an output SUN raster format map validation.ras with four colors corresponds to the four elements of the confusion matrix forest.perc.

validate landuse.tm.ras 0 land-use_mod.ras 0 validation.ras poly landuse.perc

The output SUN raster image validation.ras contains different gray values for each element of the confusion matrix. The confusion matrix normalized to 1 is written to the file forest.perc together with the user, producer and overall accuracy (in %) and the kappa coefficient.

INSTALLATION
Source code validate.c in $LAT_HOME./src. For compilation adjust and use Makefile: Executableimage validate in $LAT_HOME/bin

AVAILABILITY

Uses display programs definition file display.h, SUN raster file definition file rasterfile.h, and BMP format definition file, bmp_image.h.

DESCRIPTION
The program validate allows to validate a landuse map with an available landuse inventory. Both maps (in a co-registered geometry) have to be supplied in 8-bit SUN rasterfile or BMP format. The output image map is for visual interpretation of the validation accuracy in the whole area. The accuracy is further computed for the polygons specified in the file poly specified on the command line. Selection of the polygon regions is supported in the LAT with the program polyras.

Two validation methods are possible: for each class combination (all) or for a 2 classes combination.

In the first case, write 0 as number of classes to use; the confusion matrix is written in a file, the output SUN rasterfile contains different grey values for each element of the confusion matrix. The confusion matrix may contain the number of pixels corresponding to the different classes (case 0) or may be normalized to 1 (case 1) or to 100 (case 2, i.e. in percent). The elements of the ground truth (the landuse inventory) are written in horizontal. Those of the landuse map to be validated in vertical. In addition to the elements of the confusion matrix, the user, producer and overall accuracy as well as the kappa coeffient may be computed. The overall accuracy is given by the sum over the diagonal elements of the matrix normalized by the total number of pixels. The kappa coefficient corresponds to the improvement of the classification in comparison to a result obtained by chance agreement.

In the second case, the validation is made between two classes. For both input maps, the class to validate may correspond to more than one category (e.g. forest may include coniferous and decidous); therefore, the number of categories and their sequence in the maps have to be specified (write 1 and not 0 for the first class). The outputs are the elements of a 2x2 confusion matrix and a image (SUN raster or BMP format) with four colors corresponding to the elements of the confusion matrix.

SEE ALSO
display.h, rasterfile.h, bmp_image.h

DIAGNOSTICS
All messages are generally self-explanatory.


© Copyrights for Documentation, Users Guide and Reference Manual by Gamma Remote Sensing, 2000.
UW, CW, TS, last change 17-Aug-2001.