Mean shift segmentation ignoring mask OTB QGIS
Mantis Issue 1445, reported by sdinot, assigned to gpasero, created: 2017-08-01
I'm trying to segment a 3 band image using the meanshift segmentation tool of OTB in QGIS, activating the mask option. Nevertheless, the tool segments the whole image, apparently ignoring the mask. Does anyone knows why? Is there something wrong in the source files or the formats?
The details of the data are:
Base image: GeoTiff 3 band satellite image of Sentinel 2 program. Float32. 954x1337. WGS84 UTM Zone 30N. 14,60 MB. The original satellite image was downloaded and its bands separated using the OTB tool in QGIS "Split Image". The 3 bands of interest were concatenated with "Image concatenation" of the OTB tool in QGIS.
Mask raster: GeoTiff with 1 band. Float 32. 954x1337. WGS84 UTM Zone 30N. 4.87 MB. The mask has been created as follows: Using the segmentation of the whole image (the one that works fine), a vector layer was created, dissolving the polygons of interest in one big polygon (Until this point everything in QGIS). That vector layer was rasterized in ArcGIS, then reclassified to have only values of 10 and -99. Finally, that raster was transformed from the original int8 format to float32 using the Float tool in the 3D Analyst in ArcGIS.
Segmentation parameters: Meanshift segmentation of OTB in QGIS. All parameters set to default. Mask image loaded the previously described file. Tiles size: 2048 (I increased the memory in case that could be the problem but no).
I'm running QGIS 2.18.9. GDAL/OGR 2.2.0, on x64 Windows 10 Pro. Processor Intel Core i7-4790 K 4 GHz. 32 GB Ram.
1502985512 - gpaseroReproduced on my laptop without QGIS. It is due to the mask having negative values. You can try with positive mask values, it should work.
I am preparing a patch.
1503046918 - gpaseroFixed in develop : https://git.orfeo-toolbox.org/otb.git/commit/d2a6d12a6b141cb0a3a8c989cd74e8665582052a