Segmentation not producing any output

Dear all,

I wondering if any of you can explain why I am not getting any entries in the shape file produced by the OTB segmentation algorithm. I have downloaded a set of Sentinel 2LA from the European Space Agency. Converted them for spectral reflectance using the SCP Semi Automated Classifer plugin and clipped them after conversion. The output of the algorithm is as follows:

The input file is the virtual band set - that was produced in SCP Semi-Automation Classification.

I am running the following Plugins and versions of QGIS:

QGIS version
3.32.0-Lima
QGIS code revision
311a8cb8a6
Qt version
5.15.3
Python version
3.9.5
GDAL/OGR version
3.7.0
PROJ version
9.2.1
EPSG Registry database version
v10.088 (2023-05-13)
GEOS version
3.11.2-CAPI-1.17.2
SQLite version
3.41.1
PDAL version
2.5.3
PostgreSQL client version
15.2
SpatiaLite version
5.0.1
QWT version
6.1.6
QScintilla2 version
2.13.1
OS version
Windows 10 Version 2009

Active Python plugins
opeNoise
2.0
pca4cd
23.2a
pluginbuilder3
3.2.1
SemiAutomaticClassificationPlugin
7.10.11
TomBio
3.4.2
ViewshedAnalysis
1.8
db_manager
0.1.20
MetaSearch
0.3.6
otbprovider
2.12.99
processing
2.12.99

I hope that someone can shed some light on what is happening and how to resolve.

Regards,
Alasdair

The attribute table of the Shapefile that is produced by the segmentation algorithm is as follows:

It shouldn’t be empty - is there any reason as to why it is empty? And how to resolve that error.

Hi Grant,

It seems that there are zero values in your Sentinel image stack. Have you checked that the image has the correct values and that it’s not made up entirely of zero values?
There are several things you can try:

  • Check your vrt on Qgis by checking its values
  • Use the GDAL tool ‘fill null values (nodata)’ to improve your image
  • Try segmentation only on an S2 L2A tiff image to see if it’s the vrt that’s blocking or the image itself.

It may be the process you have carried out on SCP that makes the image uninterpretable for the tool.

Kinds regards,
Adrien

It seems like you’re facing an issue with the Orfeo ToolBox (OTB) segmentation algorithm in QGIS. Here are a few suggestions to troubleshoot the problem:

  1. Check Algorithm Parameters:
  • Ensure that you have set the segmentation algorithm parameters correctly. This includes parameters such as scale, spatial radius, and spectral radius. Adjusting these parameters might affect the results.
  1. Review Input Data:
  • Double-check that the input data (virtual band set produced by SCP) is correctly formatted and has the expected values. You can use QGIS to inspect the raster values and see if they match your expectations.
  1. Test on a Subset:
  • Instead of processing the entire dataset, try running the segmentation algorithm on a smaller subset of the data. This can help identify if the issue is related to the algorithm itself or if it’s specific to the input data.
  1. Update OTB and QGIS:
  • Ensure that you are using the latest versions of both QGIS and the OTB plugin. Sometimes, updating to the latest version can resolve compatibility issues and bugs.
  1. Check OTB Logs:
  • Look for any error messages or warnings in the OTB logs. You can find these logs in the processing toolbox under “History” or “Log” depending on your QGIS version. Logs might provide insights into what went wrong.
  1. Consider External Factors:
  • Check if there are any issues with file permissions or access to temporary directories. Sometimes, external factors can affect the output of geospatial algorithms.
  1. Community Forums:
  • Consider posting your issue on QGIS or OTB forums or mailing lists. The community might have users who faced similar problems or developers who can provide assistance.
  1. Consult Documentation:
  • Refer to the documentation of both SCP and OTB for any known issues or special considerations when using them together.

If the issue persists after trying these steps, providing more specific details about the error messages or log entries could help in further troubleshooting. Additionally, reaching out to the QGIS or OTB community forums for assistance is a good idea.