4. SCP dock

The SCP dock allows for the definition of inputs, the creation of ROIs (Regions Of Interest) and spectral signatures, and the classification of an input image.

The Input image, to be classified, can be a multi-band raster or a set of single bands defined in the Band set.

The Training input, created with SCP, stores the ROI polygons and spectral signatures used for the land cover classification of the Input image.

ROIs are polygons used for the definition of the spectral characteristics of land cover classes. SCP allows for the creation of temporary ROI polygons using a region growing algorithm or drawn manually. Using the region growing algorithm the image is segmented around a pixel seed including spectrally homogeneous pixels. Temporary ROI polygons can be saved in the Training input along with the spectral signatures of the ROI. It is worth pointing out that classification is always based on spectral signatures.

In SCP, land cover classes (and ROIs) are defined with a system of Classes (Class ID) and Macroclasses (Macroclass ID) (see Classes and Macroclasses) that are used for the classification process; each Macroclass ID is related to a Macroclass Information (e.g. macroclass name) and each Class ID is related to a Class Information (e.g. class name), but only Macroclass ID and Class ID are used for the classification process.

Training input is composed of a vector part (i.e. a shapefile) and a spectral signature part which are independent. The attribute table of the vector contains four fields as in the following table.

Training input fields
Description Field name Field type
Macroclass ID MC_ID int
Macroclass Information MC_info string
Class ID C_ID int
Class Information C_info string

Spectral signatures of classes are calculated from the ROIs and saved in the Training input. In addition, spectral signatures can be imported from other sources (see Import signatures).

The use of the Macroclass ID or Class ID for classifications is defined with the option Use MC ID or C ID in the Classification algorithm. It is worth highlighting that when using Macroclass ID all the spectral signatures are evaluated separately and each pixel is classified with the corresponding MC ID (i.e. there is no combination of signatures before the classification).

The classification can be performed for the entire image ( Classification output ) or a part of it, creating a Classification preview.

The functions are described in detail in the following paragraphs, using these conventions:

input_date = Input date

input_text = Input text

input_list = List

input_number = Input number

optional = Optional

project_save = Configuration stored in the active project of QGIS

registry_save = Configuration stored in QGIS registry

input_slider = Slider

input_table = Table

4.1. SCP input

_images/SCP_input.jpg

SCP input

4.1.1. Input image

This section allows for the selection of the image to be classified. Raster files must be already loaded in QGIS.

Input image can be a multi-band raster or a set of single bands defined in the Band set. If a multi-band raster is selected, raster bands are listed in the Band set.

  • open_file: open one or more raster files and add them Band set;
  • bandset_tool: open the Band set;
  • Input image input_list project_save: select the input image from a list of multi-spectral images loaded in QGIS; if the Band set is defined, then this list will contain the item << band set >>;
  • reload: refresh layer list;

4.1.2. Training input

The training input is a file .scp created in SCP (i.e. a zip file containing a shapefile and an xml file) used for storing ROIs and spectral signatures.

Warning: Signature list files saved with previous versions of SCP are not compatible with SPC 5; however you can import a ROI shapefile using the tool Import shapefile.

ROIs and spectral signatures are displayed in the ROI Signature list. ROIs and spectral signatures can be imported from other sources (see Import signatures) and exported (see Export signatures). ROIs are displayed in QGIS as vector file (in order to prevent data loss, you should not edit this layer using QGIS functions).

  • open_file: open a training input file; ROIs and spectral signatures are loaded in ROI Signature list; the vector part of the training input is loaded in QGIS;
  • new_file: create an empty training input file (.scp); the vector part of the training input is loaded in QGIS; also a backup file is created (a file .scp.backup in the same directory as the file .scp) when the training input file is saved;
  • Training input input_text project_save: it displays the path to the training input file;
  • download: open the Download images;
  • tools: open the Tools;
  • preprocessing: open the Preprocessing;
  • postprocessing: open the Postprocessing;
  • bandcalc: open the Band calc;
  • settings: open the Settings;
  • guide: open the online user manual in a web browser;
  • help: open the Online help in a web browser; also, a Facebook group and a Google+ Community are available for sharing information and asking for help about SCP;

4.1.3. SCP news

This section displays news about the SCP and related services. News are downloaded on startup (internet connection required). It can be enabled or disabled in the settings Dock.

4.2. Classification dock

The Classification dock is designed to manage the spectral signatures, and classify the Input image.

4.2.1. ROI Signature list

_images/ROI_list.jpg

ROI Signature list

The ROI Signature list displays the ROI polygons and spectral signatures contained in the Training input. If an item is a ROI polygon, double click the item to zoom to that ROI in the map. Items in the table can be highlighted with the mouse left click.

Changes in the ROI Signature list are applied to the file Training input only when the QGIS project is saved. ROIs can be edited, deleted and merged from this table.

WARNING: In order to avoid data loss, do not edit the vector Training input using the QGIS tools. Use only the tools of SCP for managing the Training input.
  • input_table ROI Signature list:
    • S: selection checkbox; only the spectral signatures checked in this list are used for the classification process;
    • Type: type of the item:
      • R = only ROI polygon;
      • S = only spectral signature;
      • B = both ROI and spectral signature;
    • MC ID: ROI Macroclass ID [int]; it can be edited with a single click; MC Info is displayed in Macroclasses; if the ID of a spectral signature is set 0, then pixels belonging to this signature are labelled as unclassified;
    • C ID: ROI Class ID [int]; it can be edited with a single click;
    • C Info: ROI Class Information [text]; it can be edited with a single click;
    • Color: C ID color; double click to select a color for the class that is used in the classification; if the ID of a spectral signature is set 0, then pixels belonging to this signature are labelled as unclassified;
  • delete_signature: delete highlighted ROIs and signatures;
  • merge_sign: merge highlighted spectral signatures or ROIs obtaining a new signature calculated as the average of signature values for each band (covariance matrix is excluded);
  • calculate_signature: calculate spectral signatures of highlighted ROIs;
  • sign_plot: show the ROI spectral signature in the Spectral Signature Plot; spectral signature is calculated from the Input image;
  • scatter_plot : open the Scatter Plot;
  • export_spectral_library: open the tab Export signatures;
  • import_spectral_library: open the tab Import signatures;

4.2.2. ROI creation

_images/ROI_creation.jpg

ROI creation

ROI creation is complementary to the Working toolbar and it allows for saving ROIs to the Training input defining classes and macroclasses. A Band set must be defined before the ROI creation, and ROI polygons must be inside the area of the Band set.

  • MC ID input_number project_save: ROI Macroclass ID [int]; the corresponding MC Info is loaded if already defined in Macroclasses;
  • MC Info input_text project_save: ROI Macroclass information [text]; style and information for macroclasses are defined in Macroclasses;
  • C ID input_number project_save: ROI Class ID [int];
  • C Info input_text project_save: ROI Class information [text];
  • undo_save_roi: delete the last saved ROI from the Training input;
  • checkbox Calculate sig. project_save: if checked, while saving a ROI, the spectral signature thereof is calculated (from Input image pixels under ROI polygon) and saved to Training input (calculation time depends on the band number of Input image);
  • save_roi: save the temporary ROI to the Training input using the defined classes and macroclasses; ROI is displayed in the ROI Signature list;
  • checkbox Display input_list project_save: if the ROI creation pointer is active (see Working toolbar), the pixel value of selected vegetation index is displayed on the map; vegetation indices available in the combo box are:
    • NDVI (Normalized Difference Vegetation Index); NDVI requires the near-infrared and red bands;
    • EVI (Enhanced Vegetation Index); EVI requires the blue, near-infrared and red bands converted to reflectance; wavelengths must be defined in the Band set;
    • Custom; use the custom expression defined in the following line Expression;
  • Expression input_text project_save: set a custom expression; expression is based on the Band set; bands are defined as bandset#b + band number (e.g. bandset#b1 for the first band of the Band set); for example NDVI for a Landsat image would be ( bandset#b4 - bandset#b3 ) / ( bandset#b4 + bandset#b3 );
  • checkbox Rapid ROI band input_number project_save: if checked, temporary ROI is created with region growing using only one Input image band (i.e.region growing is rapider); the band is defined by the Band set number; if unchecked, ROI is the result of the intersection between ROIs calculated on every band (i.e. region growing is slower, but ROI is spectrally homogeneous in every band);
  • radiobutton Automatic refresh ROI: calculate automatically a new temporary ROI while Region growing parameters in the Working toolbar are being changed;
  • radiobutton Automatic plot: calculate automatically the temporary ROI spectral signature and display it in the Spectral Signature Plot (MC Info of this spectral signature is set tempo_ROI);

4.2.3. Macroclasses

_images/macroclasses_style.jpg

Macroclasses

Macroclasses allows for the definition of Macroclass names and colors (used to display the results of Classification preview and Classification output). According to Classification algorithm, classifications performed using C ID have the colors defined for classes in the ROI Signature list; classifications performed using MC ID have the colors defined in the Macroclasses.

MC IDs are automatically added to this table when a new ROI is saved to the ROI Signature list (if the MC ID is not already in the list). Settings are stored in Training input.

  • input_table Macroclasses project_save:
    • MC ID: Macroclass ID [int]; it can be edited with a single click;
    • MC Info: Macroclass Information [text]; it can be edited with a single click;
    • Color: MC ID color; double click to select a color for the class that is used in the classification;
  • add: add a new row to the table;
  • remove: delete the highlighted rows from the table;

4.2.3.1. Classification style

In addition, a previously saved classification style (QGIS .qml file) can be loaded and used for classification style.

  • Load qml open_file project_save: select a .qml file overriding the colors defined for C ID or MC ID;
  • reset: reset style to default (i.e. use the colors defined for C ID or MC ID);

4.2.4. Classification algorithm

_images/classification_alg.jpg

Classification algorithm

The Classification algorithm includes several functions for the classification process used also during the Classification preview.

  • Use checkbox MC ID checkbox C ID registry_save: if MC ID is checked, the classification is performed using the Macroclass ID (code MC ID of the signature); if C ID is checked, the classification is performed using the Class ID (code C ID of the signature);
  • weight_tool : open the Algorithm band weight for the definition of band weights;

4.2.4.1. Algorithm

Classification is performed using the selected algorithm.

  • input_list project_save: available Classification Algorithms are:

  • Threshold input_number optional: it allows for the definition of a classification threshold (applied to all the spectral signatures); for advanced settings see Signature threshold; if threshold is equal to 0, then no threshold is considered and all image pixels are classified; otherwise:
    • for Minimum Distance, pixels are unclassified if distance is greater than threshold value;
    • for Maximum Likelihood, pixels are unclassified if probability is less than threshold value (max 100);
    • for Spectral Angle Mapping, pixels are unclassified if spectral angle distance is greater than threshold value (max 90);
  • threshold_tool: open the Signature threshold for the definition of signature thresholds;

4.2.4.2. Land Cover Signature Classification

Land Cover Signature Classification is a classification that can be used as alternative or in combination with the Algorithm (see LCS threshold). Pixels belonging to two or more different classes (or macroclasses) are classified as Class overlap with raster value = -1000.

  • Use checkbox LCS checkbox Algorithm checkbox only overlap: if LCS is checked, the Land Cover Signature Classification is used; if Algorithm is checked, the selected Algorithm is used for unclassified pixels of the Land Cover Signature Classification; if only overlap is checked, the selected Algorithm is used only for class overlapping pixels of the Land Cover Signature Classification; unclassified pixels of the Land Cover Signature Classification are left unclassified;
  • threshold_tool: open the LCS threshold;

4.2.5. Classification output

_images/classification_output.jpg

Classification output

Classification output allows for the classification of the Input image according to the parameters defined in Classification algorithm.

Classification raster is a file .tif (a QGIS style file .qml is saved along with the classification); also other outputs can be optionally calculated. Outputs are loaded in QGIS after the calculation.

  • checkbox Apply mask optional: if checked, a shapefile can be selected for masking the classification output (i.e. the area outside the shapefile is not classified);
  • reset: reset the mask shapefile;
  • checkbox Create vector optional: if checked, in addition to the classification raster, a classification shapefile is saved in the same directory and with the same name as the Classification output; conversion to vector can also be performed at a later time (see Classification to vector);
  • checkbox Classification report optional: if checked, a report about the land cover classification is calculated and saved as a .csv file in the same directory and with the same name (with the suffix _report) as the Classification output; report can also be performed at a later time (see Classification report);
  • checkbox Save algorithm files optional registry_save: if checked, the Algorithm raster is saved, in addition to the classification raster, in the same directory as the Classification output; a raster for each spectral signature used as input (with the suffix _sig_MC ID_C ID) and a general algorithm raster (with the suffix _alg_raster) are created;
  • run: choose the output destination and start the image classification;