course header LV-UAV-Guide | OBIA Workflow for QGIS step by step

Object-based image analysis (OBIA)

Human visual perception almost always outperforms computer image processing algorithms, For example, your brain knows a river when it sees one. But a computer can’t distinguish rivers from lakes, roads or sewage treatment plants.

Especially with the spatially extreme and spectrally minimal resolution UAV image data, a change in thinking must take place. It makes more sense to think in terms of objects or entities to be identified rather than classifying in terms of individual pixels. The basic principle of object-based image analysis (OBIA) is to segment first and then classify.

The segmentation process is algorithm-dependent but looks iteratively for similarities in space, structure and channel dimensions for grouping neighboring and similar pixels into objects. This segments are classified in a next step using supervised training data.

General Workflow

The example of OBIA classification is typical of the manual performance of such operations using a software package. It consists of the following steps:

  1. data acquisition (orthophoto, training data).
  2. generation of spatial segments on the basis of the
  3. extraction of suitable description parameters
  4. model training
  5. classification of the input data set.

In software-based processing, additional steps often have to be performed for technical reasons. Even more often, the processing of the individual steps is not necessarily linear, since intermediate results are used repeatedly in different steps. The following figure shows below step by step described process as a graphical model, which you can integrate in QGIS as a tool in the Processing Box.

OBIA classification Workflow for Orthoimages

OBIA classification Workflow for Orthoimages

For reference you may Download the basic data. In Addition you may download the upper OBIA-workflow as an QGIS-Model. You can add this to your QGIS project with pushing the first icon “Models” on the processing sidebar and choose Add Model to Toolbox. Please note that is running with fixed default values. For modifying it you need to right-click on the model and choose Edit Model.

Step by step tutorial

In the following step by step guide an OBIA approach with QGIS and the OTB Toolbox is carried out as an template example. There are many segmentation algorithms and integrated classification methods. The Mean-shift method used here and the subsequent training with Support Vector Machine is a robust and common method. Especially the extension of the feature space (here called Range Radius) and the search space (Spatial Radius) as well as the size of the segmented objects (Minimum Region size) is crucial for a satisfying result. The principle is transferable to the different forms of the OBIA and despite abundant literature and some good instructions it is a free empirical game.

Step-1 Create Training Sample Points by manual digitizing

If you need to learn how to digitize with QGIS you may follow this tutorial. However we will only digitize Points and not polygons.

Create a point vector file and digitize the following classes:

class CLASS_ID
water 1
meadows 2
meadows-rich 3
bare-soil-dry 4
crop 5
green-trees-shrubs 6
dead-wood 7
other 8

Provide at minimum 10 widely spread sampling points.

Save this file naming it sample.gpgk.

Step-2 Segmentation

In the search field of the Processing Toolbox type segmentation and double click Segmentation.


picture


Step-3 Feature extraction

Type zonalstats in the search field of the Processing Toolbox and open the tool ZonalStatistics. You find it under the image manipulation section of OTB.

picture


Step-4 Joining training data with segements

Type in the search field of the Processing Toolbox join and double click Join Attributes by Location.

picture


Step-5 Training

Type train in the search field of the Processing Toolbox and open TrainVectorClassifier

picture


Step-6 Classification

Type class in the search field of the Processing Toolbox and open VectorClassifier


picture picture


Result

You will see partly predominantly excellent classification. However, there are also significant misclassifications.