Declaration: CalcRFOVAMap (ClassifiedImg: TDouble3DArray; var OVAMap: TInt2DArray; var MaxRFResponse, Purity: TDouble2DArray; Feedback: boolean): integer;
The function CalcRFOVAMap calculates the one-versus-all map1 of the classification results of a random forest classifier. The parameter ClassifiedImg contains the classification results as obtained from ApplyRFModel. On return the variable parameters OVAMap, MaxRFResponse and Purity contain the one-vs-all map, the maximum random forest response over all classes and the purity value2, respectively. These three arrays are automatically resized to the spatial size of the ClassifiedImg parameter. The Feedback parameter controls whether a visual feedback is provided during the classification.

The function returns the following error codes:

 0 ... everything is OK
-1 ... at least one of the dimensions of ClassifiedImg is zero

1 The one-versus-all map contains for each pixel the class number of the classifier which exhibits the highest response of all classifiers. Please note that the OVA map may be misleading if all classifier results are well below the classification threshold. In this case the pixel will be assigned to a class with little justification for doing so. Thus it is strongly recommended to look both at the OVAMap and the MaxRFResponse.
2 The purity value is a value between 0.0 and 1.0 indicating the uniqueness of the detected class. In an ideal case one classifier should deliver a value of 1.0 (for the recognized class) while all other classifiers return a value of 0.0. Under real circumstances the returned classification results are not always exactly 0.0 or 1.0 but sometime a little bit off. The purity is now the product of the classification result (CFR) of the positively identified class and 1-CFR of all other classifiers (assuming that all other classifiers are specific for other classes). Please note that the purity value will be misleading if the ClassifiedImg parameter contains several classifiers specific for the same class.