Segmentation and Classification

The Sentinel-2 release notes says segmentation tools are available but I don’t see this anywhere.

I see new tools for S-1 but not a lot for S-2


I too think this is really needed.

A set of new Tools will be made available as external tools (ie. you will need to install the Orpheo Toolbox as well) with an update centre. We didn’t publish the address yet as there are still some problems but as soon as it is OK we will publish the update centre address in the forum. These features should not have bee in these release notes.

Is there a date when these tools will be available? Is there any difference to just using Orfeo in QGIS?

Sorry for the late replay Elena. We’re planning to make these tools available for beta-testers by the 20th of May.

Any update on these tools?

Yes the tools are available, see this post: Beta OTB Adapters available

1 Like

excellent - thanks Nicolas

Segmentation is now available in Raster > Segmentation

By now it creates raster patches as segments in kind of a tiling mechanism. But each of them has an own value. Unfortunately, no vector is created, which would be very helpful. Has anyone a suggestion on how to proceed with these patches in SNAP, for example for spatial statistics of the objects?

Hello Andreas.

First of all, the threshold you’ve used is too small. Please try using values > 1000. This is not too well documented, but it represents some sort of distance (the smaller it is the more - and I mean much more - segments will be created).
Unlike other segmentation algorithms, this one can be used tile-based, after which a merging of results take place.
As in the case of the original implementation (in OTB), it produces only a raster with the segments, and not vectors.
I think that, for a future release, maybe we can put an option for the output format: raster or vector.
For now, I don’t think there is a vectorization operator in SNAP.



thanks Cosmin for the explanation! I already wondered about the meaning of the threshold and thought it would maybe relate to the spectral difference of the pixels. So I’ll try a larger one.
I think working on with the raster segments outside SNAP is just fine because many operations (spatial statistics or rule-sets) are not supported in SNAP either so this step has to be taken anyway.

However, I found that the geolocation information is lost after the segmentation process. Can it be restored somehow?

As you see in the screenshot, product 1 and 2 are visible, product 3 is not even in the world map.

Actually the GRM operator should preserve as far as I know it is already fixed but the update is not yet released.
As a workaround you can generate latitude and longitude bands and attach them as pixel based GeoCoding.
As expression use ‘$2.LAT’ and ‘$2.LON’, ensure to disable the virtual option in the Band Maths dialog. The new bands can then be used in Tools -> Attach Pixel Geo-Coding


thank you for the hint!