TrainImagesClassifier Execution Error

Hello,

I looked at this problem and the exception comes from a bug in TrainImagesClassifier. I made a fix that will be included in otb 7.1.0.

Oddly, the exception is caused by the presence of a OFTReal field in the in input vector data (the SURF field). This field is ignored in the first steps of the application but not in the learning step, where it is one of the field that can be used for classification. As a result the field list is messed up and the application tries to use the Nom_nomenc field for the learning, resulting in the conversion error.

OTB 7.1.0 will be available soon, in the meantime you can :

  • Use TrainVectorClassifier instead of TrainImagesClassifier, but you will to perform the sampling operations by yourself (PolygonClassStatistics, SampleSelection and SampleExtraction, see the learning recipe
  • Alternatively, remove the SURF field before using TrainImagesClassifier.

Cédric