# 2. SCP dock¶

The SCP dock allows for the the creation of ROIs (Regions Of Interest) and spectral signatures, and the classification of a Band set. The Training input, created with SCP, stores the ROI polygons and spectral signatures used for the land cover classification (see Tutorial 1: Your First Land Cover Classification).

ROIs are polygons used for the definition of the spectral characteristics of land cover classes. Spectral signatures of classes are calculated from the ROIs or can be imported from other sources (see Import signatures). It is worth pointing out that classification is always based on spectral signatures.

SCP allows for the creation of temporary ROI polygons using a region growing algorithm or drawn manually with the tools provided in the Working toolbar. Temporary ROI polygons can be saved in the Training input along with the spectral signatures of the ROI.

The 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

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.

The use of the Macroclass ID or Class ID for classifications is defined with the option Use MC ID or C ID in the 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 ( Algorithm ) or a part of it, creating a Classification preview.

The SCP dock contains the following tabs:

The left side of SCP dock contains buttons for accessing the main functions of SCP.

## 2.1. Home¶

Home

The tab Home contains the buttons for accessing the main functions of SCP:

### 2.1.1. 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.

It also contains the following buttons:

• User manual: open the link to the user manual;
• Support the SCP: open the link to support the SCP ;

## 2.2. Training input¶

Training input

This tool allows for the creation of the training input file (.scp ) required for storing ROIs and spectral signatures. The training input file is created according to the characteristics of the active band set defined in Band set. A new training input file should be created for every band set, unless the band sets have the same spectral characteristics and coordinate reference system.

• : 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;
• : 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 : it displays the path to the training input file;

The training input is displayed in QGIS as vector file. ROIs and spectral signatures are displayed in the ROI Signature list. Macroclasses are defined in the Macroclasses.

### 2.2.1. ROI Signature list¶

The tab ROI Signature list displays the ROI polygons and spectral signatures contained in the training input file. 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.

ROIs and spectral signatures can be imported from other sources (see Import signatures) and exported (see Export signatures).

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.
• 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;
• : 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 spectral signatures of highlighted ROIs using the active band set in Band set;
• : delete highlighted ROIs and signatures;
• : show the ROI spectral signature in the Spectral Signature Plot; spectral signature is calculated from the Band set;
• : open the Scatter Plot;
• : open the tab Import signatures;
• : open the tab Export signatures;

ROI Signature list 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 : ROI Macroclass ID [int]; the corresponding MC Info is loaded if already defined in Macroclasses;
• MC Info : ROI Macroclass information [text]; style and information for macroclasses are defined in Macroclasses;
• C ID : ROI Class ID [int];
• C Info : ROI Class information [text];
• : delete the last saved ROI from the Training input;
• Autosave : if checked, automatically save the ROI Signature list to the Training input every time a ROI is saved;
• Calculate sig. : if checked, while saving a ROI, the spectral signature thereof is calculated (from Band set pixels under ROI polygon) and saved to Training input (calculation time depends on the band number of the active band set in Band set);
• : save the temporary ROI to the Training input using the defined classes and macroclasses; ROI is displayed in the ROI Signature list;

### 2.2.2. Macroclasses¶

Macroclasses

Macroclasses allows for the definition of Macroclass names and colors (used to display the results of Classification preview and Algorithm). According to 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.

• Macroclasses :
• 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 a new row to the table;
• : delete the highlighted rows from the table;

### 2.2.3. ROI options¶

ROI options

ROI options are useful for displaying pixel values or improving the creation of ROIs.

• Display : 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;
• : 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 );
• Rapid ROI b. : if checked, temporary ROI is created with region growing using only one Band set 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);
• Auto-refresh ROI: calculate automatically a new temporary ROI while Region growing parameters in the Working toolbar are being changed;
• Auto-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);

## 2.3. Classification¶

Classification

This tab allows for the classification of the active band set defined in Band set.

Classification is performed using the active band set and the spectral signatures checked in ROI Signature list. Several classification options are set in this tab which affect the classification process also during the Classification preview.

In particular the following options are available:

• Use MC ID C ID : 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);
• : open the Algorithm band weight for the definition of band weights;

### 2.3.1. Algorithm¶

This tool allows for the selection of the classification algorithm and the optiona definition of thresholds.

• : available Classification Algorithms are:

• Threshold : it allows for the definition of a classification threshold (applied to all the spectral signatures); if Threshold is equal to 0, then thresholds Signature threshold are evaluated; in particular:
• 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);
• : open the Signature threshold for the definition of signature thresholds;

### 2.3.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 LCS Algorithm 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;
• : open the LCS threshold;

### 2.3.3. Classification output¶

Classification output allows for the classification of the Band set according to the parameters defined in Algorithm.

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

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.

• Load qml : select a .qml file overriding the colors defined for C ID or MC ID;
• : reset style to default (i.e. use the colors defined for C ID or MC ID);
• Apply mask : if checked, a shapefile can be selected for masking the classification output (i.e. the area outside the shapefile is not classified);
• : reset the mask shapefile;
• Create vector : 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);
• Classification report : 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);
• Save algorithm files : 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;
• : choose the output destination and start the image classification;