Water Bodies Extraction Using Sentinel-2 Imagery

Posted by Mauricio Vidulin Wednesday, Oct 07, 2015
Venice

Sentinel-2 is a European wide-swath, high-resolution, multi-spectral imaging mission. At Amphinicy, we wanted to find out what we can do with Sentiel-2 images and how to use them. Here is what we have done :)

The Sentinels are a fleet of satellites designed specifically to deliver a wealth of data and imagery that are central to the European Commission’s Copernicus programme. Sentinel-2 carries a wide swath, high-resolution multispectral imager with 13 spectral bands for a new perspective of our land and vegetation. The mission is based on a constellation of two identical satellites in the same orbit, 180° apart for optimal coverage and data delivery. Together, they cover all Earth’s land surfaces, large islands, inland and coastal waters every five days at the equator. Sentinel-2A was launched on June 23rd, 2015 and Sentinel-2B should follow in the second half of 2016.

Sentinel-2 products available to users are split into three categories: Level-1B, Level-1C and Level-2A. These products are either generated by the ground segment or the Sentinel-2 toolbox. At the time of writing, only sample Level-1C products were available for download from the Sentinels Scientific Data Hub. Level-1C products are top of atmosphere reflectances in fixed cartographic geometry (combined UTM projection and WGS84 ellipsoid). Level-1C images are a set of tiles of 100 sq km, each of which is approximately 500 MB large. These products contain applied radiometric and geometric corrections (including orthorectification and spatial registration). For the exploitation of Sentinels’ products, ESA provides specially designed “Toolboxes”, one for each Sentinel mission. All toolboxes are also combined in the Sentinel Application Platform (SNAP).


To extract water bodies from Sentinel-2 imagery we used SNAP to convert Sentinel-2 products to GeoTIFF images and SAGA-GIS (www.saga-gis.org) for the extraction process. First, we loaded Sentinel-2 images (taken over Venice, Italy) in SNAP by using File → Import → Optical Sensors → Sentinel-2 → S2MSI-L1C and selecting an .xml file in the Sentinel-2 product folder (the one with the extension .SAFE). Next, module Raster → Data Conversion → Convert Datatype opened up a window with conversion options. After selecting the source product, adding a name for a new file and a target format (GeoTIFF), we switched to “Processing Parameters” tab. There we selected B2, B3 and B4 source bands that have a 10m resolution. Those are the bands we decided to use for water bodies extraction. When the conversion was done, SNAP showed an error but we assumed it was not that important because all .geotiff files were created nevertheless.

We switched to SAGA GIS and imported the raster file created in the previous step using GDAL/OGR module with the option “Select from multiple bands”. In the next window, we chose to use all bands, meaning that from 1 GeoTIFF file, SAGA will import three rasters (remember that we converted three bands in SNAP to one GeoTIFF file). It is a good idea to rename the imported rasters into “band_2”, “band_3” and “band_4”, respectively, so it’s clearer in further work what Sentinel-2 bands are actually used. Each band will be in greyscale when displayed, which makes harder for a human eye to detect objects on the image. To fix that, SAGA lets you create an RGB composite. We did that by selecting “band_4” and adjusting the settings like this:

Colors → Type = RGB Composite; This Color = Red; Green = band_3; Blue = band_2

To be able to perform image processing on our computers, we had to take only one relatively small portion of an image because processing the whole image would last too long or could even crash the program. We clipped the image by using Geoprocessing → Grid → Grid System → Clip grids [interactive] and then selecting the part of the image in which we were interested.

To extract features from the image, we decided to use Object Based Image Segmentation (OBIS) from the Toolchains module available in SAGA v2. OBIS generates segments grouped in classes based on pixel values (reflectances of objects on Earth). The Toolchains module is not loaded into SAGA with other modules by default. To load the module, you have to use Geoprocessing → Load Tool Library and select modules from /toolchains directory that should reside in SAGA-GIS directory under /modules. We installed SAGA using an executable file and toolchains modules were missing, so we downloaded the saga_2.2.0_win32.zip and extracted the toolchains from there.

Now, let’s get back to the actual work! After opening the dialog for OBIS, we selected a grid system (the one with clipped images),  features (all three bands/images) and set the number of clusters to 15. This setting means that the image will be segmented into a lot of small polygons that belong to 15 different classes/groups. After performing the segmentation a few times using a different number of clusters we decided that 15 clusters will give us a result that is good enough for testing purposes. From the RGB Composite image, it is obvious that the water color varies from something like green to blue which means that different parts of water areas reflect energy differently. We need to extract all water areas (green, blue, dark blue, etc.), so we need more classes for water to cover all variations. We also assumed that green water areas could be an issue for the result because it could coincide with some vegetated areas.

After segmentation had been finished, we identified the classes that represent the water and selected all the segments with those classes. For the selection of segments by the class attribute we used Geoprocessing → Shapes → Selection → Select By Attributes [Numerical expression module]. We copied the selected segments/polygons to a new “Shape Layer”. We also wanted to create one big polygon from all the small ones, so we used Geoprocessing → Shapes → Polygons → Polygon Dissolve with no options other than a layer with segments. Finally, we overlayed the RGB composite image of Venice with the water polygon layer and exported the polygon layer to ESRI shapefile. This way it could be used for calculating the area covered by water, as a mask or for other purposes.


In an overlayed image, it is visible that some areas are identified as water but are actually covered by grass or trees, which happens because some vegetated areas have similar spectral characteristics like the water in used bands. Maybe supervised classification and other band combinations would give a better result - I will most certainly try it once I get the time. Problems also occur because many of the Venice canals are too narrow to be visible to a remote sensing instrument that provides images with 10m resolution. Nevertheless, I believe the result is pretty good for experimental purposes like this one.

 

comments powered by Disqus

news / events / blogs