Declaration: ApplyRFModel (ModelFName: string; MaskIx: integer; var ClassifiedImg: TDouble3DArray; Feedback: boolean): integer;
The function ApplyRFModel applies a random forest model which has been trained and stored by the RF training tool to the currently loaded data cube. The parameter ModelFName specifies the full path of the stored model, the results of the classification are stored in the 3D array ClassifiedImg which is automatically adjusted to match the size of data cube and the number of classes created by the random forest classifier. The parameter MaskIx specifies the index of the mask which is to be used during the classification. 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 ... invalid filename of random forest model
-2 ... the spectral descriptors of the model do not match the available spectral types
-3 ... invalid MaskIx
-4 ... the spectral range required to correcly calculate the spectral descriptors is not sufficient

Last Update: 2017-Mär-15