I've been experimenting with the vector classification in OTB, but I'm not 
able to get any decent results... So I must be doing something wrong.

After trying quite some different approaches I now have the following:

1) I have a shape file with a test set of polygons
2) I calculated the mean pixel value for each polygon from satellite 
pictures from taken on three moments in the growing season with about 1 
month in between for the red and NIR channel
3) I normalized this mean pixel value to a value between 0 and 1 (instead 
of the Original values that were between 0 and 255)

When I use TrainVectorClassifier the model is created and the kappa value 
and confusion matrix are OK, but when I use VectorClassifier on the same 
data the predictions are useless.

I supposed the predictions should be the same as the results in the 
confusion matrix but that doesn't seem the case at all :-(? All polygons 
get the same prediction, which sometimes seems to change from one class to 
another but always the same everywhere. The confidence is the same 
everywhere as well.

I tried several things, with and without stats file, without normalizing 
the data, using OGRLayerClassifier but I don't get it working.

I tried exporting the shape file to .csv and doing the same excercise using 
SVM classification in the datamining tool Orange3 and this gives decent 
results as well...

I was using the GUI, but to be able to give a reproducable case I made a 
.bat file that reproduces it. These are the commands used: 

:: Create the model 
> call %OTB_HOME_BIN%\otbcli_TrainVectorClassifier.bat -io.vd 
> "%PROJECTLOCATION%\Perc_train_test.shp" -io.stats 
> "%PROJECTLOCATION%\Perc_train_test.xml" -io.out 
> "%PROJECTLOCATION_OUTPUT%\model.rd" -io.confmatout 
> "%PROJECTLOCATION_OUTPUT%\matrix.rd" -feat R1mean01 R2mean01 R3mean01 
> IR1mean01 IR2mean01 IR3mean01 -cfield class -classifier.libsvm.k rbf 
> -classifier.libsvm.prob true
>
>
> :: Do the classification on the same dataset
> call %OTB_HOME_BIN%\otbcli_VectorClassifier.bat -in 
> "%PROJECTLOCATION%\Perc_train_test.shp" -instat 
> "%PROJECTLOCATION%\Perc_train_test.xml" -model 
> "%PROJECTLOCATION_OUTPUT%\model.rd" -cfield predicted -feat R1mean01 
> R2mean01 R3mean01 IR1mean01 IR2mean01 IR3mean01 -confmap true -out 
> "%PROJECTLOCATION_OUTPUT%\Perc_train_test_prediction.shp"


In attachment you find the reproducable case, including test data and a 
.bat file. It shoul be runnable by:
1) Extracting the zip file to C:\temp 
2) Edit the .bat file and change the location of OTB_HOME_BIN to the 
location where it is on your computer

-- 
-- 
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.

Reply via email to