In order to prepare the next round of sampling training sites, this worksheet covers the image segmentation. The segments can subsequently be used for object-oriented classification or for the (better?) sampling of training sites.
After completing this worksheet you should be able to perform some image segmentation using a multi-step workflow.
GIS — most commercial or open source GIS systems will be fine. For open source software running on Ubuntu Linux, the Ubuntu GIS package is a good choice. For Windows, it will be a good choice installing everything via the OSGeo4W environment and not individually. Actually both repositories make available a comprehensive bundle of GI -tools and software packages. We will focus on GRASS, QGIS and SAGA. On the commercial side, ArcGIS is one of the powerful options.
OTB — The Orfeo ToolBox is a quite handy open source suite for remote sensing tasks. While it can directly be used through a programming API e.g. using Python, it can also be integrated into QGis (processing plugin has to be installed) or run as a stand alone GUI called Monteverdi2. Please refer to the actual download options to select the installation of your choice.
The major problem of image segmentation is generally related to the question which spatial and spectral range to choose in order to retrieve an appropriate generalization of image features (i.e. segments). Another thing is that if different e.g. bands are used, scaling becomes an issue since - in general - the spectral range can only be defined globally for the entire dataset.
In the following, you should follow the approach from the OTB's exact large-scale mean-shift segmentation approach, a four step procedure which is described here (step 1) and from here onward (step 2 to 4).
As always, please add these entries to your today's learning log in the beginning of your Rmd file you will use to push to your GitHub classroom.
As today's special, please complete the following assignment:
Please compute an image segmentation on the above dataset following OTB's cookbook procedure. The segmentation should generalize the features reasonably well. Since some iteration is required, you should call the respective OTB routines from an R script. To ease things a little, you can use the respective functions from the satelliteTools package provided above (see tip below). In order to minimize computational efforts to a certain degree, it is sufficient if you use
Please have a look at the different output files and decide which one might work best for your upcoming task (selecting training sites, maybe aggregating image classification results).
Please update (i.e. commit) your R script publish (i.e. push) it to the GitHub classroom.
If you want to install a package directly from GitHub, type:
There is a bug in OTB version 5.0 (i.e. the one currently available via OSGeo4W). Therefore, download the latest OTB release, extract it in a folder of your choice and call the
satelliteTools::initOTB function with the path to the “bin” folder within the extracted OTB folder.