Difference between revisions of "Supervised classification in QGIS"

From CUOSGwiki
Jump to navigationJump to search
Line 33: Line 33:
 
===Clip the Data===
 
===Clip the Data===
 
For a basic classification the area covered by the picture is very big. Therefore, we can clip the data and only work with a part of the picture. Navigate to the '''SCP''' button at the top of the user surface, under '''Preprocessing''' you find '''clip multiple Raster'''. Your surface should look similar like in the picture below. Choose Band set 1 which you defined in the previous step.
 
For a basic classification the area covered by the picture is very big. Therefore, we can clip the data and only work with a part of the picture. Navigate to the '''SCP''' button at the top of the user surface, under '''Preprocessing''' you find '''clip multiple Raster'''. Your surface should look similar like in the picture below. Choose Band set 1 which you defined in the previous step.
  +
   
 
[[File:UserSurface_Clip.JPG|700px]]
 
[[File:UserSurface_Clip.JPG|700px]]
  +
   
 
To clip the data press the orange button with the plus. Minimize the SCP window and you can now define the area you want to work with while clicking with the right button on your mouse. I suggest to define an area south of the mountains to avoid dealing with mountain shadows in the classification. In addition in the south of the pictures there are no clouds. For instance, like this:
 
To clip the data press the orange button with the plus. Minimize the SCP window and you can now define the area you want to work with while clicking with the right button on your mouse. I suggest to define an area south of the mountains to avoid dealing with mountain shadows in the classification. In addition in the south of the pictures there are no clouds. For instance, like this:
  +
   
 
[[File:Clip_LakeGarda.JPG|400px]]
 
[[File:Clip_LakeGarda.JPG|400px]]
  +
   
 
After defining the section under coordinate there should occur be numbers. Click run and define an output folder. I the Layer Dock, for each Band (1-9,11,12) a separate Raster Layer, which is resized, occurs.
 
After defining the section under coordinate there should occur be numbers. Click run and define an output folder. I the Layer Dock, for each Band (1-9,11,12) a separate Raster Layer, which is resized, occurs.
Line 44: Line 48:
 
===Automatic Conversion to Surface Reflection===
 
===Automatic Conversion to Surface Reflection===
 
Lastly, you must run a atmospheric correction. Go to '''SCP, Preprocessing, Sentinel-2''' and choose the directory where you saved you clipped data. Check '''Apply DOS1 atmospheric correction''' and uncheck '''only to blue and green bands''' likely in the sample picture. Since a new band set is needed, it is useful to check '''Create band set'''. The solar radiance should be recognized automatically. Click run and define an output folder.
 
Lastly, you must run a atmospheric correction. Go to '''SCP, Preprocessing, Sentinel-2''' and choose the directory where you saved you clipped data. Check '''Apply DOS1 atmospheric correction''' and uncheck '''only to blue and green bands''' likely in the sample picture. Since a new band set is needed, it is useful to check '''Create band set'''. The solar radiance should be recognized automatically. Click run and define an output folder.
  +
   
 
[[File:Conversion.JPG|700px]]
 
[[File:Conversion.JPG|700px]]

Revision as of 14:27, 22 November 2018

Purpose

Every day thousands of satellite images are taken. To work with these images they need to be processed, e.g. they need to be classified. Since Remote Sensing software can be very expensive this tutorial should provide an open-source alternative: the Semi-automatic-classification plugin (SCP) in QGIS. You can already find a tutorial about the SCP here [1]. With this tutorial you can extend your ability to use the SCP while running through a supervised land-cover classification.

Introduction

Land-cover classification classifies every pixel to a defined class using the spectral signatures. To define the classes region of interests (ROI) must be set.

Installing the Software and SCP

To start the tutorial you have to download the latest version of QGIS which is QGIS 3.4.1. "Bonn" and can be found here[2]. Make sure to download the proper version for your PC (34bit vs. 64bit). After installing the software the the Semi-automatic classification Plugin must be installed into QGIS. Navigate to the menu at the top to Plugin and select Manage and Install Plugins. Following the picture, the SCP can be found while typing "semi" in the search bar. Click install plugin and now you should be able to see the SCP Dock at the right or left side of your user surface.

SCP.jpg

Obtaining the Data

In this Tutorial, Sentinel-2 Data from the south of Lake Garda, Italy is used to run the classification. The data can be downloaded from the USGS Earth Explorer website here[3]. You can found a explanation how to download data from the Earth Explorer in the Tutorial Remote Sensing Analysis in QGIS. To find the same picture as used in this tutorial search for Lake Garda and select the time period from August to October 2018. Among Data Sets select Sentinel-2 and you should find the following picture:

Sentinel-2image.JPG

ID: L1C_T32TPR_A008056_20180921T101647 Date: 21st of September 2018.

Unpack the Data

The downloaded data is packed in a zip-File. Therefore, you have to unzip the Data before working with it. Afterwards you can find the image data in your home directory under GRANULE → L1C_T32TPR_A008056_20180921T101647 → IMG_DATA. For each band of the satellite Data you can find a separate JPEG file.

Preprocessing the Data

Before starting the classification some some steps must be done before.

Load the Data into QGIS

To load the Data into QGIS navigate to Layer at the top your user surface. Choose Add Layer, and then Add Raster Layer.... You should see the Data Source Manager now. Leave "File" selected like it is in default. Under Datasets you can navigate to the directory described above where you find the imageries. Make sure to load all JPEG files into QGIS except the file of band 10: T32TPR_20180921T101019_B10. Band 10 is the Cirrus band and not useful for this approach.

Creating an Band set

The next step is to create a band set. Navigate to the SCP button at the top of the user surface and select Band set. Under Multiband image list you can load the images into SCP and then into the Band Set 1. Make sure the layers are in the right order and select Sentinel-2 under Quick wavelength units. The picture below should help to understand these steps.

CreateBandSet.JPG

Clip the Data

For a basic classification the area covered by the picture is very big. Therefore, we can clip the data and only work with a part of the picture. Navigate to the SCP button at the top of the user surface, under Preprocessing you find clip multiple Raster. Your surface should look similar like in the picture below. Choose Band set 1 which you defined in the previous step.


UserSurface Clip.JPG


To clip the data press the orange button with the plus. Minimize the SCP window and you can now define the area you want to work with while clicking with the right button on your mouse. I suggest to define an area south of the mountains to avoid dealing with mountain shadows in the classification. In addition in the south of the pictures there are no clouds. For instance, like this:


Clip LakeGarda.JPG


After defining the section under coordinate there should occur be numbers. Click run and define an output folder. I the Layer Dock, for each Band (1-9,11,12) a separate Raster Layer, which is resized, occurs.

Automatic Conversion to Surface Reflection

Lastly, you must run a atmospheric correction. Go to SCP, Preprocessing, Sentinel-2 and choose the directory where you saved you clipped data. Check Apply DOS1 atmospheric correction and uncheck only to blue and green bands likely in the sample picture. Since a new band set is needed, it is useful to check Create band set. The solar radiance should be recognized automatically. Click run and define an output folder.


Conversion.JPG