OTB segmentation not working properly

Context

I am trying to do object based Land cover classification for that whenever I run the segmentation process even with different parameters the results is just a single polygon which is very strange.

Configuration setup

My system: Windows10, core i7
Version of the OTB:latest version available at website I guess 7.3
I installed the OTB with: the binaries, the Debian package management, the SuperBuild, other?

If relevant, you may also provide:
QGIS version: 3.18?
Python version: * 3.8?*

Description of my issue

I tried running the standalone mapla as well as the QGIS OTB plugin but the problem is there is no error but the result is very strange even when I use train image classifier with my training sights it takes so long around 2 hours but the result is just a blank no data tif image. I am using a sentinel 2 layer stack with 11,8,4,3,2 bands for classification.
Input parameters


The result is a single polygon covering whole image
Kindly help me in this regard as this is final semester project and I am running on time.
looking forward

Dear @HiraZafar,
Thank you for using OTB.

Did you try various values for the parameters? I don’t know the dynamic of your input image, but a range radius of 600 seems huge. For instance, in our examples, it is set to 80 for a quickbird image.

I hope it helps.
Julien.

yes I did tried it by giving very small range radius as well than i get a single polygon on the image.

@HiraZafar what is the dynamic of your input image ? If the values of your input image lie between 0 and 1 a range radius of 10 is still too much.

To reduce processing time you can try reducing the values of the Spatial radius and the minimum region size.

Cédric

Hi I’m having the same issue. Initially, segmentation of an ortho image was producing a proper vector file (many small segments), but something unknown had changed and the result I am getting is 4 large segments. I didn’t change any of the parameters, so I’m confused as to how this change occurred. I will post my log with images.

Algorithm started at: 2023-06-21T09:34:21

Algorithm ‘Segmentation’ starting…

Input parameters:

{ ‘in’ : ‘/Volumes/Drive/QGIS_Files/Personal_Projects/Project/MUL-of-2023-06-20T210559091Z-orthophoto.tif’, ‘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’ : ‘/Volumes/Drive/QGIS_Files/Personal_Projects/Project/Segmentation.shp’, ‘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 }

2023-06-21 09:34:21 (INFO) Segmentation: Default RAM limit for OTB is 256 MB
2023-06-21 09:34:21 (INFO) Segmentation: GDAL maximum cache size is 819 MB
2023-06-21 09:34:21 (INFO) Segmentation: OTB will use at most 4 threads
2023-06-21 09:34:21 (INFO): Loading metadata from official product
2023-06-21 09:34:21 (INFO) Segmentation: Use threaded Mean-shift segmentation.
2023-06-21 09:34:21 (INFO) Segmentation: Use 8 connected neighborhood.
2023-06-21 09:34:21 (INFO) Segmentation: Simplify the geometry.
2023-06-21 09:34:21 (INFO) Segmentation: Large scale segmentation mode which output vector data
2023-06-21 09:34:21 (INFO): Estimation will be performed in 9 blocks of 976x976 pixels
Computing meanshift segmentation: 100% [] (17s)
2023-06-21 09:34:38 (INFO) Segmentation: Stream size: [976, 976]
2023-06-21 09:34:38 (INFO) Segmentation: Segmentation done, stiching polygons …
Stitching polygons: 100% [
] (0s)
2023-06-21 09:34:39 (INFO) Segmentation: REPACK the Shapefile …
Execution completed in 17.64 seconds
Results:
{‘mode.vector.out’: ‘/Volumes/SSD/QGIS_Files/Personal_Projects/LDB_Home/Segmentation.shp’}
Loading resulting layers
Algorithm ‘Segmentation’ finished