Land Cover/Use Classification using the Semi-Automatic Classification Plugin for QGIS
From AWF-Wiki
(Difference between revisions)
Line 24: | Line 24: | ||
==Defining classification inputs in SCP-plugin== | ==Defining classification inputs in SCP-plugin== | ||
− | We need to define input image, training input and spectral signature files for SCP. | + | We need to define '''input image''', '''training input''' and '''spectral signature files''' for SCP. |
# Open the {{button|text=SCP Dock}}. | # Open the {{button|text=SCP Dock}}. | ||
# Click {{mitem|text=SCP Dock --> SCP input --> Input image}}, use the button {{button|text=Refresh list}} [[Image:refresh list.PNG]] and the drop-down menu-bar to select the multiband ''Merge'' file (i.e. from DN to Reflectance conversion) as input image. | # Click {{mitem|text=SCP Dock --> SCP input --> Input image}}, use the button {{button|text=Refresh list}} [[Image:refresh list.PNG]] and the drop-down menu-bar to select the multiband ''Merge'' file (i.e. from DN to Reflectance conversion) as input image. | ||
Line 30: | Line 30: | ||
# Next, click {{button|text=Quick wavelength settings}} and select '''Sentinel-2''' from the list in order to automatically set the Center wavelength for each band and the Wavelength unit (NB. required for spectral signature assessment). | # Next, click {{button|text=Quick wavelength settings}} and select '''Sentinel-2''' from the list in order to automatically set the Center wavelength for each band and the Wavelength unit (NB. required for spectral signature assessment). | ||
# In the '''RGB list''' [[File:working_toolbar.PNG]] of the {{button|text=Working Toolbar}}, select '''3-2-1''' to display natural color composite. Also, type in '''5-3-2''' to display false color composite. While changing the color composite; also use the buttons {{button|text=cumulative_stretch}} [[Image:Cum_stretch.PNG]] and {{button|text=std_dev_stretch}} [[Image:Stdv_stretch.PNG]] for better displaying the Input image (i.e. image stretching). | # In the '''RGB list''' [[File:working_toolbar.PNG]] of the {{button|text=Working Toolbar}}, select '''3-2-1''' to display natural color composite. Also, type in '''5-3-2''' to display false color composite. While changing the color composite; also use the buttons {{button|text=cumulative_stretch}} [[Image:Cum_stretch.PNG]] and {{button|text=std_dev_stretch}} [[Image:Stdv_stretch.PNG]] for better displaying the Input image (i.e. image stretching). | ||
+ | # We need to define '''training input file''' in order to collect '''ROIs''' and '''spectral signatures'''. | ||
+ | # Click {{mitem|text=SCP Dock --> SCP input --> Training input}}, use the button {{button|text=Create a new training input}} [[Image:Training_input.PNG]] to create the '''training shapefile''', click {{button|text=save}}. | ||
+ | [[File:scp_dock.png]] [[File:scp_input.png]] | ||
+ | [[File:Quick_wavelength_settings.png]] | ||
+ | [[File:Natural_color.PNG]] [[File:False_color.PNG]] | ||
+ | |||
+ | ==Collection of ROIs and Spectral signatures== | ||
[[Category:QGIS Tutorial]] | [[Category:QGIS Tutorial]] |
Revision as of 12:53, 26 November 2017
Contents |
Working steps
Preparing raster data (Converting DN to reflectance)
- Load the multiband raster file Subset_S2A_MSIL2A_20170619T.tif available in the course data. This contains all 13 bands of Sentinel-2 scene.
- Follow Split stack to extract bands 2, 3, 4, 5, 6, 7, 8, 11 and 12, using the multiband raster file Subset_S2A_MSIL2A_20170619T.tif as input layer.
- In the processing toolbar, type Raster calculator into the search field to find the GDAL\OGR --> Raster calculator tool and open it.
- Click the button Run as batch process..., and use Add row button to add enough processing rows.
- Click the button ... of Input layer A to select the single extracted bands as input layers (i.e. one per row).
- Enter and repeat the expression A/10000 under Calculation in gdalnumeric syntax using +-/* or any numpy array functions (i.e. logical_and()) and set Output raster type to Float32
- Click the button ... of Calculated to save output file
- Click Run
- Follow Create stack to create a multiband raster file from the converted single bands from step 3 and load into QGIS canvas.
Install and set up SCP plugin
- Click Plugins --> Manage and Install Plugins.
- Type in the search bar semi-Automatic Classification, click on the plugin name and then on Install plugin.
- Right-click on the Plugin Toolbar and make sure the following are checked SCP Dock, SCP Edit Toolbar, SCP Tools and SCP Working Toolbar.
Defining classification inputs in SCP-plugin
We need to define input image, training input and spectral signature files for SCP.
- Open the SCP Dock.
- Click SCP Dock --> SCP input --> Input image, use the button Refresh list and the drop-down menu-bar to select the multiband Merge file (i.e. from DN to Reflectance conversion) as input image.
- Click the button Band set to further define the input image.
- Next, click Quick wavelength settings and select Sentinel-2 from the list in order to automatically set the Center wavelength for each band and the Wavelength unit (NB. required for spectral signature assessment).
- In the RGB list of the Working Toolbar, select 3-2-1 to display natural color composite. Also, type in 5-3-2 to display false color composite. While changing the color composite; also use the buttons cumulative_stretch and std_dev_stretch for better displaying the Input image (i.e. image stretching).
- We need to define training input file in order to collect ROIs and spectral signatures.
- Click SCP Dock --> SCP input --> Training input, use the button Create a new training input to create the training shapefile, click save.