1

I've tried the whole weekend to get the Orfeo Tool Box running in QGIS 2.18.19 (stand-alone version) and today I finally managed it by setting the paths to the bin-folder of the stand-alone version on Orfeo Toolbox 6.4.0. Now it finally shows the menu in the processing tool box and I thought, I finally made it work

BUT

I tried to execute the Unsupervised K-Means Image Classification and it failed, because the parameter for convergence threshold (-ct) doesn't exist in the application. So I ran the otbgui_KMeansClassification.bat in the OSGEO4W Shell and saw, that there really is no parameter for convergence threshold like it used to be in OTB 5.0.

Im not sure if I already made a mistake with how I got the OTB running in QGIS (my way feels kind of awkward and there might be an easier solution). But now Im completely clueless on how I can execute the Image classification.

Maybe somebody knows how to deal with this.

This is the log:

Algorithm Unsupervised KMeans image classification starting...
C:\Users\nasta\Downloads\OTB-6.4.0-Win64\bin\otbcli_KMeansClassification
-in
"C:/Users/nasta/Documents/Uni/Boku/Master/00_data/Sentinel_ARC/IMAGE_2016-09-13_33UXP_122_B02_10m_Id54562101_L2A.jp2"
-ram
128
-ts
100
-nc
5
-maxit
1000
-ct
0.0001
-out
"C:\Users\nasta\AppData\Local\Temp\processing1070d9dbfe9e434b8a708b490a3ff54a\541e075ec4dd496a9ae0f42076b9391e\out.tif"
-outmeans
"C:\Users\nasta\AppData\Local\Temp\processing1070d9dbfe9e434b8a708b490a3ff54a\ffb59a65eb5b424fb22276c3a7ef7046\outmeans.file"
ERROR: Parameter -ct does not exist in the application. 
Converting outputs
Loading resulting layers
The following layers were not correctly generated.
Output Image
You can check the log messages to find more information about the execution of the algorithm
0

Maybe the QGis descriptor isn't up to date with latest OTB release. A quick hack would consist in modifying it manually. Open your file browser, be sure to show hidden files and folders, and go to some path like

C:\OSGeo4W64\apps\qgis\python\plugins\processing\algs\otb\description\5.X.X

Inside this path, there is a lot of .xml files that describe OTB applications. In your case, you can edit the KMeansClassification.xml and remove the ct block parameter (Make a copy before editing!).

This should do the trick waiting for the update in QGIS/OTB.

  • That helped - even if the path was more complicated since I didnt install QGIS with OSGEO4W64 - so I had to look through the QGIS-folder in C:\Programs\... – Spuddeline May 16 '18 at 18:00

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.