I'm having a struggle with SVM classification in QGIS OrfeoToolbox.

I used to work with RandomForest in R, but now I'm trying to figure out how the SVM algorithm works. I guess there would also be similarity between those packages(another topic).

Because I've no scripts nor knowledge about "e1071-SVM-Kernel" package, I've found a plugin within OrfeoToolbox; it simply requires a shapefile(polygons with values) and .xml file which includes every values for polygons in each bands.

My workflow was;

  • Creating Polygons with mean & sd values for each band I used in. which was numbered over 30k.
  • Then I've exported that shapefile into .xml like OGR plugin required from me.

Problem started in this point; Whenever I try to compute and right after train a model for final prediction, plugin doesn't produce any output even if I've executed it smoothly.

The modules I've used in a row are;

  1. ComputeOGRLayersFeaturesStatistics
  2. TrainOGRLayersClassifier
  3. OGRLayerClassifier

Step 3 doesn't work just because I've got no model from step 2, even if I define the output into a file.

What would be the problem? I hope I've set the problem clearly.

P.S. there's no warning nor error in the process when I execute it. There's nothing wrong with module Log. P.SS I'm using QGIS 2.14.7 with all the modules in it.

  • Try using Montiverdi instead OTB plugin inside QGIS or use command line if you have inputs ready. Maybe QGIS crash with 30k features. – aldo_tapia Jan 11 '17 at 19:28

I am not sure to understand the workflow you're trying. Perhaps you can start from the OTB cookbook recipes for pixel based classification:


It will help you to go from samples selection using an input vector training set (polygons) to the learning and the classification process.

The workflow used multiple applications.

Fo just a quick test you can try the "all in one" application TrainImagesClassifier :


  • Thanks a lot for that cook book, there's a lot for digging! I basically use attribute table to train my shapefile. Creating a new column named as "Class, class or C_ID" after then selecting the polygons to assign classes with numbers "1,2,3,4.. etc.". That's what I did when I used RF algorithm lately to train my polygons. – Hüseyin Özgür Doğan Jan 24 '17 at 16:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.