/Aerial-Segmentation

Python script to segment rooftops in aerial imagery

Primary LanguageJupyter NotebookMIT LicenseMIT

Rooftop Detection Algorithm

MIT

Overview

This is the python code for detecting rooftops from Aerial RGBD (and IR if available) data using simple image processing techniques. It uses moderate computational resources and has low interface time for segmenting rooftops. Works best on elevation data generated from photogrammetry with around 5cm ground resolution. The two inputs are the RGB (ortho-photo) and the Digital Elevation Model (DEM) geotifs. IR band data may be additionally provided for using NDVI in removing tree canopies more accurately. The shape files for the roofs and clutter in roof are generated as output which can be opened in any GIS software like QGIS.

Reference

Kritik Soman. 2019. Rooftop Detection using Aerial Drone Imagery. In Proceedings of the ACM India Joint International Conference on Data Science and Management of Data (CoDS-COMAD '19). ACM, New York, NY, USA, 281-284. https://dlnext.acm.org/doi/abs/10.1145/3297001.3297041

Dependencies

cv2 
gdal
scipy
skimage
matplotlib
numpy
multiprocessing
osgeo

How to run on Colab?

[1] Download the repository zip and upload on Colab.
[2] Unzip using the command! unzip Rooftop-Segmentation.zip
[3] Open demo.ipynb, change directory using % cd Rooftop-Segmentation and run cells.

Result Screenshots

[1] Rooftop segmentation

Our Dataset ISPRS Potsdam Dataset
image1 image2

[2] Clutter and Rooftop segmentation

DEM consisting of rooftops Ortho-photo of rooftops The detected rooftops along with clutter
image1 image2 image3

[3] DEM Segmentation
image4

[4] Rooftop segmentation when roof is covered with grass

Ortho-photo Segmented rooftops
image1 image2

Poster

Project Poster

Note

This code was tested with following version of packages:

cv2 3.3.0
gdal 2.1.3                    
scipy 0.19.1  
skimage 0.13.0  
matplotlib 2.1.1   
numpy 1.13.3