Segmentation - Error Vector Output | No value associated to parameter -mode.vector.layername

Hello to all,
already many thanks for the help!

Unfortunately I have a problem with the OTB segmentation.
I wanted to segment a section of a S2 tile as a test. I have used the different default settings of the algorithm. But I always get the error that my vector output is not valid.

ERROR: No value associated to parameter -mode.vector.layername.
Execution completed after 0.11 seconds
Results:
{‘mode.vector.out’: ‘D:/Documents/Study/Geography_Master/05_Masterarbeit/test.shp’}

Load result layer
Algorithm ‘Segmentation’ finished

QGIS version: 3.16.2-Hanover
QGIS code version: f1660f9da5
Qt version: 5.11.2
GDAL version: 3.1.4
GEOS-Version: 3.8.1-CAPI-1.13.3
PROJ version: Rel. 6.3.2, May 1st, 2020

Thanks a lot!

Dear @chgruber,

Thank you for using OTB, and sorry for the error you are facing.

Do you mind sharing with us the input parameters you used? It could be a screenshot of the QGIS window, or a copy from the logs.

Sincerely.
Julien.

Thank you very much for your help.

According to my first tests, the problem is with the latest QGIS version 3.16.2 - in a test on another computer with an older QGIS version (3.10) and the same OTB 7.2 version it worked.
I also get the error only when outputting a vector file. The mord.raster.out works without problems (see log.)

Segmentation vector

QGIS-Version: 3.16.2-Hannover
QGIS-Codeversion: f1660f9da5
Qt-Version: 5.11.2
GDAL-Version: 3.1.4
GEOS-Version: 3.8.1-CAPI-1.13.3
PROJ-Version: Rel. 6.3.2, May 1st, 2020
Verarbeite Algorithmus…
Algorithmus Segmentation startet…
Eingabeparameter:
{ ‘in’ : ‘F:/gwa_s2_test/S2A_MSIL2A_20161212T100412_N9999_R122_T32SPE_20201103T174738/T32SPE_20161212T100412_B07_20m.jp2’, ‘filter’ : ‘meanshift’, ‘filter.meanshift.spatialr’ : 5, ‘filter.meanshift.ranger’ : 15, ‘filter.meanshift.thres’ : 0.1, ‘filter.meanshift.maxiter’ : 100, ‘filter.meanshift.minsize’ : 100, ‘mode’ : ‘vector’, ‘mode.vector.out’ : ‘F:/gwa_s2_test/test_segmentation.shp’, ‘mode.vector.outmode’ : ‘ulco’, ‘mode.vector.inmask’ : None, ‘mode.vector.neighbor’ : False, ‘mode.vector.stitch’ : True, ‘mode.vector.minsize’ : 1, ‘mode.vector.simplify’ : 0.1, ‘mode.vector.layername’ : ‘’, ‘mode.vector.fieldname’ : ‘’, ‘mode.vector.tilesize’ : 1024, ‘mode.vector.startlabel’ : 1, ‘mode.vector.ogroptions’ : ‘’, ‘outputpixeltype’ : 5 }

ERROR: No value associated to parameter -mode.vector.layername.
Ausführung nach 0.17 Sekunden abgeschlossen
Ergebnisse:
{‘mode.vector.out’: ‘F:/gwa_s2_test/test_segmentation.shp’}

Lade Ergebnis Layer
Algorithmus ‘Segmentation’ beendet

Segmentation raster output

Lade Ergebnis Layer
Algorithmus ‘Segmentation’ beendet
QGIS-Version: 3.16.2-Hannover
QGIS-Codeversion: f1660f9da5
Qt-Version: 5.11.2
GDAL-Version: 3.1.4
GEOS-Version: 3.8.1-CAPI-1.13.3
PROJ-Version: Rel. 6.3.2, May 1st, 2020
Verarbeite Algorithmus…
Algorithmus Segmentation startet…
Eingabeparameter:
{ ‘in’ : ‘F:/gwa_s2_test/S2A_MSIL2A_20161212T100412_N9999_R122_T32SPE_20201103T174738/T32SPE_20161212T100412_B07_20m.jp2’, ‘filter’ : ‘meanshift’, ‘filter.meanshift.spatialr’ : 5, ‘filter.meanshift.ranger’ : 15, ‘filter.meanshift.thres’ : 0.1, ‘filter.meanshift.maxiter’ : 100, ‘filter.meanshift.minsize’ : 100, ‘mode’ : ‘raster’, ‘mode.raster.out’ : ‘F:/gwa_s2_test/test_raster.tif’, ‘outputpixeltype’ : 5 }

2021-01-11 09:22:59 (INFO) Segmentation: Default RAM limit for OTB is 256 MB
2021-01-11 09:22:59 (INFO) Segmentation: GDAL maximum cache size is 803 MB
2021-01-11 09:22:59 (INFO) Segmentation: OTB will use at most 4 threads
2021-01-11 09:23:01 (INFO) Segmentation: Use threaded Mean-shift segmentation.
2021-01-11 09:23:01 (INFO) Segmentation: Segmentation mode which output label image.
2021-01-11 09:35:54 (INFO): Estimated memory for full processing: 574.839MB (avail.: 256 MB), optimal image partitioning: 3 blocks
2021-01-11 09:35:54 (INFO): File F:/gwa_s2_test/test_raster.tif will be written in 4 blocks of 3200x3200 pixels
Ausführung nach 786.33 Sekunden abgeschlossen
Ergebnisse:
{‘mode.raster.out’: ‘F:/gwa_s2_test/test_raster.tif’}

Lade Ergebnis Layer
Algorithmus ‘Segmentation’ beendet

Dear @chgruber,

I managed to reproduce your error. I noticed the bug occurs with the last version of QGIS (3.16.2), but not with the previous version. It turns out that the QGIS plugin was modified in the last QGIS release, introducing this regression. I will open an issue and see how to fix it for the next release.

In the mean time, you can still use the OTB applications from QGIS, by providing a value to the bugged parameters:

  • Layer Name (default is “layer”)
  • Geometry index field name (default is “DN”)
  • OGR options for layer creation (to change nothing, you can set “SPATIAL_INDEX=NO”)

You could also use the application from the command line interface.

I hope it helps.
Sincerely.
Julien :slight_smile:

1 Like

Thanks for the quick help!

Best regards,
Christian

Dear @chgruber,

The problem was fixed in QGIS, and will be available in the future release (3.16.3).

Sincerely.
Julien.