Portfolio

Open Source OBIA with Python

Authors: Candela Sol Pelliza & Rodrigo Brust Santos

Introduction

In the Remote Sensing domain, OBIA, standing for Object Based Image Analysis, is a technique that aims to recognize objects instead of pixels when analyzing an image. Starting from a satellite image, it allows grouping pixels into objects, according to parameters such as color and compactness, for a subsequent analysis and classification of these elements. It is a powerful approach, since it is feasible to utilize several images and bands, such as the regular RGB but also DEM and DSM, leading to more reliable classification, allowing multiscale and neighborhood approach, and avoiding salt-peper effect.

Objectives

The OBIA technique is usually applied through the use of specific domain software programs, which are pretty intuitive but proprietary and expensive. In this sense, the main objective of the project is building a python workflow that allows to perform the main OBIA functions, in order to classify objects in a satellite scene. While being a first, use-case based approach, the main highlight of the project is its simplicity and reproducibility, which allows other users to modify it and apply it to their own needs.
Starting from a multiband image (RGB + NIR) and a DSM with a 1m resolution, the project proposes a workflow that allows segmenting the image, classifying buildings, rows, trees and low vegetation based on the spectral properties and height and, finally, exporting these objects as a geojson file.

Workflow

To achieve the results, a series of steps were developed in python, using some well known geospatial and machine learning libraries, such as Rasterior, SciKitLearn, Numpy and Geopandas. These steps are described below:
1. Loading, processing and stacking the R, G, B, NIR and DSM bands.
2. Segmenting the image using scikit-image quickshift algorithm and adjusting the parameters.
3. Creating the functions for calculating and assigning the mean RGB, NDVI and height for each object.
4. Creating rules for assigning classes: 5 classes were created (buildings, roads, high vegetation, low vegetation & unclassified).
5. Export the classified objects and classes to a GeoJSON file.

Results

©2022 Candela Sol Pelliza. All rights reserved