OTB output files not opening/saving

I am new to QGIS and OTB, and I am having issues with the segmentation tool. I am trying to use it with an RGB raster file—it appears to run without errors, but doesn’t seem to generate an output file. No file opens when I try to output a temporary file, and when I try to save it to a file it still doesn’t open and it doesn’t appear in the saved location. I tried using some other OTB tools as well, and ran into the same issue.

I am running OTB 2.12.99 on QGIS 3.30.2 on an Intel i5 Macbook Pro (Monterey 12.6). I had some trouble with the OTB installation and this is my first time using it, so perhaps there was a problem there.

I am assuming the problem is related to an incorrect path to ‘@rpath/libOTBCommandLine-8.1.1.dylib’ given the log. I initially downloaded OTB to my Desktop, but I moved it to ‘/Users/username/qgis/plugins’ so I don’t know why the program is still trying to access it in Desktop.

Any help is greatly appreciated!

LOG:
“”"
QGIS version: 3.30.2-'s-Hertogenbosch
QGIS code revision: 0992b53397
Qt version: 5.15.2
Python version: 3.9.5
GDAL version: 3.3.2
GEOS version: 3.9.1-CAPI-1.14.2
PROJ version: Rel. 8.1.1, September 1st, 2021
PDAL version: 2.3.0 (git-version: Release)

Algorithm started at: 2023-05-25T18:27:53
Algorithm ‘Segmentation’ starting…
Input parameters:
{ ‘in’ : ‘path_to_raster’, ‘filter’ : ‘meanshift’, ‘filter.meanshift.spatialr’ : 5, ‘filter.meanshift.ranger’ : 15, ‘filter.meanshift.thres’ : 0.1, ‘filter.meanshift.maxiter’ : 100, ‘filter.meanshift.minsize’ : None, ‘mode’ : ‘vector’, ‘mode.vector.out’ : ‘path_to_output_file’, ‘mode.vector.outmode’ : ‘ulco’, ‘mode.vector.inmask’ : None, ‘mode.vector.neighbor’ : True, ‘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 }

dyld[10081]: Library not loaded: ‘@rpath/libOTBCommandLine-8.1.1.dylib’
Referenced from: ‘/Users/username/qgis/plugins/OTB-8.1.1-Darwin64/bin/otbApplicationLauncherCommandLine’
Reason: tried: ‘/Users/username/Desktop/OTB-8.1.1-Darwin64/lib/libOTBCommandLine-8.1.1.dylib’ (no such file), ‘/Users/username/Desktop/OTB-8.1.1-Darwin64/lib/libOTBCommandLine-8.1.1.dylib’ (no such file), ‘/usr/local/lib/libOTBCommandLine-8.1.1.dylib’ (no such file), ‘/usr/lib/libOTBCommandLine-8.1.1.dylib’ (no such file)

Execution completed in 0.08 seconds
Results:
{‘mode.vector.out’: ‘path_to_output_file’}

Loading resulting layers
Algorithm ‘Segmentation’ finished
“”"

Hi,

When you run the .run that you downloaded, there is some tasks done in the background like rpath modifications and modification of paths in the otbenv.profile file. If you move your installation folder, the rpath will not be correct, as well as the otbenv.profile. You can try to modify only the otbenv.profile with the correct path, but i think the problem with rpath will continue appearing

The plugins folder of QGIS is reserved to plugins installed from QGIS, OTB is another program so I recommend installing it un /Users/username/otb for example, I don’t know if it can interfere with QGIS, as it already have an otb plugin provider. This remark is to make you understand the difference between the otb installation and the otb provider plugin which is a link from QGIS to your OTB Installation.

Let me know

I reinstalled OTB in the directory I wanted it in and it works now. Thank you so much for your help! I’m curious, though—how long do OTB processes such as segmentation typically take? I am finding that they are taking rather long (30+ mins). Is this usual for most computers or is it a consequence of my frail old computer?

Hello I am new to OTB and am having the same problem. However, I do not know how to change the directory that OTB is in. Currently I have it in my applications folder but it is giving me the same “file not found” message.

Hi @Kurtis

Did you keep the .run file that you used to install otb in your applications folder ? you can download it again on the orfeotoolbox website
To install it elsewhere, you can extract this .run (launch a terminal and go to the directory where the .run is) using this command :

./OTB-8.1.1-Darwin64.run --target /Users/yourUserName/NewPath

Then, you can run otbapps in this NewPath folder

Let me know if it works
Best regards