# ComputeConfusionMatrix

## Brief Description

Computes the confusion matrix of a classification

## Tags

Learning

## Long Description

This application computes the confusion matrix of a classification map relatively to a ground truth. This ground truth can be given as a raster or a vector data. Only reference and produced pixels with values different from NoData are handled in the calculation of the confusion matrix. The confusion matrix is organized the following way: rows = reference labels, columns = produced labels. In the header of the output file, the reference and produced class labels are ordered according to the rows/columns of the confusion matrix.

## Parameters

- [param] -in <string> The input classification image.. Mandatory: True. Default Value: ""
- [param] -out <string> Filename to store the output matrix (csv format). Mandatory: True. Default Value: ""
- [param] -nodatalabel <int32> Label for the NoData class. Such input pixels will be discarded from the ground truth and from the input classification map. By default, 'nodatalabel = 0'.. Mandatory: False. Default Value: "0"
- [param] -ram <int32> Available memory for processing (in MB). Mandatory: False. Default Value: "128"
- [param] -inxml <string> Load otb application from xml file. Mandatory: False. Default Value: ""
- [param] -outxml <string> Save otb application to xml file. Mandatory: False. Default Value: ""
[choice] -ref Choice of ground truth format raster,vector. Mandatory: True. Default Value: "raster"

- [group] -raster

- [param] -ref.raster.in <string> Input image containing the ground truth labels. Mandatory: True. Default Value: ""

- [group] -vector

- [param] -ref.vector.in <string> Input vector data of the ground truth. Mandatory: True. Default Value: ""
- [param] -ref.vector.field <string> Field name containing the label values. Mandatory: False. Default Value: "Class"

## Limitations

None

## Authors

OTB-Team

## See Also

## Example of use

- in: clLabeledImageQB1.tif

- out: ConfusionMatrix.csv

- ref: vector

- ref.vector.in: VectorData_QB1_bis.shp

- ref.vector.field: Class

- nodatalabel: 255