Skip to content

A course to perform a image classification of Sentinel-2 data in QGIS via the Semi-Classification Plugin

Notifications You must be signed in to change notification settings

GeowazM/Remote_Sensing_in_QGIS

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

94 Commits
 
 
 
 
 
 

Repository files navigation

Remote Sensing in QGIS

An introduction to work with remote sensing data in QGIS.
We are using the Semi-Automatic Classification Plugin.

Skills needed

Technical requirments

  • QGIS 3.10 or higher
  • Account for the Copernicus Open Access Hub
    • If you need an account you can register here                                                            Copernicus Open Access Hub logo


 

Hint: To ease the installation of the requirements use ANACONDA.
  Create an environment i.e. with the name rs4gis and install

Here you can find two tutorials to install the software Anaconda



Our goal for today

Using GIS and Remote Sensing tools to proof why the World Heritage Site Abu Mena is in Danger

Background knowledge: To be part of the World Heritage List, sites must be of outstanding universal value. The List of World Heritage in Danger is designed to inform the international community of conditions which threaten the very characteristics for which a property was inscribed on the World Heritage List, and to encourage corrective action.

Logo-UNESCO-WHL

The steps to achieve our goal

  1. Install the Semi-Automatic Classification Plugin for QGIS
  2. Download Sentinel-2 data
  3. Preprocess the Sentinel-2 data
  4. Calculate NDVI & NDWI
  5. Perform an image classification

What is the Semi-Automatic Classification Plugin?

The Semi-Automatic Classification Plugin (SCP) is a free open source plugin for QGIS that allows supervised classifications of remote sensing data and offer functionalities to download, pre- and postprocesss imagery.

The overall objective of SCP is to provide a set of functions for raster processing to enable an automatic workflow and ease generation of land cover classifications, especially for beginners of remote sensing methods (Congedo Luca 2020).


Intro to SCP
 

Search and download is available for ASTER, GOES, Landsat, MODIS, Sentinel-1, Sentinel-2, and Sentinel-3 images. Several algorithms are available for the land cover classification. The SCP requires the installation of GDAL, OGR, Numpy, SciPy and Matplotlib. Some tools i.e. the Random Forest classifier require also the installation of ESA's SNAP (Congedo 2020).

If you want to have more detail read:

Congedo Luca (2020). Semi-Automatic Classification Plugin Documentation. DOI: http://dx.doi.org/10.13140/RG.2.2.25480.65286/1

Or have a look on the SCP website

The steps to achieve our goal

  1. Install the Semi-Automatic Classification Plugin for QGIS
  2. Download Sentinel-2 data
  3. Preprocess the Sentinel-2 data
  4. Calculate NDVI & NDWI
  5. Perform an image classification

1. Install the Semi-Automatic Classification Plugin (SCP)


Open this video in a new tab (30 sec) and follow the instructions to install the SCP plugin.

Install SCP



2. Download Sentinel-2 data

  • After installing the SCP take care that the plugin is activated.    Plugin activated
  • Start to open the Download products tab of the SCP with    SCP download button
The Download products tab have 3 subtabs:
  • I. Login data
  • II. Search
  • III. Download options

Let's start with the I. Login data tab

SCP download tab login button
Login Sentinels
Service: https://scihub.copernicus.eu/apihub
User & Passwor: Your personal account

Now we continue with II. Search tab

SCP download tab search button

  • Select a "Product"
  • Set a "Date from"
  • Define "Max cloud cover"
  • Set an rectangular area of interest with   SCP aoi button
    • left-hand click = upper left corner
    • rigth-hand click = lower rigth corner

Hint: Select an appropriate Sentinel-2 scene i.e. the Abu Mena image from 6 April 2021

With tab III. Download options we are able to download the data directly in QGIS

SCP download options button

  • the check boxes of all Sentinel-2 bands need to be activated

Here you can find a video tutorial (5 min). Open this video in a new tab.
Download Sentinel-2 data via SCP



3. Create band set & clip the scene

Create band set

Open the band set window with   SCP band stack button

To update the Single band list click on   SCP update button
Now the layers of the QGIS project are visible in the Single band list
Highligth the Sentinel-2 bands and add it to the Band set definition with   SCP add button

  • The Band set 1 now includes the Senintel-2 bands.
  • Set the correct satellite setting to the band list via Wavelength quick settings
  • To create a band set check the "Create raster of bands (stack bands)" option within the Band set tools

Clip band set

Here you can find a video tutorial (1 min) to clip a band set. Open this video in a new tab.
clip Sentinel-2 data


After preprocessing your data can look like these examples:
Sentinel-2 true colour composite (left) & false colour composite (rigth)


4. Calculate NDVI & NDWI


The Normalized Difference Vegetation Index (NDVI) is an indicator of healthy vegetation and thus closely linked to vegetation density and productivity (Tucker & Sellers 1986). The NDVI is calculated using the spectral reflectance measurements of the red and infrared (NIR) wavelength and can range from -1 to +1.

NDVI = ( NIR – red ) / ( NIR + red )


The Normalized Difference Water Index (NDWI) is sensitive to the water content of vegetation and is similar to the NDVI. High NDWI values indicate a high water content of the vegetation. (Gao, B.C., Remote Sensing of the Environment, p.257(1996)). For Sentinel-2 data the NDWI needs Band 8 (NIR) and Band 12 (MIR). or the The NDWI results from the following equation:

NDWI = ( NIR - MIR ) / ( NIR + MIR )


To calculate a spectral index with the SCP use the   SCP band calculator button

To update the Band list click on   SCP update button

  • With double click you can add a band to the expression field
  • On the lower rigth side are the operators, i.e. +
  • Set the Extent to Same as one of the used bands
  • Use the formula above to calculate the NDVI & NDWI

After preprocessing your data can look like these examples:
Sentinel-2 NDVI (left) & NDWI (rigth)

Have a look on the whole Sentinel-2 scene. What show us the NDVI?


Are there differences of the NDVI & NDWI?


Have a look on Abu Mena. Can you explain the difference between the two spectral indices?




5. Perform a classification

The SCP offers a set of useful tools during the classification process, i.e. the preview.

The video below will show you how to classify a satellite image. This includes:

  • Create training data
  • Show spectral signature
  • Preview the classification and compare different classifiers
  • Classify the image
Here you can find a video tutorial (5 min). Open this video in a new tab.
Classify Sentinel-2 scene via SCP


Which classes show the highest errors or rather are difficult to distinguish?

Hint: Use the spectral signature graph

Which classes show a wide range of values?





rgeo Heidelberg University of Education

About

A course to perform a image classification of Sentinel-2 data in QGIS via the Semi-Classification Plugin

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published