Otb Meanshift Segmentation & shp output


I’m performing Mean Shift segmentation on a VNIR image (BSQ format - EPSG: 2154 ) using the application Segmentation (not using LargeScaleMeanShift) with Monteverdi (OTB 6.6.1) or python API (3.5). I asked for a vector output in shapefile format. In both cases, I have the same fatal error with the default parameters :

2019-02-22 10:29:20 (INFO): otbcli_Segmentation -in /media/data/3-MONTANE/class_species_Bachat/0_data/vnir_plot3 -mode vector -mode.vector.out /home/jean-baptiste/Bureau/tes_segm.shp -mode.vector.outmode ovw -mode.vector.layername layer -mode.vector.fieldname DN

2019-02-22 10:29:20 (FATAL): Image projection reference















The application is working properly choosing the raster output format. I do not understand what is wrong there. I need this workflow to take a mask into account.

Could You help me? Thank you.

OS: ubuntu 16.04


I never write this part.

Could you try without it?

Thank you for your suggestion.

The command line that I shared in my previous message is coming from monterverdi log. I tried your suggestion in command line (otbcli_Segmentation -in ./class_species_Bachat/0_data/vnir_plot3 -mode vector -mode.vector.out ./Bureau/tes_segm.shp) but it gave the same error. I also tested with another image using a different EPSG (WGS84) and it worked successfully. (Do I have to conclude that this problem has something to deal with the French EPSG 2154 ?).

The error message obtained with the command line gives more details (but nothing useful for me):
Application.logger (FATAL) The following error occurred during application execution : /build/otb-Y8aCHH/otb-6.0.0+dfsg/Modules/Applications/AppSegmentation/app/otbSegmentation.cxx:474:
itk::ERROR: Fatal error caught. Aborting…

Any idea ?

In the meantime, I am looking for a solution to segment the image by taking into account a non-forest mask. Is there an alternative to segmentation application with OTB?

Hmmm honestly, i have no clue. Seems something to be wrong with the installation?

The EPSG should not make much problems, although it could be. I once had the problem that a tool did not work with geographic coordinates and after projecting into UTM, it worked properly. Maybe you try that?

I think oldi is right. By looking at your error:


It indicates that you are using otb-6.0.0 whereas you seem to work with 6.6.1 (or the directory has nothing to do with the OTB version and it is another issue).
Can you make sure you are using the correct OTB (6.6.1) ?

On the mask subject you can use a mask in the segmentation application (-mode.vector.inmask) you can see the full documentation here: https://www.orfeo-toolbox.org/CookBook/Applications/app_Segmentation.html.

It seems that I’m effectively facing two kinds of problems.

I checked my installation of OTB and I confirmed that there is trouble regarding the version. Using otbcli_Segmentation in bash command, I’m obtaining this error “ERROR: Troubles loading parameter, please check your line argument…This is the Segmentation application, version 6.0.0” whereas 6.0.0 has never been installed on my PC. The bash command launched is a copy/paste of the one produced by Monteverdi(and otb 6.6.1).

Furthermore, I tested the segmentation with different image formats (.dat, .envi) and it works well. I conclude that the trouble encountered is coming from my data (VNIR images in BSQ format). The error occurs with mean shift and watershed algo. Does it exist restrictions regarding the image format?