Talk:Land Cover/Use Classification using the Semi-Automatic Classification Plugin for QGIS

From AWF-Wiki
Jump to: navigation, search

Accuracy Assessment

Automatic multiple ROI creation

  1. Repeat the steps under Defining classification inputs in SCP-plugin to create a new training input file (this will be the validation dataset). Use Subset_S2A_MSIL2A_20170619T_MUL_BOA.tif as input image
  2. Click SCP --> Tools --> Multiple ROI creation to set parameters for ROI creation using random points.
  3. Assuming we want to create 50 ROIs with a minimum distance of 500 map units from each other (to avoid overlaps), set Number of points to 50 Number of points.PNG, min distance to 200 and change the default ROI pixel size to Min 10 and Max 30). Set the Dist parameter to 0.03
  4. Since we are not interested in ROI signatures, uncheck Calculate sig. , click Create points. and at the bottom right corner of the window and click the button Output button.PNG to create multiple random ROIs.

Random roi creation.PNG


Photo-interpretation of ROIs

The created ROIs will appear under ROI Signature list in the Creation Dock. Observe that all created ROIs have the same class information (i.e. MC_ID, MC_Info, C_ID and C_Info). Thus we need to assign the correct class to each ROI. This will be done by photo-interpretation with the aid of different color composites (to identifiy different features) and high resolution Google satellite scenes (for this purpose, install OpenLayers plugin).

  1. Click Web --> OpenLayers plugin --> Google Maps --> Google Satellite to open Google satellite scene in QGIS.
  2. In the Layer panel drag the Google satellite scene to overlay the Subset_S2A_MSIL2A_20170619T_MUL_BOA.tif image.
  3. Double-click the first ROI under ROI Signature list to zoom in to the ROI.
  4. Open Properties --> Transparency and adjust the transparency of the Subset_S2A_MSIL2A_20170619T_MUL_BOA.tif image to view the Google satellite scene and correctly assign ROI class information (i.e. MC_ID, MC_Info, C_ID and C_Info).
  5. Repeat steps 3 and 4 to assign the correct class information for each ROI.

NB: Class information for the validation data must be in conformity with the classification scheme in the training dataset.


To be updated for QGIS 3

  • For these tasks you may also use one processing toolbox model.

Qgis convert boa model.png

  • Open the Processing --> Toolbox and Models --> Tools --> Add model from file. Load the previously downloaded model.
  • The model should appear in the Models tab.
  • Double click to open the model.
  • Assign the layers to the right band numbers.
  • Click OK



Note: In order to use the batch process in the Raster Calculator you need to first create all of the 9 band split tifs using Translate. Here again you can use the batch processing option.

This batch does not work probably because there seems to be a bug in the processing toolbox raster calculator module: it does not correctly convert the datatype UInt16 to float32:

  1. Load the multiband raster file Subset_S2A_MSIL2A_20170619T.tif available in the course data. This contains all 13 bands of Sentinel-2 scene.
  2. 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.
  3. 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 Add rows.PNG 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).

Convert DN to reflectance.png

  • 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

Batch2.png

  • Click the button ... of Calculated to save output file
  • Click Run
Personal tools
Namespaces

Variants
Actions
Navigation
Development
Toolbox
Print/export