Hello Guillaume, thank your for the answer. I figured out most of it and was going to write this here soon.
- The oneclass option is callable from -classifier.svm.m instead of -classifier.libsvm.m. - The error did occur because my input statistics file did not have any components for average and standard deviation. It seams to make a difference if the module is called directly with all parameters in the OSGeo Shell or in via a Python script that contains all parameters and the module call. Best, Sophie 2016-07-13 19:29 GMT+02:00 Guillaume Pasero <[email protected]>: > Hi, > > > - The *-classifier.libsvm.m *option should be supported, what OTB > version do you use in OSGeo4W ? > - The first error is a bit obscure, but the second one looks like a > problem with the input statistics. Does the statistics file contain 3 > components for average and standard deviation? > - I think both extensions .svm and .txt should work. > > Best, > Guillaume > > > On 07/05/2016 05:11 PM, [email protected] wrote: > > Hello, > > I would like to use orfeo for a libsvm oneclass classification. However, I > get error messages that don't really help to see my mistake. Maybe someone > encountered a similar error. > > Before I list my questions, I will explain what I did: > > 1. Generate training samples > - I created a polygone shapefile layer in QGIS and manually drew > polygons with class label 1 for the features, I would like to extract. > - result: Train_Samples_1Class.shp > 2. Compute image second order statistics > - *otbcli_ComputeImagesStatistics -il namibia_orthoimage.tif -out > namibia_orthoimage_statistics.xml* > 3. Train SVM classifier > - otbcli_TrainImagesClassifier -io.il namibia_orthoimage.tif -io.vd > Train_Samples_1Class.shp -io.imstat namibia_orthoimage_statistics.xml - > sample.mv 100 -sample.mt 100 -sample.vtr 0.5 -sample.vfn Class > -classifier libsvm -classifier.libsvm.k linear -classifier.libsvm.c 1 > *-classifier.libsvm.m > oneclass* -classifier.libsvm.opt 1 -io.out SVM_Model.txt > -io.confmatout SVM_ConfusionMatrix.csv > > - This gives the error "*could not find paramter m*" when run as a > Pyhton script in the OSGeo4W Shell and "*option > -classifier.libsvm.m does not exist in the application*" when > run directly as the command-line listed above. > - Therefore, I tried it without the oneclass option and created > training samples with two classes (1: feature to be detected, 0 for > all > remaining polygons --> result: Train_Samples.shp) and changed the > above > code as follows: > - *otbcli_TrainImagesClassifier -io.il <http://io.il> > namibia_orthoimage.tif -io.vd Train_Samples.shp -io.imstat > namibia_orthoimage_statistics.xml -sample.mv <http://sample.mv> 100 > -sample.mt <http://sample.mt> 100 -sample.vtr 0.5 -sample.vfn Class > -classifier libsvm -classifier.libsvm.k linear -classifier.libsvm.c 1 > -classifier.libsvm.opt 1 -io.out SVM_Model.txt -io.confmatout > SVM_ConfusionMatrix.csv* > - This gives the error "*Input primary is required but not set*" > (ErrorI attached), when run as a Pyhton script in the OSGeo4W Shell > and "*Inconsistent > measurement vector size: Input Sample List size 3 Scale measurement > vector > size 0 Shift measurement vector size 0*" (Error II) when run > directly as the command-line listed above. > - I also attached the Python script, I refer to, to make it > clearer. > - When I alternatively try to do train the SVM classifier via > the Orfeo GUI in QGIS, I don't get any output or error message. > > Questions: > > - How do I correctly use the oneclass SVM classifier? > - Where is my error for training the two class SVM classifier? > - Does the output model file need to be .svm or .txt? I found > different versions in > https://www.orfeo-toolbox.org//CookBook/CookBooksu39.html#x58-910003.4.1 > and in > https://www.orfeo-toolbox.org/CookBook/CookBooksu123.html#x154-9080004.8.10 > > > Thanks a lot! > > > Sophie > -- > -- > Check the OTB FAQ at > http://www.orfeo-toolbox.org/FAQ.html > > You received this message because you are subscribed to the Google > Groups "otb-users" group. > To post to this group, send email to [email protected] > To unsubscribe from this group, send email to > [email protected] > For more options, visit this group at > http://groups.google.com/group/otb-users?hl=en > --- > You received this message because you are subscribed to the Google Groups > "otb-users" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > For more options, visit https://groups.google.com/d/optout. > > > -- > <http://www.c-s.fr> *Guillaume PASERO* > Responsable technique > *Business Unit E-SPACE & Geo Information - Département Image & > Applications* > > *CS Systèmes d'Information* > Parc de la Grande Plaine - 5, Rue Brindejonc des Moulinais - BP 15872 > 31506 Toulouse Cedex 05 - FRANCE > +33 561 17 64 21 - [email protected] > > -- > -- > Check the OTB FAQ at > http://www.orfeo-toolbox.org/FAQ.html > > You received this message because you are subscribed to the Google > Groups "otb-users" group. > To post to this group, send email to [email protected] > To unsubscribe from this group, send email to > [email protected] > For more options, visit this group at > http://groups.google.com/group/otb-users?hl=en > --- > You received this message because you are subscribed to a topic in the > Google Groups "otb-users" group. > To unsubscribe from this topic, visit > https://groups.google.com/d/topic/otb-users/qNdqNJSKm34/unsubscribe. > To unsubscribe from this group and all its topics, send an email to > [email protected]. > For more options, visit https://groups.google.com/d/optout. > -- -- Check the OTB FAQ at http://www.orfeo-toolbox.org/FAQ.html You received this message because you are subscribed to the Google Groups "otb-users" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/otb-users?hl=en --- You received this message because you are subscribed to the Google Groups "otb-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
