Classification of Sentinel2 images with Qgis


I am using Qgis software to apply random forest classification Algorithms, as in the following picture:

I am using Orfeo Toolbox to classify, in the first step “compute Image statistics”, I got this message as an error:

could you help me with this problem, Please?

Many thanks,



I presume OTB doesn’t like special characters in the full path,
Replace année by annee


1 Like


Many thanks for your answer. It’s working!

kind regards,


I am trying now to create the image classification, but I don’t know what to put in “Input Model File”:

I tried with the output model I created in the previous step 2-Train Random Forest Image Classifier" , but I found nothing!!

How can I solve it, please?

kind regards,

you have to run step 2-train classifier, the output is a txt file which can be used in step 3.


after running step 2, I got this:

there is no txt file?!!

Many thanks.


It doesn’t need to be a txt file, but you need to write the output of the training to a file. If you select it in the classification module, you will get your image classified. I just tested it and it works fine:

Image with training polygons (they have attributes between 1 and 4, written in attribute ‘id’)

Training (It is important to load the image, the vector AND the name of the attribute that contains the classes, ‘id’ in my case. I selected model.txt as an output file)

Classification (Here, load the image and the model.txt)


1 Like

I think this is answered now.

@CHOCHO Please use the support options QGIS ( provides if you have QGIS question. Questions regarding SNAP, the toolboxes or the sensors are welcome.

1 Like