Dokumentacja wtyczki Semi-Automatic Classification Plugin¶
Wprowadzenie¶
Rozwijana przez Luca Congedo, Semi-Automatic Classification Plugin (SCP) jest wtyczką dla QGIS<http://www.qgis.org>`_ o otwartym źródle, która pozwala na klasyfikację półautomatyczną (klasyfikacja nazdzorowana) obrazów teledetekcyjnych. Dostarcza wiele narzędzi do pobierania obrazów, ich przygotowania, postprocessingu, i obliczeń na rastrze (zobacz Co właściwie mogę zrobić przy pomocy SCP?).
Nadrzędnym celem SCP jest zapewnienie zestawu wzajemnie powiązanych narzędzi do przetwarzania rastrów w celu automatyzacji pracy oraz ułatwienia klasyfikacji pokrycia terenu, które może być dokonane przez osoby dla których teledetekcja nie jest podstawowym polem badawczym. Pierwsza wersja SCP została opracowana przez Luca Congedo w 2012 roku dla „ACC Dar Project” w celu stworzenia narzędzia, dla klasyfikacji w sposób przystępny oraz możliwie automatyczny; kolejne wersje SCP były opracowane jako osobisty wkład do teledetekcji oraz filozofii open-source. SCP w wersji 6 (nazwa kodowa: Greenbelt) jest opracowana w ramach pracy doktorskiej (PhD) Luca Congedo w dziedzinie krajobrazu i środowiska na Uniwersytecie La Sapienza w Rzymie.
Ten podręcznik użytkownika dostarcza informacje na temat Instalacja wtyczki i Interfejs SCP wtyczki SCP, z szczegółowymi opisami wszystkich funkcji. Dodatkowo w zakładce Brief Introduction to Remote Sensing objaśnia podstawowe pojęcia, koncepcje i definicji które są konieczne aby używać SCP.
Podręczniki podstawowe są dostępne dla szybkiej nauki głównych funkcji SCP.
Serdecznie zapraszam cię do współpracy przy SCP (zobacz Własny wkład do SCP) i dołączenia do grupy Facebook . Przeczytaj również Najczęściej zadawane pytania.
Jeśli szukasz więcej informacji, lub instrukcji krok-po-kroku odwiedź oficjalną stronę wtyczki.
Sposób cytowania:
Congedo Luca (2016). Semi-Automatic Classification Plugin Documentation. DOI: http://dx.doi.org/10.13140/RG.2.2.29474.02242/1
Licencja:
Jeśli inaczej nie oznaczono, zawartość tej pracy jest publikowana na licencji Creative Commons Attribution-ShareAlike 4.0 International License.
Semi-Automatic Classification Plugin is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 3 of the License.
Semi-Automatic Classification Plugin is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with Semi-Automatic Classification Plugin. If not, see http://www.gnu.org/licenses/.
Tłumacze:
Język: Autor
Instalacja wtyczki¶
Wtyczka Semi-Automatic Classification Plugin wymaga zainstalowanych GDAL, OGR, NumPy, SciPy oraz Matplotlib (aktalnie dołączonych do QGIS).|br| Ten rodział opisuje instalację Semi-Automatic Classification Plugin na wspieranych systemach operacyjnych.
Instalacja w systemie Windows 32bit¶
Pobranie i instalacja QGIS¶
- Pobierz najświeższą wersję QGIS 32 bit tutaj ;
- Uruchom instalator QGIS z uprawnieniami administratora, akceptując domyślne ustawienia.
Teraz, QGIS jest zainstalowany.

Instalacja wtyczki Semi-Automatic Classification Plugin¶
- Uruchom QGIS;
- Z głównego meny programu wybierz
Wtyczki
>Zarządzanie wtyczkami

Z menu
Wszystkie
, wybierz Semi-Automatic Classification Plugin i kliknij w przyciskZainstaluj wtyczkę
;Wskazówka: w przypadku problemów lub wymogu instalacji offline zobacz W jaki sposób można zainstalować wtyczkę ręcznie? oraz W jaki sposób zainstalować wtyczkę z oficjalnego repozytorium SCP?.

- SCP powinno być automatycznie aktywowane; jednak upewnij się że wtyczka jest zaznaczona w menu
Zainstalowane
(restart QGIS może być wymagany dla dokończenia instalacji SCP);

Konfiguracja wtyczki¶
Semi-Automatic Classification Plugin jest zainstalowany i dok, oraz paski narzędzi powinny być dodane do QGIS. Dodatkowo, menu SCP jest dostępne w głównym menu programu. Możesz przesuwać paski narzędziowe i doki zgodnie z własnymi potrzebami, tak jak na obrazku poniżej.

Instalacja w systemie Windows 64-bit¶
Pobranie i instalacja QGIS¶
- Pobierz najświeższą wersję QGIS 64 bit tutaj ;
- Uruchom instalator QGIS z uprawnieniami administratora, akceptując domyślne ustawienia.
Teraz, QGIS jest zainstalowany.

Instalacja wtyczki Semi-Automatic Classification Plugin¶
- Uruchom QGIS;
- Z głównego meny programu wybierz
Wtyczki
>Zarządzanie wtyczkami

Z menu
Wszystkie
, wybierz Semi-Automatic Classification Plugin i kliknij w przyciskZainstaluj wtyczkę
;Wskazówka: w przypadku problemów lub wymogu instalacji offline zobacz W jaki sposób można zainstalować wtyczkę ręcznie? oraz W jaki sposób zainstalować wtyczkę z oficjalnego repozytorium SCP?.

- SCP powinno być automatycznie aktywowane; jednak upewnij się że wtyczka jest zaznaczona w menu
Zainstalowane
(restart QGIS może być wymagany dla dokończenia instalacji SCP);

Konfiguracja wtyczki¶
Semi-Automatic Classification Plugin jest zainstalowany i dok, oraz paski narzędzi powinny być dodane do QGIS. Dodatkowo, menu SCP jest dostępne w głównym menu programu. Możesz przesuwać paski narzędziowe i doki zgodnie z własnymi potrzebami, tak jak na obrazku poniżej.

Konfiguracja dostępnego RAM jest zalecana aby przyśpieszyć czas przetwarzania. Z menu Menu SCP wybierz Ustawienia > Processing` .

W Settings, ustaw Available RAM (MB)
mniej więcej do połowy systamowego RAM. Przykładowo, jeśli twój system ma 2GB RAMu, ustaw wartość 1024MB.

Instalacja w Ubuntu Linux¶
Pobranie i instalacja QGIS¶
Otwórz terminal i wpisz:
sudo apt-get update
Naciśnij Enter i wprowadź hasło użytkownika
Wpisz w terminalu:
sudo apt-get install qgis python3-matplotlib python3-scipy
Wciśnij Enter i poczekaj na pobranie i instalację programu.
Teraz, QGIS jest zainstalowany.

Instalacja wtyczki Semi-Automatic Classification Plugin¶
- Uruchom QGIS;
- Z głównego meny programu wybierz
Wtyczki
>Zarządzanie wtyczkami

Z menu
Wszystkie
, wybierz Semi-Automatic Classification Plugin i kliknij w przyciskZainstaluj wtyczkę
;Wskazówka: w przypadku problemów lub wymogu instalacji offline zobacz W jaki sposób można zainstalować wtyczkę ręcznie? oraz W jaki sposób zainstalować wtyczkę z oficjalnego repozytorium SCP?.

- SCP powinno być automatycznie aktywowane; jednak upewnij się że wtyczka jest zaznaczona w menu
Zainstalowane
(restart QGIS może być wymagany dla dokończenia instalacji SCP);

Konfiguracja wtyczki¶
Semi-Automatic Classification Plugin jest zainstalowany i dok, oraz paski narzędzi powinny być dodane do QGIS. Dodatkowo, menu SCP jest dostępne w głównym menu programu. Możesz przesuwać paski narzędziowe i doki zgodnie z własnymi potrzebami, tak jak na obrazku poniżej.

Konfiguracja dostępnego RAM jest zalecana aby przyśpieszyć czas przetwarzania. Z menu Menu SCP wybierz Ustawienia > Processing` .

W Settings, ustaw Available RAM (MB)
mniej więcej do połowy systamowego RAM. Przykładowo, jeśli twój system ma 2GB RAMu, ustaw wartość 1024MB.

Instalacja w systemie Debian Linux¶
Pobranie i instalacja QGIS¶
Otwórz terminal i wpisz:
sudo apt-get update
Naciśnij Enter i wprowadź hasło użytkownika
Wpisz w terminalu:
sudo apt-get install qgis python3-matplotlib python3-scipy
Wciśnij Enter i poczekaj na pobranie i instalację programu.
Teraz, QGIS jest zainstalowany.

Instalacja wtyczki Semi-Automatic Classification Plugin¶
- Uruchom QGIS;
- Z głównego meny programu wybierz
Wtyczki
>Zarządzanie wtyczkami

Z menu
Wszystkie
, wybierz Semi-Automatic Classification Plugin i kliknij w przyciskZainstaluj wtyczkę
;Wskazówka: w przypadku problemów lub wymogu instalacji offline zobacz W jaki sposób można zainstalować wtyczkę ręcznie? oraz W jaki sposób zainstalować wtyczkę z oficjalnego repozytorium SCP?.

- SCP powinno być automatycznie aktywowane; jednak upewnij się że wtyczka jest zaznaczona w menu
Zainstalowane
(restart QGIS może być wymagany dla dokończenia instalacji SCP);

Konfiguracja wtyczki¶
Semi-Automatic Classification Plugin jest zainstalowany i dok, oraz paski narzędzi powinny być dodane do QGIS. Dodatkowo, menu SCP jest dostępne w głównym menu programu. Możesz przesuwać paski narzędziowe i doki zgodnie z własnymi potrzebami, tak jak na obrazku poniżej.

Konfiguracja dostępnego RAM jest zalecana aby przyśpieszyć czas przetwarzania. Z menu Menu SCP wybierz Ustawienia > Processing` .

W Settings, ustaw Available RAM (MB)
mniej więcej do połowy systamowego RAM. Przykładowo, jeśli twój system ma 2GB RAMu, ustaw wartość 1024MB.

Instalacja w MacOS¶
Pobranie i instalacja QGIS¶
- Download and install the latest version of QGIS and GDAL from here .
Teraz, QGIS jest zainstalowany.

Instalacja wtyczki Semi-Automatic Classification Plugin¶
- Uruchom QGIS;
- Z głównego meny programu wybierz
Wtyczki
>Zarządzanie wtyczkami

Z menu
Wszystkie
, wybierz Semi-Automatic Classification Plugin i kliknij w przyciskZainstaluj wtyczkę
;Wskazówka: w przypadku problemów lub wymogu instalacji offline zobacz W jaki sposób można zainstalować wtyczkę ręcznie? oraz W jaki sposób zainstalować wtyczkę z oficjalnego repozytorium SCP?.

- SCP powinno być automatycznie aktywowane; jednak upewnij się że wtyczka jest zaznaczona w menu
Zainstalowane
(restart QGIS może być wymagany dla dokończenia instalacji SCP);

In case of missing dependencies, you could get error messages such as the following example with matplotlib:

To install matplotlib type in a terminal:
sudo pip3 install matplotlib
and repeat this step for other missing dependencies.
Konfiguracja wtyczki¶
Semi-Automatic Classification Plugin jest zainstalowany i dok, oraz paski narzędzi powinny być dodane do QGIS. Dodatkowo, meny SCP jest dostępne w głównym menu programu. Możesz przesuwać paski narzędziowe i doki zgodnie z własnymi potrzebami, tak jak na obrazku poniżej.

Konfiguracja dostępnego RAM jest zalecana aby przyśpieszyć czas przetwarzania. Z menu Menu SCP wybierz Ustawienia > Processing` .

W Settings, ustaw Available RAM (MB)
mniej więcej do połowy systamowego RAM. Przykładowo, jeśli twój system ma 2GB RAMu, ustaw wartość 1024MB.

Interfejs SCP¶
Interfejs SCP jest złożony z kilkunastu części które są opisane szczegółowo w następnych akapitach.
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.
Home¶

Home
The tab Home contains the buttons for accessing the main functions of SCP:
Band set;
Basic tools;
Download products;
Preprocessing;
Band processing;
Postprocessing;
Band calc;
Batch;
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;
- Ask a question: open the link to the online help;
- Support the SCP: open the link to support the SCP ;
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.
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 Wykres sygnatur widmowych; spectral signature is calculated from the Band set;
: open the Wykres punktowy;
: 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;
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.
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 Wykres sygnatur widmowych (
MC Info
of this spectral signature is settempo_ROI
);
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;
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);
- Threshold
: open the Signature threshold for the definition of signature thresholds;
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;
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;
Working toolbar¶

Working toolbar
The Working toolbar allows for creating temporary ROIs and classification previews.
The functions are described in detail in the following paragraphs.
Image control¶
: show the Main Interface Window;
: zoom the map to the extent of the active band set in Band set;
RGB=
: use the button to show/hide the active band set in Band set in the map; from the list select a Color Composite that is applied to the Band set; new color composites can be entered typing the band numbers separated by
-
or;
or,
(e.g. RGB = 4-3-2 or RGB = 4;3;2 or RGB = 4,3,2);: display the input image stretching the minimum and maximum values according to cumulative count of current map extent;
: display the input image stretching the minimum and maximum values according to standard deviation of current map extent;
Temporary ROI¶
A temporary ROI is a temporary polygon displayed in the map, which can be saved permanently in the Training input. A temporary ROI can be drawn manually or using a Region Growing Algorithm (i.e. the image is segmented around a pixel seed including spectrally homogeneous pixels).
: zoom the map to the extent of temporary ROI;
ROI: use the button to show/hide the temporary ROI and the Training input in the map;
: activate the pointer to create a temporary ROI by drawing a polygon in the map; left click on the map to define the ROI vertices and right click to define the last vertex closing the polygon; press the keyboard button
CTRL
to add a multipart polygon; press the keyboard buttonsCTRL + Z
for removing the last multipart polygon;: activate the pointer to create a temporary ROI using the region growing algorithm; left click on the map for creating the ROI; right click on the map for displaying the spectral signature of a pixel of the active band set in the Wykres sygnatur widmowych; press the keyboard button
CTRL
and left click to add a multipart polygon (new parts are not created if overlapping to other parts); press the keyboard buttonsCTRL + Z
for removing the last multipart polygon; press the keyboard buttonCTRL
and right click to plot spectral signatures of the same pixel for all the band sets;: create a temporary ROI using the region growing algorithm at the same seed pixel as the previous one; it is useful after changing the region growing parameters;
- Region growing parameters: the following parameters are required for the ROI creation using a region growing algorithm on the Band set:
- Dist
: set the interval which defines the maximum spectral distance between the seed pixel and the surrounding pixels (in radiometry unit);
- Min
: set the minimum area of a ROI (in pixel unit); this setting overrides the
Range radius
until the minimum ROI size is reached; ifRapid ROI on band
is checked, then ROI will have at least the size definedMin ROI size
; ifRapid ROI on band
is unchecked, then ROI could have a size smaller thanMin ROI size
; - Max
: set the maximum width of a ROI (i.e. the side length of a square, centred at the seed pixel, which inscribes the ROI) in pixel unit;
- Dist
Classification preview¶
Classification preview allows for displaying temporary classifications (i.e. classification previews). Classification previews are useful for testing the algorithm in a small area of the Band set, before classifying the entire image which can be time consuming (see Classification output).
Classification preview is performed according to the parameters defined in Algorithm.
In addition to the classification raster, an Algorithm raster can be displayed, which is useful for assessing the distance of a pixel classified as class X
from the corresponding spectral signature X.
In Classification previews, black pixels are distant from the corresponding spectral signature (i.e. probably a new ROI, or spectral signature, should be collected in that area) and white pixels are closer to the corresponding spectral signature (i.e. probably the spectral signature identifies correctly those pixels).
After the creation of a new preview, old previews are placed in QGIS Layers inside a layer group named Class_temp_group
(custom name can be defined in Temporary group name) and are deleted when the QGIS session is closed.
WARNING: Classification previews are automatically deleted from disk when the QGIS session is closed; a QGIS message (that can be ignored) could ask for the path of missing layers when opening a previously saved project.
: zoom the map to the extent of the last Classification preview;
Preview: use the button to show/hide the last Classification preview in the map;
: activate the pointer for the creation of a Classification preview; left click the map to start the classification process and display the classification preview; right click to start the classification process and show the Algorithm raster of the preview;
: create a new Classification preview centred at the same pixel as the previous one;
- T
: change dynamically the classification preview transparency, which is useful for comparing the classification to other layers;
- S
: size of the preview in pixel unit (i.e. the side length of a square, centred at the clicked pixel);
: remove from QGIS the classification previews that are archived in the Class_temp_group;
Main Interface Window¶
The Main Interface Window is composed of several tabs described in detail in the following paragraphs. Tabs can be selected through the menu at the left side.
Band set¶
Image input in SCP is named band set. This tab allows for the definition of one or more band sets used as input for classification and other tools.
Band sets are identified by numbers. The active band set (i.e. the tab selected in Band set definition with bold green name) is used as input for the tools in SCP dock and Working toolbar. Other SCP tools allow for the selection of band set numbers.
The Band set definition is saved with the QGIS project.
Multiband image list¶
This section allows for the selection of a multiband raster. If selected, raster bands are listed in the active band set.
Single band list¶
List of single band rasters already loaded in QGIS. It is possible to select one or more bands to be added to the active band set.
Band set definition¶
Definition of bands composing the band sets . The active band set is the tab selected with bold green name. It is possible to add new band sets clicking the following button:
Click the in the tab to remove the corresponding band set.
Band sets can be reordered dragging the tabs.
The Center wavelength of bands should be defined in order to use several functions of SCP. If the Center wavelength of bands is not defined, the band number is used and some SCP tools will be disabled.
It is possible to define a multiplicative rescaling factor and additive rescaling factor for each band (for instance using the values in Landsat metadata), which are used on the fly (i.e. pixel value = original pixel value * multiplicative rescaling factor + additive rescaling factor
) during the processing.
Every band set is defined with the following table:
: move highlighted bands upward;
: move highlighted bands downward;
: sort automatically bands by name, giving priority to the ending numbers of name;
: remove highlighted bands from the active band set;
: clear all bands from active band set;
- Quick wavelength settings
: rapid definition of band center wavelength for the following satellite sensors:
- ASTER;
- GeoEye-1;
- Landsat 8 OLI;
- Landsat 7 ETM+;
- Landsat 5 TM;
- Landsat 4 TM;
- Landsat 1, 2, and 3 MSS;
- MODIS;
- Pleiades;
- QuickBird;
- RapidEye;
- Sentinel-2;
- Sentinel-3;
- SPOT 4;
- SPOT 5;
- SPOT 6;
- WorldView-2 and WorldView-3;
- Quick wavelength settings
: import a previously saved active band set from file;
: export the active band set to a file;
Band set tools¶
It is possible to perform several processes directly on active band set.
Create virtual raster of band set: if checked, create a virtual raster of bands;
Create raster of band set (stack bands): if checked, stack all the bands and create a unique .tif raster;
Build band overviews: if checked, build raster overviews (i.e. pyramids) for improving display performance; overview files are created in the same directory as bands;
Band calc expression: if checked, calculate the Expression entered in Band calc; it is recommended the use of Band set variables in the expression (e.g.
bandset#b1
);- RUN
: choose the output destination and start the process;
Basic tools¶
The tab
Basic tools
includes several tools for manipulating input data.
RGB list¶
This tab allows for managing the RGB Color Composite used in the list RGB= of the Image control.
RGB list¶
: move highlighted RGB combination upward;
: move highlighted RGB combination downward;
: automatically sort RGB combinations by name;
: add a row to the table;
: remove highlighted rows from the table;
: clear all RGB combinations from RGB list;
: export the RGB list to a file (i.e.
.csv
);: import a previously saved RGB list from file (i.e.
.csv
);
Algorithm band weight¶
This tab allows for the definition of band weights that are useful for improving the spectral separability of materials at certain wavelengths (bands). During the classification process, band values and spectral signature values are multiplied by the corresponding band weights, thus modifying the spectral distances. A tab is displayed for every Band set.
Band weight¶
Automatic weight¶
Multiple ROI Creation¶
This tab allows for the automatic creation of ROIs, useful for the rapid classification of multi-temporal images, or for accuracy assessment. Given a list of point coordinates and ROI options, this tool performs the region growing of ROIs. Created ROIs are automatically saved to the Training input. The active band set in Band set is used for calculations.
Create random points¶
- Number of points
: set a number of points that will be created when Create points
is clicked;
inside grid
: if checked, the band set area is divided in cells where the size thereof is defined in the combobox (image unit, usually meters); points defined in
Number of random points
are created randomly within each cell;min distance
: if checked, random points have a minimum distance defined in the combobox (image unit, usually meters); setting a minimum distance can result in fewer points than the number defined in Number of points;
- Create points
: create random points inside the band set area;
stratified for the values
of the first band of the band set min distance
: if checked, create random points inside the values defined in the expression calculated for the first band of the defined band set; the expression must include the variable
raster
; multiple expressions can be entered separated by semicolon ( ; ) but the total number of stratified points is the same as the defined Number of points;
Point coordinates and ROI definition¶
Point coordinates and ROI definition: table containing the following fields;
- X : point X coordinate (float);
- Y : point Y coordinate (float);
- MC ID: ROI Macroclass ID (int);
- MC Info: ROI Macroclass information (text);
- C ID: ROI Class ID (int);
- C Info: ROI Class information (text);
- Min : the minimum area of a ROI (in pixel unit);
- Max : the maximum width of a ROI (in pixel unit);
- Dist : the interval which defines the maximum spectral distance between the seed pixel and the surrounding pixels (in radiometry unit);
- Rapid ROI band : if a band number is defined, ROI is created only using the selected band, similarly to Rapid ROI band in ROI Signature list ;
: add a new row to the table; all the table fields must be filled for the ROI creation;
: delete the highlighted rows from the table;
: import a point list from text file or a point shapefile to the table; in case of text file, every line must contain values separated by tabs of
X
,Y
,MC ID
,MC Info
,Class ID
,C Info
,Min
,Max
,Dist
, and optionally theRapid ROI band
; in case of shapefile, only point coordinates are imported;: export the point list to text file;
Run¶
Calculate sig.: if checked, the spectral signature is calculated while the ROI is saved to Training input;
- RUN
: start the ROI creation process for all the points and save ROIs to the Training input;
Import signatures¶
The tab Import signatures allows for importing spectral signatures from various sources.
Import library file¶
This tool allows for importing spectral signatures from various sources: a previously saved Training input (.scp file); a USGS Spectral Library (.asc file); a previously exported CSV file. In case of USGS Spectral Library, the library is automatically sampled according to the image band wavelengths defined in the Band set, and added to the ROI Signature list;
- Select a file
: open a file to be imported in the Training input;
Import shapefile¶
This tool allows for importing a shapefile, selecting the corresponding fields of the Training input.
- Select a shapefile
: open a shapefile;
- MC ID field
: select the shapefile field corresponding to MC ID;
- MC Info field
: select the shapefile field corresponding to MC Info;
- C ID field
: select the shapefile field corresponding to C ID;
- C Info field
: select the shapefile field corresponding to C Info;
Calculate sig.: if checked, the spectral signature is calculated while the ROI is saved to Training input;
- Import shapefile
: import all the shapefile polygons as ROIs in the Training input;
Download USGS Spectral Library¶
The tab Download USGS Spectral Library allows for the download of the USGS spectral library (Clark, R.N., Swayze, G.A., Wise, R., Livo, E., Hoefen, T., Kokaly, R., Sutley, S.J., 2007, USGS digital spectral library splib06a: U.S. Geological Survey, Digital Data Series 231).
The libraries are grouped in chapters including Minerals, Mixtures, Coatings, Volatiles, Man-Made, Plants, Vegetation Communities, Mixtures with Vegetation, and Microorganisms. An internet connection is required.
Select a chapter
: select one of the library chapters; after the selection, chapter libraries are shown in Select a library;
Select a library
: select one of the libraries; the library description is displayed in the frame Library description;
Import spectral library
: download the library and add the sampled spectral signature to the ROI Signature list using the parameters defined for class and macroclass; the library is automatically sampled according to the image band wavelengths defined in the active band set in Band set, and added to the ROI Signature list;
Tip: Spectral libraries downloaded from the
USGS Spectral Library
can be used with Minimum Distance or Spectral Angle Mapping algorithms, but not Maximum Likelihood because this algorithm needs the covariance matrix that is not included in the spectral libraries.
Export signatures¶
This tool allows for exporting the signatures highlighted in the ROI Signature list.
- Export as SCP file
: create a new .scp file and export highlighted ROIs and spectral signatures as SCP file (* .scp);
- Export as shapefile
: export highlighted ROIs (spectral signature data excluded) as a new shapefile (* .shp);
- Export as CSV file
: open a directory, and export highlighted spectral signatures as individual CSV files (* .csv) separated by semicolon ( ; );
Signature threshold¶
This tab allows for the definition of a classification threshold for each spectral signature. All the signatures contained in the Training input are listed. Thresholds defined in this tool are applied to classification only if Threshold value in Algorithm is 0.
This is useful for improving the classification results, especially when spectral signatures are similar. Thresholds of signatures are saved in the Training input.
If threshold is 0 then no threshold is applied and all the image pixels are classified. Depending on the selected Algorithm the threshold value is evaluated differently:
- 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).
Signature threshold¶
Signature threshold: table containing the following fields;
- MC ID: signature Macroclass ID;
- MC Info: signature Macroclass Information;
- C ID: signature Class ID;
- C Info: signature Class Information;
- MD Threshold: Minimum Distance threshold; this value can be edited;
- ML Threshold: Maximum Likelihood threshold; this value can be edited;
- SAM Threshold: Spectral Angle Mapping threshold; this value can be edited;
: reset all signatures thresholds to 0 (i.e. no threshold used);
Automatic thresholds¶
- Set threshold
: set the defined value as threshold for all the highlighted signatures in the table;
- Set threshold = σ *
: for all the highlighted signatures, set an automatic threshold calculated as the distance (or angle) between mean signature and (mean signature + (σ * v)), where σ is the standard deviation and v is the defined value; currently works for Minimum Distance and Spectral Angle Mapping;
LCS threshold¶
This tab allows for setting the signature thresholds used by Land Cover Signature Classification. All the signatures contained in the Training input are listed; also, signature thresholds are saved in the Training input.
Overlapping signatures (belonging to different classes or macroclasses) are highlighted in orange in the table LC Signature threshold; the overlapping check is performed considering MC ID or C ID according to the setting Use MC ID
C ID in Algorithm.
Overlapping signatures sharing the same ID are not highlighted.
LC Signature threshold¶
LC Signature threshold: table containing the following fields;
- MC ID: signature Macroclass ID;
- MC Info: signature Macroclass Information;
- C ID: signature Class ID;
- C Info: signature Class Information;
- Color [overlap MC_ID-C_ID]: signature color; also, the combination MC ID-C ID is displayed in case of overlap with other signatures (see Land Cover Signature Classification);
- Min B
X
: minimum value of bandX
; this value can be edited; - Max B
X
: maximum value of bandX
; this value can be edited;
: show the ROI spectral signature in the Wykres sygnatur widmowych; spectral signature is calculated from the Band set;
Automatic thresholds¶
Set thresholds automatically for highlighted signatures in the table LC Signature threshold; if no signature is highlighted, then the threshold is applied to all the signatures.
Download products¶
The tab Download products includes the tools for searching and downloading free remote sensing images.
Also, automatic conversion to reflectance of downloaded bands is available.
An internet connection is required and free registration could be required depending on the download service.
This tool allows for searching and downloading:
- Landsat Satellites images (from 1 MSS to 8 OLI) acquired from the 80s to present days;
- Sentinel-2 Satellite images (Level-1C and Level-2A) acquired from 2015 to present days;
- Sentinel-3 Satellite images (OLCI Level-1B OL_1_EFR) acquired from 2016 to present days;
- ASTER Satellite images (Level 1T) acquired from 2000 to present days;
- MODIS Products images (MOD09GQ, MYD09GQ, MOD09GA, MYD09GA, MOD09Q1, MYD09Q1, MOD09A1, MYD09A1) acquired from 2000 to present days;
For Landsat, ASTER, and MODIS the search is performed through the CMR Search API developed by NASA. Landsat images are freely available through the services: EarthExplorer , Google Earth Engine , and the Amazon Web Services (AWS) (only for Landsat 8). The ASTER L1T and MODIS products are retrieved from the online Data Pool, courtesy of the NASA Land Processes Distributed Active Archive Center (LP DAAC), USGS/Earth Resources Observation and Science (EROS) Center, Sioux Falls, South Dakota, https://lpdaac.usgs.gov/data_access/data_pool.
For Sentinel-2 and Sentinel-3 the search is performed through the Copernicus Open Access Hub (using the Data Hub API ); images are mainly downloaded from the Amazon S3 AWS if available.
This tool attempts to download images first from Amazon Web Services and Google Earth Engine ; only if images are not available, the download is performed through the services that require to login.
Login data¶
Login https://ers.cr.usgs.gov¶
For Landsat images USGS EROS credentials (https://ers.cr.usgs.gov) are required for downloads from EarthExplorer . Login using your USGS EROS credentials or register for free at https://ers.cr.usgs.gov/register .
Login https://urs.earthdata.nasa.gov¶
For ASTER and MODIS images EOSDIS Earthdata credentials (https://urs.earthdata.nasa.gov ) are required for download. Login using your EOSDIS Earthdata credentials or register for free at https://urs.earthdata.nasa.gov/users/new . Before downloading ASTER and MODIS images, you must approve LP DAAC Data Pool clicking the following link https://urs.earthdata.nasa.gov/approve_app?client_id=ijpRZvb9qeKCK5ctsn75Tg
Login Sentinels¶
In order to access to Sentinel data a free registration is required at https://scihub.copernicus.eu/userguide/1SelfRegistration (other services may require different registrations). After the registration, enter the user name and password for accessing data.
- Service
: enter the service URL (default is https://scihub.copernicus.eu/apihub); other mirror services that share the same infrastructure can be used (such as https://scihub.copernicus.eu/dhus , https://finhub.nsdc.fmi.fi , https://data.sentinel.zamg.ac.at);
: reset the default service;
- User
: enter the user name;
- Password
: enter the password;
remember: remember user name and password in QGIS;
Search¶
Search parameters¶
Define the search area by entering the coordinates (longitude and latitude) of an Upper Left
(UL) point and Lower Right
(LR) point and select a product to search.
Optional settings are date of acquisition, maximum cloud cover, number of results (the less the results, the faster is the query).
The definition of a search area is required before searching the images.
UL
: set the UL longitude X (Lon) and the UL latitude Y (Lat);
LR
: set the LR longitude X (Lon) and the LR latitude Y (Lat);
: define a search area by left click to set the UL point and right click to set the LR point; the search area is displayed in the map;
Results
: maximum number of products returned by the search;
Filter
: set a filter such as the Product ID (e.g.
LC81910312015006LGN00
); it is possible to enter multiple Product IDs separated by comma or semicolon (e.g.LC81910312015006LGN00, LC81910312013224LGN00
); filter is applied to resulting products in the search area;Find
: find the products in the search area; results are displayed inside the table in Product list; results are added to previous results;
Add OpenStreetMap to the map: this button allows for the display of OpenStreetMap tiles (© OpenStreetMap contributors) in the QGIS map as described in https://wiki.openstreetmap.org/wiki/QGIS . The cartography is licensed as CC BY-SA (Tile Usage Policy );
Tip: Search results (and the number thereof) depend on the defined area extent and the range of dates. In order to get more results, perform multiple searches defining smaller area extent and narrow acquisition dates (from and to).
Product list¶
The table Product list contains the results of the search. Click on any item (highlight) to display the image preview thereof. Results are saved with the QGIS project.
Product list
: found products are displayed in this table, which includes the following fields;
- Product: the product name;
- ProductID: the product ID;
- AcquisitionDate: date of acquisition of product;
- CloudCover: percentage of cloud cover in the product;
- Zone/Path: the zone or WRS path depending on the product type;
- Row/DayNightFlag: the WRS row or acquisition flag(day or night) depending on the product type;
- min_lat: minimum latitude of the product;
- min_lon: minimum longitude of the product;
- max_lat: maximum latitude of the product;
- max_lon: maximum longitude of the product;
- Collection/Size: collection code or size depending on the product type;
- Preview: URL of the product preview;
- Collection/ID: collection or image ID depending on the product type;
- Collection/Image: collection or image ID depending on the product type;
: display preview of highlighted images in the map; preview is roughly georeferenced on the fly;
: remove highlighted images from the list;
: remove all images from the list;
: import the product list from a text file (i.e.
.txt
);: export the product list to a text file (i.e.
.txt
);
Download¶
Download the products in the Product list. During the download it is recommended not to interact with QGIS.
Only if preview in Layers: if checked, download only those images listed in Product list which are also listed in the QGIS layer panel;
Preprocess images: if checked, bands are automatically converted after the download, according to the settings defined in Landsat;
Load bands in QGIS: if checked, bands are loaded in QGIS after the download;
: export the download links to a text file;
- RUN
: start the download process of all the products listed in Product list;
Download options¶
This tab allows for the selection of single bands for Landsat, Sentinel-2, and Sentinel-3 images. Depending on the download service, single band download could be unavailable.
Preprocessing¶
The tab Preprocessing provides several tools for data manipulation which are useful before the actual classification process.
Landsat¶
This tab allows for the conversion of Landsat 1, 2, and 3 MSS and Landsat 4, 5, 7, and 8 images from DN (i.e. Digital Numbers) to the physical measure of Top Of Atmosphere reflectance (TOA), or the application of a simple atmospheric correction using the DOS1 method (Dark Object Subtraction 1), which is an image-based technique (for more information about the Landsat conversion to TOA and DOS1 correction, see Image conversion to reflectance). Pan-sharpening is also available; for more information read Pan-sharpening.
Once the input is selected, available bands are listed in the metadata table.
WARNING: For the best spectral precision you should download the Landsat Level-2 Data Products (Surface Reflectance) from https://earthexplorer.usgs.gov .
Landsat conversion to TOA reflectance and brightness temperature¶
- Directory containing Landsat bands
: open a directory containing Landsat bands; names of Landsat bands must end with the corresponding number; if the metadata file is included in this directory then Metadata are automatically filled;
- Select MTL file
: if the metadata file is not included in the Directory containing Landsat bands, select the path of the metadata file in order to fill the Metadata automatically;
Brightness temperature in Celsius: if checked, convert brightness temperature to Celsius (if a Landsat thermal band is listed in Metadata); if unchecked temperature is in Kelvin;
Apply DOS1 atmospheric correction: if checked, the DOS1 Correction is applied to all the bands (thermal bands excluded);
only to blue and green bands: if checked (with Apply DOS1 atmospheric correction also checked), the DOS1 Correction is applied only to blue and green bands;
Use NoData value (image has black border)
: if checked, pixels having
NoData
value are not counted during conversion and the DOS1 calculation of DNmin; it is useful when image has a black border (usually pixel value = 0);Perform pan-sharpening: if checked, a Brovey Transform is applied for the Pan-sharpening of Landsat bands;
Create Band set and use Band set tools: if checked, the Band set is created after the conversion; also, the Band set is processed according to the tools checked in the Band set;
Metadata¶
All the bands found in the Directory containing Landsat bands are listed in the table Metadata. If the Landsat metadata file (a .txt or .met file with the suffix MTL) is provided, then Metadata are automatically filled. For information about Metadata fields read this page and this one .
- Satellite
: satellite name (e.g. Landsat8);
- Date
: date acquired (e.g. 2013-04-15);
- Sun elevation
: Sun elevation in degrees;
- Earth sun distance
: Earth Sun distance in astronomical units (automatically calculated if Date is filled;
: remove highlighted bands from the table Metadata;
Metadata: table containing the following fields;
- Band: band name;
- RADIANCE_MULT: multiplicative rescaling factor;
- RADIANCE_ADD: additive rescaling factor;
- REFLECTANCE_MULT: multiplicative rescaling factor;
- REFLECTANCE_ADD: additive rescaling factor;
- RADIANCE_MAXIMUM: radiance maximum;
- REFLECTANCE_MAXIMUM: reflectance maximum;
- K1_CONSTANT: thermal conversion constant;
- K2_CONSTANT: thermal conversion constant;
- LMAX: spectral radiance that is scaled to QCALMAX;
- LMIN: spectral radiance that is scaled to QCALMIN;
- QCALMAX: minimum quantized calibrated pixel value;
- QCALMIN: maximum quantized calibrated pixel value;
Run¶
Sentinel-2¶
This tab allows for the conversion of Sentinel-2 images Level-1C to the physical measure of Top Of Atmosphere reflectance (TOA), or the application of a simple atmospheric correction using the DOS1 method (Dark Object Subtraction 1), which is an image-based technique (for more information about conversion to TOA and DOS1 correction, see Image conversion to reflectance). This tool can also convert Sentinel-2 images Level-2A from DN to reflectance values.
Once the input is selected, available bands are listed in the metadata table. Bands with 20m spatial resolution are resampled to 10m resolution without changing the original pixel value (i.e. one 20m pixel is divided in four 10m pixels with the same value).
WARNING: For the best spectral precision you should download the Sentinel-2 Level-2A Products (Surface Reflectance) or use the official SNAP tool for atmospheric correction (see http://step.esa.int).
Sentinel-2 conversion¶
- Directory containing Sentinel-2 bands
: open a directory containing Sentinel-2 bands; names of Sentinel-2 bands must end with the corresponding number; if the metadata file is included in this directory then Metadata are automatically filled;
- Select metadata file
: select the metadata file which is a .xml file whose name contains
MTD_MSIL1C
); Apply DOS1 atmospheric correction: if checked, the DOS1 Correction is applied to all the bands;
only to blue and green bands: if checked (with Apply DOS1 atmospheric correction also checked), the DOS1 Correction is applied only to blue and green bands;
Use NoData value (image has black border)
: if checked, pixels having
NoData
value are not counted during conversion and the DOS1 calculation of DNmin; it is useful when image has a black border (usually pixel value = 0);Create Band set and use Band set tools: if checked, the active Band set is created after the conversion; also, the Band set is processed according to the tools checked in the Band set;
Add bands in a new Band set: if checked, bands are added to a new empty Band set;
Metadata¶
All the bands found in the Directory containing Sentinel-2 bands are listed in the table Metadata.
If the Sentinel-2 metadata file (a .xml file whose name contains MTD_MSIL1C
) is provided, then Metadata are automatically filled.
For information about Metadata fields read this informative page .
Run¶
Sentinel-3¶
This tab allows for the conversion of Sentinel-3 images (OL_1_EFR) to the physical measure of Top Of Atmosphere reflectance (TOA), or the application of a simple atmospheric correction using the DOS1 method (Dark Object Subtraction 1), which is an image-based technique (for more information about conversion to TOA and DOS1 correction, see Image conversion to reflectance).
The following ancillary data are required for conversion: instrument_data.nc
, geo_coordinates.nc
, tie_geometries.nc
.
Once the input is selected, available bands are listed in the metadata table.
WARNING: Sentinel-3 bands are reprojected to WGS 84 coordinate system using a sample of pixels from the file geo_coordinates.nc . For the best precision you should use the official SNAP tool (see http://step.esa.int).
Sentinel-3 conversion¶
- Directory containing Sentinel-3 bands
: open a directory containing Sentinel-3 bands; names of Sentinel-2 bands must end with the corresponding number; ancillary data required for conversion must be in the same directory;
Apply DOS1 atmospheric correction: if checked, the DOS1 Correction is applied to all the bands;
only to blue and green bands: if checked (with Apply DOS1 atmospheric correction also checked), the DOS1 Correction is applied only to blue and green bands;
Use NoData value (image has black border)
: if checked, pixels having
NoData
value are not counted during conversion and the DOS1 calculation of DNmin; it is useful when image has a black border (usually pixel value = 0);Create Band set and use Band set tools: if checked, the Band set is created after the conversion; also, the Band set is processed according to the tools checked in the Band set;
Metadata¶
All the bands found in the Directory containing Sentinel-3 bands are listed in the table Metadata.
Run¶
ASTER¶
This tab allows for the conversion of ASTER L1T images to the physical measure of Top Of Atmosphere reflectance (TOA), or the application of a simple atmospheric correction using the DOS1 method (Dark Object Subtraction 1), which is an image-based technique (for more information about conversion to TOA and DOS1 correction, see Image conversion to reflectance).
Once the input is selected, available bands are listed in the metadata table.
ASTER conversion¶
- Select file ASTER L1T
: select an ASTER image (file .hdf);
Apply DOS1 atmospheric correction: if checked, the DOS1 Correction is applied to all the bands;
only to green band: if checked (with Apply DOS1 atmospheric correction also checked), the DOS1 Correction is applied only to green band;
Use NoData value (image has black border)
: if checked, pixels having
NoData
value are not counted during conversion and the DOS1 calculation of DNmin; it is useful when image has a black border (usually pixel value = 0);Create Band set and use Band set tools: if checked, the Band set is created after the conversion; also, the Band set is processed according to the tools checked in the Band set;
Metadata¶
All the bands found in the Select file ASTER L1T are listed in the table Metadata. For information about Metadata fields visit the ASTER page .
- Date
: date acquired (e.g. 20130415);
- Sun elevation
: Sun elevation in degrees;
- Earth sun distance
: Earth Sun distance in astronomical units (automatically calculated if Date is filled;
- UTM zone
: UTM zone code of the image;
- UPPERLEFTM
: coordinates of the upper left corner of the image;
: remove highlighted bands from the table Metadata;
Run¶
MODIS¶
This tab allows for the conversion of MODIS images to .tif format, and the reprojection to WGS 84.
Once the input is selected, available bands are listed in the metadata table.
MODIS conversion¶
- Select file MODIS
: select a MODIS image (file .hdf);
Reproject to WGS 84: if checked, reproject bands to WGS 84, required for use in SCP;
Use NoData value (image has black border)
: if checked, pixels having
NoData
value are not counted during conversion and the DOS1 calculation of DNmin; it is useful when image has a black border (usually pixel value = 0);Create Band set and use Band set tools: if checked, the Band set is created after the conversion; also, the Band set is processed according to the tools checked in the Band set;
Metadata¶
All the bands found in the Select file MODIS are listed in the table Metadata. For information about Metadata fields visit the MODIS page .
Run¶
Vector to raster¶
This tab allows for the conversion of a vector to raster format.
- Select the vector
: select a vector already loaded in QGIS;
: refresh layer list;
Use the value field of the vector
: if checked, the selected field is used as attribute for the conversion; pixels of the output raster have the same values as the vector attribute;
Use constant value
: if checked, the polygons are converted to raster using the selected constant value;
- Select the type of conversion
: select the type of conversion between Center of pixels and All pixels touched:
- Center of pixels: during the conversion, vector is compared to the reference raster; output raster pixels are attributed to a polygon if pixel center is within that polygon;
- All pixels touched: during the conversion, vector is compared to the reference raster; output raster pixels are attributed to a polygon if pixel touches that polygon;
- Select the type of conversion
- Select the reference raster
: select a reference raster; pixels of the output raster have the same size and alignment as the reference raster;
: refresh layer list;
Run¶
Clip multiple rasters¶
This tab allows for cutting several image bands at once, using a rectangle defined with point coordinates or a boundary defined with a vector.
Raster list¶
Clip coordinates¶
Set the Upper Left (UL) and Lower Right (LR) point coordinates of the rectangle used for clipping; it is possible to enter the coordinates manually. Alternatively use a vector.
- UL X
: set the UL X coordinate;
- UL Y
: set the UL Y coordinate;
- LR X
: set the LR X coordinate;
- LR Y
: set the LR Y coordinate;
Show: show or hide the clip area drawn in the map;
: define a clip area by drawing a rectangle in the map; left click to set the UL point and right click to set the LR point; the area is displayed in the map;
Use vector for clipping
: if checked, use the selected vector (already loaded in QGIS) for clipping; UL and LR coordinates are ignored;
Use vector field for output name
: if checked, a vector field is selected for clipping while iterating through each vector polygon and the corresponding field value is added to the output name;
Use temporary ROI for clipping: if checked, use a temporary ROI (see ROI Signature list) for clipping; UL and LR coordinates are ignored;
: refresh layer list;
NoData value
: if checked, set the value for
NoData
pixels (e.g. pixels outside the clipped area);- Output name prefix
: set the prefix for output file names (default is
clip
);
Run¶
- RUN
: choose an output destination and clip selected rasters; only rasters selected in the Raster list are clipped and automatically loaded in QGIS;
Mosaic band sets¶
This tool allows for the mosaic of band sets, merging the corresponding bands of two or more band sets defined in the Band set. An output band is created for every corresponding set of bands in the band sets.
NoData
values of one band set are replaced by the values of the other band sets.
Mosaic of band sets¶
- Band set list
: list if band sets defined in the Band set; in case of overlapping images, the pixel values of the first band set in the list are assigned.
Use NoData value
: if checked, set the value of
NoData
pixels, ignored during the calculation;- Output name prefix
: set the prefix for output file names (default is
mosaic
);
Run¶
Cloud masking¶
This tool allows for cloud masking, based on the values of a raster mask, creating an output masked band for each band of the Band set.
NoData
is set in all the bands of the Band set for pixels corresponding to clouds.
Mask of band set¶
- Select input band set
: select the input Band set to be masked;
- Select the classification
: select a classification raster (already loaded in QGIS) which contains a cloud class;
: refresh layer list;
- Mask class values
: set the class values to be masked; class values must be separated by
,
and-
can be used to define a range of values (e.g.1, 3-5, 8
will select classes 1, 3, 4, 5, 8); if the text is red then the expression contains errors; Use buffer of pixel size
: if checked, a buffer is created for masked area, corresponding to the defined number of pixels; this can be useful to dilate masked area in case the mask doesn’t cover the thinner border of clouds;
- NoData value: set the value of
NoData
pixels, corresponding to clouds; - Output name prefix
: set the prefix for output file names (default is
mask
);
Run¶
Band processing¶
The tab Band processing provides several functions that can be applied to the Band set.
Band combination¶
This tab allows for the combination of bands loaded in a Band set. This tool is intended for combining classifications in order to get a raster where each value corresponds to a combination of class values. A combination raster is produced as output and the area of each combination is reported in an text file.
Run¶
PCA¶
This tab allows for the PCA (Principal Component Analysis) of bands loaded in the Band set.
Principal Component Analysis of Band set¶
- Select input band set
: select the input Band set;
Number of components
: if checked, set the number of calculated components; if unchecked, all the components are calculated;
Use NoData value
: if checked, set the value of
NoData
pixels, ignored during the calculation;
Run¶
Clustering¶
This tab allows for the Clustering of a Band set. In particular, K-means and ISODATA methods are available.
Clustering of band set¶
- Select input band set
: select the input Band set;
- Method
K-means
ISODATA: select the clustering method K-means or ISODATA;
Distance threshold
: if checked, for K-means: iteration is terminated if distance is lower than threshold; for ISODATA: signatures are merged if distance is greater than threshold;
- Number of classes
: number of desired output classes;
- Max number of iterations
: maximum number of iterations if Distance threshold is not reached;
- ISODATA max standard deviation
: maximum standard deviation considered for splitting a class, for ISODATA algorithm only;
- ISODATA minimum class size in pixels
: desired minimum class size in pixels, for ISODATA algorithm only;
Use NoData value
: if checked, set the value of
NoData
pixels, ignored during the calculation;
Seed signatures¶
Seed signatures from band values
Use Signature list as seed signatures
Use random seed signatures: select one options for seed signatures that start the iteration; the option Seed signatures from band values divides the spectral space of the Band set to get spectral signatures; the option Use Signature list as seed signatures uses the spectral signatures checked in ROI Signature list; the option Use random seed signatures randomly selects the spectral signatures of pixels in the Band set;
- Distance algorithm
Minimum Distance
Spectral Angle Mapping: select Minimum Distance or * Spectral Angle Mapping for spectral distance calculation;
Save resulting signatures to Signature list: if checked, save the resulting spectral signatures in the ROI Signature list;
Run¶
Spectral distance¶
This tab allows for calculating the spectral distance between every corresponding pixel of two band sets. The output is a raster containing the spectral distance of each pixel. Optionally, a threshold can be defined for creating a binary raster of values below and above the threshold.
Spectral distance of band sets¶
- Select first input band set
: select the first input Band set;
- Select second input band set
: select the second input Band set;
- Distance algorithm
Minimum Distance
Spectral Angle Mapping: select Minimum Distance or * Spectral Angle Mapping for spectral distance calculation;
Distance threshold
: if checked, a binary raster of values below and above the threshold is created;
Run¶
Postprocessing¶
The tab Postprocessing provides several functions that can be applied to the classification output.
Accuracy¶
This tab allows for the validation of a classification (read Accuracy Assessment ). Classification is compared to a reference raster or reference vector (which is automatically converted to raster). If a vector is selected as reference, it is possible to choose a field describing class values.
Several statistics are calculated such as overall accuracy, user’s accuracy, producer’s accuracy, and Kappa hat. In particular, these statistics are calculated according to the area based error matrix where each element represents the estimated area proportion of each class. This allows for estimating the unbiased user’s accuracy and producer’s accuracy, the unbiased area of classes according to reference data, and the standard error of area estimates.
The output is an error raster
that is a .tif
file showing the errors in the map, where pixel values represent the categories of comparison (i.e. combinations identified by the ErrorMatrixCode
in the error matrix) between the classification and reference.
Also, a text file containing the error matrix (i.e. a .csv
file separated by tab) is created with the same name defined for the .tif
file.
Input¶
- Select the classification to assess
: select a classification raster (already loaded in QGIS);
: refresh layer list;
- Select the reference vector or raster
: select a raster or a vector (already loaded in QGIS), used as reference layer (ground truth) for the accuracy assessment;
: refresh layer list;
- Vector field
: if a vector is selected as reference, select a vector field containing numeric class values;
Run¶
Land cover change¶
The tab Land cover change
allows for the comparison between two classifications in order to assess land cover changes.
Output is a land cover change raster
(i.e. a file .tif showing the changes in the map, where each pixel represents a category of comparison (i.e. combinations) between the two classifications, which is the ChangeCode
in the land cover change statistics) and a text file containing the land cover change statistics (i.e. a file .csv separated by tab, with the same name defined for the .tif file).
Input¶
- Select the reference classification
: select a reference classification raster (already loaded in QGIS);
: refresh layer list;
- Select the new classification
: select a new classification raster (already loaded in QGIS), to be compared with the reference classification;
: refresh layer list;
Report unchanged pixels: if checked, report also unchanged pixels (having the same value in both classifications);
Run¶
Classification report¶
This tab allows for the calculation of class statistics such as number of pixels, percentage and area (area unit is defined from the image itself).
Input¶
Run¶
Cross classification¶
This tab allows for the calculation of a cross classification raster and matrix. Classification is compared to a reference raster or reference vector (which is automatically converted to raster). This is useful for calculating the area for every combination between reference classes and classification values. If a vector is selected as reference, it is possible to choose a field describing class values.
The output is a cross raster
that is a .tif
file where pixel values represent the categories of comparison (i.e. combinations identified by the CrossMatrixCode
) between the classification and reference.
Also, a text file containing the cross matrix (i.e. a .csv
file separated by tab) is created with the same name defined for the .tif
file.
Input¶
- Select the classification
: select a classification raster (already loaded in QGIS);
: refresh layer list;
Use NoData value
: if checked,
NoData
value will be excluded from the calculation;- Select the reference vector or raster
: select a raster or a vector (already loaded in QGIS), used as reference layer;
: refresh layer list;
- Vector field
: if a vector is selected as reference, select a vector field containing numeric class values;
Run¶
Class signature¶
This tab allows for the calculation of the mean spectral signature of each class in a classification using a Band set.
- Select the classification
: select a classification raster (already loaded in QGIS);
: refresh layer list;
- Select input band set
: select the input Band set for spectral signature calculation;
Save resulting signatures to Signature list: if checked, save the resulting spectral signatures to ROI Signature list;
Run¶
Classification to vector¶
This tab allows for the conversion of a classification raster to vector shapefile.
- Select the classification
: select a classification raster (already loaded in QGIS);
: refresh layer list;
Symbology¶
Use code from Signature list
: if checked, color and class information are defined from ROI Signature list:
MC ID
: use the ID of macroclasses;C ID
: use the ID of classes;
Run¶
Reclassification¶
This tab allows for the reclassification (i.e. assigning a new class code to raster pixels). In particular, it eases the conversion from C ID to MC ID values.
- Select the classification
: select a classification raster (already loaded in QGIS);
: refresh layer list;
Values¶
calculate C ID to MC ID values: if checked, the reclassification table is filled according to the ROI Signature list when Calculate unique values
is clicked;
- Calculate unique values
: calculate unique values in the classification and fill the reclassification table;
Values: table containing the following fields;
- Old value: set the expression defining old values to be reclassified;
Old value
can be a value or an expressions defined using the variable nameraster
(custom names can be defined in Variable name for expressions ), following Python operators (e.g.raster > 3
select all pixels having value > 3 ;raster > 5 | raster < 2
select all pixels having value > 5 or < 2 ;raster >= 2 & raster <= 5
select all pixel values between 2 and 5); - New value: set the new value for the old values defined in
Old value
;
- Old value: set the expression defining old values to be reclassified;
: add a row to the table;
: remove highlighted rows from the table;
Symbology¶
Use code from Signature list
: if checked, color and class information are defined from ROI Signature list:
MC ID
: use the ID of macroclasses;C ID
: use the ID of classes;
Run¶
Edit raster¶
This tab allows for the direct editing of pixel values in a raster. Only pixels beneath ROI polygons or vector polygons are edited.
Attention: the input raster is directly edited; it is recommended to create a backup copy of the input raster before using this tool in order to prevent data loss.
This tool can rapidly edit large rasters, especially when editing polygons are small, because pixel values are edited directly. In addition, the Pasek narzędzi Edycja SCP is available for easing the raster editing using multiple values.
Edit raster values¶
Edit options¶
Use the value field of the vector
: if checked, raster is edited using the selected vector (in Edit values using a vector) and the polygon values of selected vector field;
Use constant value
: if checked, raster is edited using the selected constant value;
Use expression
: if checked, raster is edited according to the entered expression; the expression must contain one or more
where
; accepted variable areraster
representing the input raster value andvector
representing the vector value if selected; the following example expressionwhere(raster == 1, 2, raster)
is already entered, which sets 2 whereraster
equals 1, and leaves unchanged the values whereraster
is not equal to 1;
Run¶
Classification sieve¶
This tab allows for the replacement of isolated pixel values with the value of the largest neighbour patch (based on GDAL Sieve ). It is useful for removing small patches from a classification.
- Select the classification
: select a raster (already loaded in QGIS);
: refresh layer list;
- Size threshold
: size of the patch to be replaced (in pixel unit); all patches smaller the the selected number of pixels will be replaced by the value of the largest neighbour patch;
Run¶
Classification erosion¶
This tab allows for removing the border of a class patch (erosion), defining the class values to be eroded and the number of pixels from the border. It is useful for classification refinement.
- Select the classification
: select a raster (already loaded in QGIS);
: refresh layer list;
- Class values
: set the class values to be eroded; class values must be separated by
,
and-
can be used to define a range of values (e.g.1, 3-5, 8
will select classes 1, 3, 4, 5, 8); if the text is red then the expression contains errors; - Size in pixels
: number of pixels to be eroded from the border;
Run¶
Classification dilation¶
This tab allows for dilating the border of a class patch, defining the class values to be dilated and the number of pixels from the border. It is useful for classification refinement.
- Select the classification
: select a raster (already loaded in QGIS);
: refresh layer list;
- Class values
: set the class values to be dilated; class values must be separated by
,
and-
can be used to define a range of values (e.g.1, 3-5, 8
will select classes 1, 3, 4, 5, 8); if the text is red then the expression contains errors; - Size in pixels
: number of pixels to be dilated from the border;
Run¶
Band calc¶
The Band calc
allows for the raster calculation for bands (i.e. calculation of pixel values) using NumPy functions .
Raster bands must be already loaded in QGIS.
Input rasters must be in the same projection.
In addition, it is possible to calculate a raster using decision rules.
Expression¶
Enter a mathematical expression for raster bands.
In particular, NumPy functions can be used with the prefix np. (e.g. np.log10(raster1)
).
For a list of NumPy functions see the NumPy page .
The expression can work with both Variable and Band name (between double quotes).
Also, bands in the Band set can be referenced directly; for example bandset#b1
refers to band 1 of the Band set.
Double click on any item in the Band list for adding its name to the expression.
In addition, the following variables related to Band set the are available:
- „#BLUE#”: the band with the center wavelength closest to 0.475 \(\mu m\);
- „#GREEN#”: the band with the center wavelength closest to 0.56 \(\mu m\);
- „#RED#”: the band with the center wavelength closest to 0.65 \(\mu m\);
- „#NIR#”: the band with the center wavelength closest to 0.85 \(\mu m\);
Variables for output name are available:
- #BANDSET#: the name of the first band in the Band set;
- #DATE#: the current date and time (e.g. 20161110_113846527764);
If text in the Expression is green, then the syntax is correct; if text is red, then the syntax is incorrect and it is not possible to execute the calculation.
It is possible to enter multiple expressions separated by newlines such as the following example:
"raster1" + "raster2"
"raster3" - "raster4"
The above example calculates two new rasters in the output directory with the suffix _1
(e.g. calc_raster_1
) for the first expression and _2
(e.g. calc_raster_2
) for the second expression.
Also, it is possible to define the output name using the symbol @
followed by the name, such as the following example:
"raster1" + "raster2" @ calc_1
"raster3" - "raster4" @ calc_2
The following buttons are available:
- +: plus;
- -: minus;
- *: product;
- /: ratio;
- ^: power;
- V: square-root;
- (: open parenthesis;
- ): close parenthesis;
- >: greater then;
- <: less then;
- ln: natural logarithm;
- π: pi;
- ==: equal;
- !=: not equal;
- sin: sine;
- asin: inverse sine;
- cos: cosine;
- acos: inverse cosine;
- tan: tangent;
- atan: inverse tangent;
- where: conditional expression according to the syntax
where( condition , value if true, value if false)
(e.g.where("raster1" == 1, 2, "raster1")
); - exp: natural exponential;
- nodata: NoData value of raster (e.g.
nodata("raster1")
); it can be used as value in the expression (e.g.where("raster1" == nodata("raster1"), 0, "raster1")
);
Index calculation¶
Index calculation allows for entering a spectral index expression (see Spectral Indices).
- Index calculation
: list of spectral indices:
- NDVI: if selected, the NDVI calculation is entered in the Expression (
(( "#NIR#" - "#RED#") / ( "#NIR#" + "#RED#") @ NDVI)
); - EVI: if selected, the EVI calculation is entered in the Expression (
2.5 * ( "#NIR#" - "#RED#" ) / ( "#NIR#" + 6 * "#RED#" - 7.5 * "#BLUE#" + 1) @ EVI
);
- NDVI: if selected, the NDVI calculation is entered in the Expression (
- Index calculation
: open a text file (.txt) containing custom expressions to be listed in Index calculation; the text file must contain an expression for each line; each line must be in the form
expression_name; expression
(separated by;
) where theexpression_name
is the expression name that is displayed in the Index calculation; if you open an empty text file, the default values are restored; following an example of text content:NDVI; ( "#NIR#" - "#RED#" ) / ( "#NIR#" + "#RED#" ) @NDVI EVI; 2.5 * ( "#NIR#" - "#RED#" ) / ( "#NIR#" + 6 * "#RED#" - 7.5 * "#BLUE#" + 1) @EVI SR; ( "#NIR#" / "#RED#" ) @SR
Decision rules¶
Decision rules allows for the calculation of an output raster based on rules. Rules are conditional statements based on other rasters; if the Rule is true, the corresponding Value is assigned to the output pixel.
Rules are verified from the first to the last row in the table; if the first Rule is false, the next Rule is verified for that pixel, until the last rule.
If multiple rules are true for a certain pixel, the value of the first Rule is assigned to that pixel.
The NoData
value is assigned to those pixels where no Rule is true.
Decision rules: table containing the following fields;
- Value: the value assigned to pixels if the Rule is true;
- Rule: the rule to be verified (e.g.
"raster1" > 0
); multiple conditional statements can be entered separated by;
(e.g."raster1" > 0; "raster2" < 1
which means to set the Value whereraster1
> 0 andraster2
< 1);
: move highlighted rule up;
: move highlighted rule down;
: add a new row to the table;
: delete the highlighted rows from the table;
: clear the table;
: export the rules to a text file that can be imported later;
: import rules from a text file;
Output raster¶
The output raster is a .tif file, with the same spatial resolution and projection of input rasters; if input rasters have different spatial resolutions, then the highest resolution (i.e. minimum pixel size) is used for output raster.
Use NoData value
: if checked, set the value of
NoData
pixels in output raster;- Extent: if the following options are unchecked, the output raster extent will include the extents of all input rasters;
Align: if checked, and
Same as is checked selecting a raster, the calculation is performed using the same extent and pixel alignment of selected raster;
- RUN
: if
Expression
is active and text is green, choose the output destination and start the calculation based onExpression
; ifDecision rules
is active and text is green, choose the output destination and start the calculation based onDecision rules
;
Batch¶
This tab allows for the automatic execution (batch) of several SCP functions using a scripting interface.
Batch¶
Enter a batch expression; each function must be in a new line. Functions have the following structure:
function name
;function options
Each function has options, identified by a name, with the following structure:
option name
:option argument
Options must be separated by the character ;
.
Each function option represents an option in the corresponding interface of SCP; option arguments of type text must be between the character '
; in case of checkboxes, the value 1 represents checked, while the value 0 represents unchecked.
A new line beginning with #
can be used for commenting.
According to the function, some of the options are mandatory while other options can be omitted from the expression. Option names that contain path
require the full path to a file.
Some options require multiple arguments such as lists; lists must be separated by ,
.
If the expression contains errors, the text is red. An expression check label is displayed with a brief description of the error.
: clear the expression;
: export the batch expression to a file;
: import a previously saved batch expression from file;
- A table Functions is displayed at the right side; double click to insert a function in the expression; the following functions are available with the corresponding options:
- Accuracy: calculate accuracy (
accuracy;classification_file_path : '';reference_file_path : '';shapefile_field_name : '';output_raster_path : ''
); - ASTER: ASTER conversion (
aster_conversion;input_raster_path : '';celsius_temperature : 0;apply_dos1 : 0;use_nodata : 1;nodata_value : 0;create_bandset : 1;output_dir : ''
); - Band calc: band calculation (
band_calc;expression : '';output_raster_path : '';extent_same_as_raster_name : '';extent_intersection : 1;set_nodata : 0;nodata_value : 0
); - Band combination: band combination (
band_combination;band_set : 1;output_raster_path : ''
); - Class signature: class signature (
class_signature;input_raster_path : '';band_set : 1;save_signatures : 1;output_text_path : ''
); - Classification output: perform classification (
classification;use_macroclass : 0;algorithm_name : 'Minimum Distance';use_lcs : 0;use_lcs_algorithm : 0;use_lcs_only_overlap : 0;apply_mask : 0;mask_file_path : '';vector_output : 0;classification_report : 0;save_algorithm_files : 0;output_classification_path : ''
); - Classification dilation: dilation of a classification (
classification_dilation;input_raster_path : '';class_values : '';size_in_pixels : 1;pixel_connection : 4;output_raster_path : ''
); - Classification erosion: erosion of a classification (
classification_erosion;input_raster_path : '';class_values : '';size_in_pixels : 1;pixel_connection : 4;output_raster_path : ''
); - Classification report: report of a classification (
classification_report;input_raster_path : '';use_nodata : 0;nodata_value : 0;output_report_path : ''
); - Classification sieve: classification sieve(
classification_sieve;input_raster_path : '';size_threshold : 2;pixel_connection : 4;output_raster_path : ''
); - Classification to vector: convert classification to vector (
classification_to_vector;input_raster_path : '';use_signature_list_code : 1;code_field : 'C_ID';output_vector_path : ''
); - Clip multiple rasters: clip multiple rasters (
clip_multiple_rasters;input_raster_path : '';output_dir : '';use_shapefile : 0;shapefile_path : '';ul_x : '';ul_y : '';lr_x : '';lr_y : '';nodata_value : 0;output_name_prefix : 'clip'
); - Cloud masking: cloud masking (
cloud_masking;band_set : 1;input_raster_path : '';class_values : '';use_buffer : 1;size_in_pixels : 1;nodata_value : 0;output_name_prefix : 'mask';output_dir : ''
); - Clustering: clustering (
clustering;band_set : 1;clustering_method : 1;use_distance_threshold : 1;threshold_value : 0.0001;number_of_classes : 10;max_iterations : 10;isodata_max_std_dev : 0.0001;isodata_min_class_size : 10;use_nodata : 0;nodata_value : 0;seed_signatures : 1;distance_algorithm : 1;save_signatures : 0;output_raster_path : ''
); - Cross classification: cross classification (
cross_classification;classification_file_path : '';use_nodata : 0;nodata_value : 0;reference_file_path : '';shapefile_field_name : '';output_raster_path : ''
); - Edit raster: edit raster values using a shapefile); (
edit_raster_using_shapefile;input_raster_path : '';input_vector_path : '';vector_field_name : '';constant_value : 0;expression : 'where(raster == 1, 2, raster)'
); - Land cover change: calculate land cover change (
land_cover_change;reference_raster_path : '';new_raster_path : '';output_raster_path : ''
); - Landsat: Landsat conversion (
landsat_conversion;input_dir : '';mtl_file_path : '';celsius_temperature : 0;apply_dos1 : 0;use_nodata : 1;nodata_value : 0;pansharpening : 0;create_bandset : 1;output_dir : ''
); - MODIS: MODIS conversion (
modis_conversion;input_raster_path : '';reproject_wgs84 : 1;use_nodata : 1;nodata_value : -999;create_bandset : 1;output_dir : ''
); - PCA: Principal Component Analysis (
pca;use_number_of_components : 0, number_of_components : 2;use_nodata : 1;nodata_value : 0;output_dir : ''
); - Reclassification: raster reclassification (
reclassification;input_raster_path : '';value_list : 'oldVal-newVal;oldVal-newVal';use_signature_list_code : 1;code_field : 'MC_ID';output_raster_path : ''
); - Sentinel-2: Sentinel-2 conversion (
sentinel2_conversion;input_dir : '';mtd_safl1c_file_path : '';apply_dos1 : 0;use_nodata : 1;nodata_value : 0;create_bandset : 1;output_dir : ''
); - Sentinel-3: Sentinel-3 conversion (
sentinel3_conversion;input_dir : '';apply_dos1 : 0;dos1_only_blue_green : 1;use_nodata : 1;nodata_value : 0;create_bandset : 1;output_dir : '';band_set : 1
); - Spectral distance: spectral distance of band sets (
spectral_distance;first_band_set : 1;second_band_set : 2;distance_algorithm : 1;use_distance_threshold : 1;threshold_value : 0.1;output_dir : ''
); - Split raster bands: split raster to single bands (
split_raster_bands;input_raster_path : '';output_dir : '';output_name_prefix : 'split'
); - Stack raster bands: stack rasters into a single file (
stack_raster_bands;input_raster_path : '';output_raster_path : ''
); - Vector to raster: convert vector to raster (
vector_to_raster;vector_file_path : '';use_value_field : 1;vector_field_name : '';constant_value : 1;reference_raster_path : '';type_of_conversion : 'Center of pixels';output_raster_path : ''
);
- Accuracy: calculate accuracy (
- In addition, the following functions are available:
- Add a new band set: add a new empty band set (
add_new_bandset;
); - Add raster to QGIS: add a raster to QGIS (
add_raster;input_raster_path : '';input_raster_name : ''
); - Create band set: create a Band set assigning bands (
create_bandset;raster_path_list : '';center_wavelength : '';wavelength_unit : 1;multiplicative_factor : '';additive_factor : ''
); - Open training input: open a training input file (
open_training_input;training_file_path : ''
); - Remove band set: remove a band set by the number thereof (
remove_bandset;band_set : 1
); - Select band set: select a band set (active band set) by the number thereof (
select_bandset;band_set : 1
); - Set working directory: set a working directory (argument is the path to a directory) (
!working_dir!;''
);
- Add a new band set: add a new empty band set (
If a working directory is defined, !working_dir!
can be entered in other functions where a path is required (e.g. add_raster;input_raster_path : '!working_dir!/raster1.tif';input_raster_name : 'raster1.tif'
);
An example of batch expression is:
!working_dir!; '/home/user/Desktop/temp/'
add_raster;input_raster_path : '!working_dir!/raster1.tif';input_raster_name : 'raster1.tif'
band_calc;expression : 'where("raster1.tif" > 1, 1,0)';output_raster_path : '!working_dir!/calc1.tif';set_nodata : 1;nodata_value : 0
band_calc;expression : '"raster1.tif" * "calc1.tif"';output_raster_path : '!working_dir!/calc2.tif';extent_intersection : 0
Settings¶
The tab Settings allows for the customization of SCP.
Processing¶
Classification process¶
Play sound when finished
: if checked, play a sound when the classification process is completed;
Use virtual rasters for temp files
: if checked, create virtual rasters for certain temporary files, instead of creating real rasters; it is useful for reducing disk space usage during calculations;
Raster compression
: if checked, a lossless compression (DEFLATE or PACKBITS) is applied to raster outputs in order to save disk space; it is recommended to check this option, however compressed files are sometimes larger than files without compression;
SMTP process notification¶
- SMTP server
: the SMTP server to login for sending a notification email when all the SCP processes are finished (a notification is sent also in case of error, but not in case of crash);
- user
: the SMTP server user;
- password
: the SMTP server password;
- Send email of completed process to
: a list of addresses (separated by comma) to send the notification email to;
RAM¶
Temporary directory¶
Interface¶
Customization of the interface.
Field names of training input¶
Set the names of fields in the Training input . Changing field names should usually be avoided.
- MC ID field
: name of the Macroclass ID field (default is
MC_ID
); - MC Info field
: name of the Macroclass Information field (default is
MC_info
); - C ID field
: name of the Class ID field (default is
C_ID
); - C Info field
: name of the Class Information field (default is
C_info
); : reset field names to default;
ROI style¶
Change ROI color and transparency for a better visualization of temporary ROIs on the map.
Variable name for expressions¶
Set the variable name used in expressions of the Reclassification and Edit raster .
Temporary group name¶
Set the temporary group name in QGIS Layers used for temporary layers .
Dock¶
Debug¶
Debugging utilities for the creation of a Log file (i.e. recording of SCP activities for reporting issues) and testing SCP dependencies.
http://www.youtube.com/watch?v=So04gNzDC9Y
If you found a plugin error, please read W jaki sposób mogę zgłosić błąd? .
Log file¶
Test¶
Wykres sygnatur widmowych¶
Okno Wykres sygnatur widmowych`zawiera kilka funkcji dla wyświetlania wartości sygnatur widmowych jako w funkcji długości fali (zdefiniowanej w :ref:`band_set_tab). Sygnatury mogą zostać dodane do Wykresu sygnatur widmowych
poprzez SCP dock.
Okno Spectral Signature Plot zawiera również niektóre funkcje użyteczne do definiowania przedziałów wartości używanych przez Land Cover Signature Classification (zobacz w LCS threshold).
Pokrywające się sygnatury (należące do różnych klas lub makroklas) są podświetlane na pomarańczowo w tabeli Lista sygnatur w wykresie; sprawdzanie pokrycia jest wykonywane biorąc pod uwagę MC ID i C ID zgodniez ustawieniem użyj MC ID
C ID w Algorithm. Pokrywające się sygnatury mające to samo ID nie są podświetlane.
Lista sygnatur w wykresie¶
Lista sygnatur:
- S: pole checkbox; jeśli zaznaczone, charakterystyka widmowa jest wyświetlana na wykresie;
- MC ID: Identyfikator makroklasy sygnatury;
- MC Info: Informacja o makroklasie sygnatury;
- C ID: ID klasy sygnatury;
- C Info: Informacja o klasie sygnatury;
- Kolor [nachodzące MC_ID-C_ID]: kolor sygnatury; również kombinacja MC ID-C ID jest wyświetlana jeśli zachodzi nakładanie z innymi sygnaturami (zobacz Land Cover Signature Classification);
- Min B
X
: minimum wartości w kanaleX
; ta wartość może być zmieniona; - Max B
X
: maksimum wartości w kanaleX
; ta wartość może być zmieniona;
: usuń zaznaczone sygnatury z listy;
: add highlighted spectral signatures to ROI Signature list;
: calculate the spectral distances of spectral signatures displayed in the plot; distances are reported in the tab Odległości widmowe;
Automatyczne progi¶
Ustaw progi automatycznie dla podświetlonych sygnatur w tabeli Lista sygnatur w wykresie; jeśli żadna sygnatura nie jest podświetlona, progi są stosowane dla wszystkich sygnatur.
Wykres¶
Left click and hold inside the plot to move the view of the plot. Use the mouse wheel to zoom in and out the view of the plot. Right click and hold inside the plot to zoom in a specific area of the plot. Legend inside the plot can be moved using the mouse.
Plot commands:
: automatycznie dopasuj wykres do danych;
: zapisz obraz wykresu do pliku (dostępne formaty to
.jpg
,.png
, and.pdf
);: activate the cursor for interactively changing the value range of highlighted signatures in the plot; click the plot to set the minimum or maximum value of a band (also for several signatures simultaneously); cursor is deactivated when moving outside the plot area;
Wyrysuj zakres wartości: jeśli zaznaczono, wyrysuj zakres wartości dla każdej sygnatury (obszar półprzezroczysty);
Linie kanałów: jeśli zaznaczono, wyświetlaj pionowe linie dla każdego z kanałów (centralna długość fali);
Siatka: jeśli zaznaczono, wyświetlaj siatkę;
- Maksymalna ilość znaków
: ustaw maksymalną długość tekstu legendy;
- x y: wyświetl współrzędne x y kursora myszy wewnątrz wykresu;
Szczegóły sygnatury¶
Display the details about spectral signatures (i.e. Wavelength, Values, and Standard deviation). In case of signatures calculated from ROIs, the ROI size (number of pixels) is also displayed.
Odległości widmowe¶
Wyświetl odległości widmowe sygnatur (zobacz Lista sygnatur w wykresie), mogą być użyteczne w uzyskaniu rozróżnialności OT (zobacz Spectral Distance).
- Następujące odległości widmowe są wyliczane :
- Jeffries-Matusita Distance: zakres [0 = identyczne, 2 = różne]; użyteczne głównie w Maximum Likelihood classifications;
- Spectral Angle: zakres [0 = identyczne, 90 = różne]; użyteczne szczególnie w Spectral Angle Mapping classifications;
- Euclidean Distance: użyteczne głównie w Minimum Distance classifications;
- Bray-Curtis Similarity: zakres [0 = różne, 100 = identyczne]; użyteczne wszędzie;
Wartości wyświetlane są na czerwono, jeśli sygnatury są bardzo podobne.
Wykres punktowy¶
Okno Wykres punktowy wyświetla wartości pikseli dwóch rastrów dla kanałów w postaci punktów przestrzeni 2D. Wykres punktowy jest przydatny w ocenie rozróżnialności obszarów treningowych pomiędzy dwoma kanałami.
Funkcje opisane są szczegółowo w następnych akapitach.
Lista próbek¶
Lista próbek:
- S: pole checkbox; jeśli zaznaczone, charakterystyka widmowa jest wyświetlana na wykresie;
- MC ID: Identyfikator makroklasy sygnatury;
- MC Info: Informacja o makroklasie sygnatury;
- C ID: ID klasy sygnatury;
- C Info: Informacja o klasie sygnatury;
- Color: pole koloru; dwukrotnie kliknij aby wybrać kolor wykresu;
Oblicz
: oblicz wykres punktowy dla obszarów treningowych zaznaczonych na liście;
: dodaj tymczasowy wykres punktowy (jako
MC Info = tempScatter
) i rozpocznij obliczenia tymczasowego OT (zobacz Working toolbar);: dodaj tymczasowy wykres punktowy do listy (jako
MC Info = tempScatter
) i rozpocznij obliczenia dla pikseli w obecnym zasięgu wyświetlanym;: dodaj tymczasowy wykres punktowy do listy (jako
MC Info = tempScatter
) i rozpocznij obliczenia dla całego obrazu;OSTRZEŻENIE: Używanie zbyt wysokich wartości precyzji może skutkować bardzo wolnymi obliczeniami albo błędem.
Raster z wykresu punktowego¶
To narzędzie pozwala na rysowanie poligonów zaznaczenia w wykresie punktowym; te poligony zaznaczenia są używanedo tworzenia Scatter raster który jest tymczasowym sklasyfikowanym rastrem dopasowanym do przecięcia danych wykresu punktowego i narysowanych poligonów.
Piksele aktywnego zestawu kanału są klasyfikowane, w odniesieniu do kanałów wykresu punktowego, jeśli wartości pikseli są w przecięciu wykresu punktowego i poligonów zaznaczenia (poligony te nie powinny na siebie nachodzić). Wartości przypisane do pikseli Rastra z rozrzutu i kolejnym numerem poligonu zaznaczenia; również kolor w rastrze pobierany jest z poligonu zaznaczenia.
Po utworzeniu nowego Scatter raster, starsze rastry umieszczane są na warstwach QGIS wewnątrz grupy nazwanej``Grupa_tymczas_klas`` (własna nazwa może być wprowadzona w Temporary group name) i są usuwane gdy sesja QGIS zostanie zakończona.
: aktywuj kursor dla interaktywnego rysowania poligonu w wykresie; klikaj lewym klawiszem dla zdefiniowania segmentów poligonu, a prawym ostatni segment, aby zamknąć poligon;
- kolor: wybierz kolor poligonu (zostanie on później użyty w Rastrze rozrzutu);
: usuń wszystkie poligony zaznaczenia z wykresu;
: oblicz Scatter raster i wyświetl go na mapie;
: oblicz sygnatury widmowe Scatter raster (biorąc pod uwagę wszystkie sklasyfikowane piksele) używając aktywnego zestawu kanałów, i zapisz sygnatury do ROI Signature list;
Wykres¶
Naciśnij lewy klawisz myszy i przytrzymaj wewnątrz wykresu aby przesunąć widok wykresu. Użyj kółka myszy aby powiększać i pomniejszać wykres. Prawy klawisz służy do powiększenia wybranego obszaru wykresu.
- Paleta kolorów
: wybierz paletę kolorów która będzie zastosowana do podświetlonych klas na liście wykresu punktowego kiedy
zostanie kliknięty; jeśli żaden element wykresu nie jest podświetlony to paleta stosowana jest do całego wykresu punktowego;
: automatycznie dopasuj wykres do danych;
: zapisz obraz wykresu do pliku (dostępne formaty to
.jpg
,.png
, and.pdf
);- x y: wyświetl współrzędne x y kursora myszy wewnątrz wykresu;
Pasek narzędzi Edycja SCP¶

Narzędzia SCP
Pasek narzędzi Edycja SCP pozwala na bezpośrednią edycję wartości pikseli w rastrze zdefiniowanych w Edit raster używając poligonów ROI. Tylko piksele w poligonie ROI będą zmienione.
: otwórz narzędzie Pasek narzędzi Edycja SCP dla wybrania rastra wejściowego
: edytuj raster używając wybranej stałej wartości;
: edytuj raster używając wybranej stałej wartości;
: edytuj raster używając wybranej stałej wartości;
: wycofając ostatnią edycję rastra (dostępne jedynie gdy używaliśmy poligonów ROI);

Funkcje opisane w następnych akapitach używają takich konwencji:
= Konfiguracja zapisywana w aktywnym projekcie QGIS
Brief Introduction to Remote Sensing¶
Basic Definitions¶
This chapter provides basic definitions about GIS and remote sensing. For other useful resources see Darmowe i cenne zasoby poświęcone teledetekcji i GIS.
GIS definition¶
There are several definitions of GIS (Geographic Information Systems), which is not simply a program. In general, GIS are systems that allow for the use of geographic information (data have spatial coordinates). In particular, GIS allow for the view, query, calculation and analysis of spatial data, which are mainly distinguished in raster or vector data structures. Vector is made of objects that can be points, lines or polygons, and each object can have one ore more attribute values; a raster is a grid (or image) where each cell has an attribute value (Fisher and Unwin, 2005). Several GIS applications use raster images that are derived from remote sensing.
Remote Sensing definition¶
A general definition of Remote Sensing is „the science and technology by which the characteristics of objects of interest can be identified, measured or analyzed the characteristics without direct contact” (JARS, 1993).
Usually, remote sensing is the measurement of the energy that is emanated from the Earth’s surface. If the source of the measured energy is the sun, then it is called passive remote sensing, and the result of this measurement can be a digital image (Richards and Jia, 2006). If the measured energy is not emitted by the Sun but from the sensor platform then it is defined as active remote sensing, such as radar sensors which work in the microwave range (Richards and Jia, 2006).
The electromagnetic spectrum is „the system that classifies, according to wavelength, all energy (from short cosmic to long radio) that moves, harmonically, at the constant velocity of light” (NASA, 2013). Passive sensors measure energy from the optical regions of the electromagnetic spectrum: visible, near infrared (i.e. IR), short-wave IR, and thermal IR (see Figure Electromagnetic-Spectrum).

Electromagnetic-Spectrum
by Victor Blacus (SVG version of File:Electromagnetic-Spectrum.png)
[CC-BY-SA-3.0 (http://creativecommons.org/licenses/by-sa/3.0)]
via Wikimedia Commons
http://commons.wikimedia.org/wiki/File%3AElectromagnetic-Spectrum.svg
The interaction between solar energy and materials depends on the wavelength; solar energy goes from the Sun to the Earth and then to the sensor. Along this path, solar energy is (NASA, 2013):
- Transmitted - The energy passes through with a change in velocity as determined by the index of refraction for the two media in question.
- Absorbed - The energy is given up to the object through electron or molecular reactions.
- Reflected - The energy is returned unchanged with the angle of incidence equal to the angle of reflection. Reflectance is the ratio of reflected energy to that incident on a body. The wavelength reflected (not absorbed) determines the color of an object.
- Scattered - The direction of energy propagation is randomly changed. Rayleigh and Mie scatter are the two most important types of scatter in the atmosphere.
- Emitted - Actually, the energy is first absorbed, then re-emitted, usually at longer wavelengths. The object heats up.
Sensors¶
Sensors can be on board of airplanes or on board of satellites, measuring the electromagnetic radiation at specific ranges (usually called bands). As a result, the measures are quantized and converted into a digital image, where each picture elements (i.e. pixel) has a discrete value in units of Digital Number (DN) (NASA, 2013). The resulting images have different characteristics (resolutions) depending on the sensor. There are several kinds of resolutions:
- Spatial resolution, usually measured in pixel size, „is the resolving power of an instrument needed for the discrimination of features and is based on detector size, focal length, and sensor altitude” (NASA, 2013); spatial resolution is also referred to as geometric resolution or IFOV;
- Spectral resolution, is the number and location in the electromagnetic spectrum (defined by two wavelengths) of the spectral bands (NASA, 2013) in multispectral sensors, for each band corresponds an image;
- Radiometric resolution, usually measured in bits (binary digits), is the range of available brightness values, which in the image correspond to the maximum range of DNs; for example an image with 8 bit resolution has 256 levels of brightness (Richards and Jia, 2006);
- For satellites sensors, there is also the temporal resolution, which is the time required for revisiting the same area of the Earth (NASA, 2013).
Radiance and Reflectance¶
Sensors measure the radiance, which corresponds to the brightness in a given direction toward the sensor; it useful to define also the reflectance as the ratio of reflected versus total power energy.
Spectral Signature¶
The spectral signature is the reflectance as a function of wavelength (see Figure Spectral Reflectance Curves of Four Different Targets); each material has a unique signature, therefore it can be used for material classification (NASA, 2013).

Spectral Reflectance Curves of Four Different Targets
(from NASA, 2013)
Land Cover¶
Land cover is the material at the ground, such as soil, vegetation, water, asphalt, etc. (Fisher and Unwin, 2005). Depending on the sensor resolutions, the number and kind of land cover classes that can be identified in the image can vary significantly.
Multispectral satellites¶
There are several satellites with different characteristics that acquire multispectral images of earth surface. The following satellites are particularly useful for land cover monitoring because images are provided for free and can be downloaded directly from SCP; data have been acquired for the past few decades and the archive is continously growing with recent images.
Landsat Satellites¶
Landsat is a set of multispectral satellites developed by the NASA (National Aeronautics and Space Administration of USA), since the early 1970’s.
Landsat images are very used for environmental research. The resolutions of Landsat 4 and Landsat 5 sensors are reported in the following table (from http://landsat.usgs.gov/band_designations_landsat_satellites.php); also, Landsat temporal resolution is 16 days (NASA, 2013).
Landsat 4 and Landsat 5 Bands
Landsat 4, Landsat 5 Bands | Wavelength [micrometers] | Resolution [meters] |
---|---|---|
Band 1 - Blue | 0.45 - 0.52 | 30 |
Band 2 - Green | 0.52 - 0.60 | 30 |
Band 3 - Red | 0.63 - 0.69 | 30 |
Band 4 - Near Infrared (NIR) | 0.76 - 0.90 | 30 |
Band 5 - SWIR | 1.55 - 1.75 | 30 |
Band 6 - Thermal Infrared | 10.40 - 12.50 | 120 (resampled to 30) |
Band 7 - SWIR | 2.08 - 2.35 | 30 |
The resolutions of Landsat 7 sensor are reported in the following table (from http://landsat.usgs.gov/band_designations_landsat_satellites.php); also, Landsat temporal resolution is 16 days (NASA, 2013).
Landsat 7 Bands
Landsat 7 Bands | Wavelength [micrometers] | Resolution [meters] |
---|---|---|
Band 1 - Blue | 0.45 - 0.52 | 30 |
Band 2 - Green | 0.52 - 0.60 | 30 |
Band 3 - Red | 0.63 - 0.69 | 30 |
Band 4 - Near Infrared (NIR) | 0.77 - 0.90 | 30 |
Band 5 - SWIR | 1.57 - 1.75 | 30 |
Band 6 - Thermal Infrared | 10.40 - 12.50 | 60 (resampled to 30) |
Band 7 - SWIR | 2.09 - 2.35 | 30 |
Band 8 - Panchromatic | 0.52 - 0.90 | 15 |
The resolutions of Landsat 8 sensor are reported in the following table (from http://landsat.usgs.gov/band_designations_landsat_satellites.php); also, Landsat temporal resolution is 16 days (NASA, 2013).
Landsat 8 Bands
Landsat 8 Bands | Wavelength [micrometers] | Resolution [meters] |
---|---|---|
Band 1 - Coastal aerosol | 0.43 - 0.45 | 30 |
Band 2 - Blue | 0.45 - 0.51 | 30 |
Band 3 - Green | 0.53 - 0.59 | 30 |
Band 4 - Red | 0.64 - 0.67 | 30 |
Band 5 - Near Infrared (NIR) | 0.85 - 0.88 | 30 |
Band 6 - SWIR 1 | 1.57 - 1.65 | 30 |
Band 7 - SWIR 2 | 2.11 - 2.29 | 30 |
Band 8 - Panchromatic | 0.50 - 0.68 | 15 |
Band 9 - Cirrus | 1.36 - 1.38 | 30 |
Band 10 - Thermal Infrared (TIRS) 1 | 10.60 - 11.19 | 100 (resampled to 30) |
Band 11 - Thermal Infrared (TIRS) 2 | 11.50 - 12.51 | 100 (resampled to 30) |
A vast archive of images is freely available from the U.S. Geological Survey . For more information about how to freely download Landsat images read this .
Images are identified with the paths and rows of the WRS (Worldwide Reference System for Landsat ).
Sentinel-2 Satellite¶
Sentinel-2 is a multispectral satellite developed by the European Space Agency (ESA) in the frame of Copernicus land monitoring services. Sentinel-2 acquires 13 spectral bands with the spatial resolution of 10m, 20m and 60m depending on the band, as illustrated in the following table (ESA, 2015).
Sentinel-2 Bands
Sentinel-2 Bands | Central Wavelength [micrometers] | Resolution [meters] |
---|---|---|
Band 1 - Coastal aerosol | 0.443 | 60 |
Band 2 - Blue | 0.490 | 10 |
Band 3 - Green | 0.560 | 10 |
Band 4 - Red | 0.665 | 10 |
Band 5 - Vegetation Red Edge | 0.705 | 20 |
Band 6 - Vegetation Red Edge | 0.740 | 20 |
Band 7 - Vegetation Red Edge | 0.783 | 20 |
Band 8 - NIR | 0.842 | 10 |
Band 8A - Vegetation Red Edge | 0.865 | 20 |
Band 9 - Water vapour | 0.945 | 60 |
Band 10 - SWIR - Cirrus | 1.375 | 60 |
Band 11 - SWIR | 1.610 | 20 |
Band 12 - SWIR | 2.190 | 20 |
Sentinel-2 images are freely available from the ESA website https://scihub.copernicus.eu.
Sentinel-3 Satellite¶
Sentinel-3 is a satellite developed by the European Space Agency (ESA) in the frame of Copernicus land monitoring services. It carries several instruments, in particular the Ocean and Land Colour Instrument (OLCI) is a push-broom imaging spectrometer acquiring 21 bands in the range 0.4-1.02 μm with a swath width of 1,270km and 300m spatial resolution (ESA, 2013). The revisit time is about 2 days.
Sentinel-3 Bands
Sentinel-3 Bands | Central Wavelength [micrometers] |
---|---|
Oa1 | 0.400 |
Oa2 | 0.4125 |
Oa3 | 0.4425 |
Oa4 | 0.490 |
Oa5 | 0.510 |
Oa6 | 0.560 |
Oa7 | 0.620 |
Oa8 | 0.665 |
Oa9 | 0.67375 |
Oa10 | 0.68125 |
Oa11 | 0.70875 |
Oa12 | 0.75375 |
Oa13 | 0.76125 |
Oa14 | 0.764375 |
Oa15 | 0.7675 |
Oa16 | 0.77875 |
Oa17 | 0.865 |
Oa18 | 0.885 |
Oa19 | 0.900 |
Oa20 | 0.940 |
Oa21 | 1.020 |
ASTER Satellite¶
The ASTER (Advanced Spaceborne Thermal Emission and Reflection Radiometer) satellite was launched in 1999 by a collaboration between the Japanese Ministry of International Trade and Industry (MITI) and the NASA. ASTER has 14 bands whose spatial resolution varies with wavelength: 15m in the visible and near-infrared, 30m in the short wave infrared, and 90m in the thermal infrared (USGS, 2015). ASTER bands are illustrated in the following table (due to a sensor failure SWIR data acquired since April 1, 2008 is not available ). An additional band 3B (backwardlooking near-infrared) provides stereo coverage.
ASTER Bands
ASTER Bands | Wavelength [micrometers] | Resolution [meters] |
---|---|---|
Band 1 - Green | 0.52 - 0.60 | 15 |
Band 2 - Red | 0.63 - 0.69 | 15 |
Band 3N - Near Infrared (NIR) | 0.78 - 0.86 | 15 |
Band 4 - SWIR 1 | 1.60 - 1.70 | 30 |
Band 5 - SWIR 2 | 2.145 - 2.185 | 30 |
Band 6 - SWIR 3 | 2.185 - 2.225 | 30 |
Band 7 - SWIR 4 | 2.235 - 2.285 | 30 |
Band 8 - SWIR 5 | 2.295 - 2.365 | 30 |
Band 9 - SWIR 6 | 2.360 - 2.430 | 30 |
Band 10 - TIR 1 | 8.125 - 8.475 | 90 |
Band 11 - TIR 2 | 8.475 - 8.825 | 90 |
Band 12 - TIR 3 | 8.925 - 9.275 | 90 |
Band 13 - TIR 4 | 10.25 - 10.95 | 90 |
Band 14 - TIR 5 | 10.95 - 11.65 | 90 |
MODIS Products¶
The MODIS (Moderate Resolution Imaging Spectroradiometer) is an instrument operating on the Terra and Aqua satellites launched by NASA in 1999 and 2002 respectively. Its temporal resolutions allows for viewing the entire Earth surface every one to two days, with a swath width of 2,330km. Its sensors measure 36 spectral bands at three spatial resolutions: 250m, 500m, and 1,000m (see https://lpdaac.usgs.gov/dataset_discovery/modis).
Several products are available, such as surface reflectance and vegetation indices. In this manual we are considering the surface reflectance bands available at 250m and 500m spatial resolution (Vermote, Roger, & Ray, 2015).
MODIS Bands
MODIS Bands | Wavelength [micrometers] | Resolution [meters] |
---|---|---|
Band 1 - Red | 0.62 - 0.67 | 250 - 500 |
Band 2 - Near Infrared (NIR) | 0.841 - 0.876 | 250 - 500 |
Band 3 - Blue | 0.459 - 0.479 | 500 |
Band 4 - Green | 0.545 - 0.565 | 500 |
Band 5 - SWIR 1 | 1.230 - 1.250 | 500 |
Band 6 - SWIR 2 | 1.628 - 1.652 | 500 |
Band 7 - SWIR 3 | 2.105 - 2.155 | 500 |
The following products (Version 6, see https://lpdaac.usgs.gov/dataset_discovery/modis/modis_products_table) are available for download (Vermote, Roger, & Ray, 2015):
- MOD09GQ: daily reflectance at 250m spatial resolution from Terra MODIS;
- MYD09GQ: daily reflectance at 250m spatial resolution from Aqua MODIS;
- MOD09GA: daily reflectance at 500m spatial resolution from Terra MODIS;
- MYD09GA: daily reflectance at 500m spatial resolution from Aqua MODIS;
- MOD09Q1: reflectance at 250m spatial resolution, which is a composite of MOD09GQ (each pixel contains the best possible observation during an 8-day period);
- MYD09Q1: reflectance at 250m spatial resolution, which is a composite of MYD09GQ (each pixel contains the best possible observation during an 8-day period);
- MOD09A1: reflectance at 250m spatial resolution, which is a composite of MOD09GA (each pixel contains the best possible observation during an 8-day period);
- MYD09A1: reflectance at 250m spatial resolution, which is a composite of MYD09GA (each pixel contains the best possible observation during an 8-day period);
Land Cover Classification¶
This chapter provides basic definitions about land cover classifications.
Supervised Classification¶
A semi-automatic classification (also supervised classification) is an image processing technique that allows for the identification of materials in an image, according to their spectral signatures. There are several kinds of classification algorithms, but the general purpose is to produce a thematic map of the land cover.
Image processing and GIS spatial analyses require specific software such as the Semi-Automatic Classification Plugin for QGIS.

A multispectral image processed to produce a land cover classification
(Landsat image provided by USGS)
Color Composite¶
Often, a combination is created of three individual monochrome images, in which each is assigned a given color; this is defined color composite and is useful for photo interpretation (NASA, 2013). Color composites are usually expressed as:
„R G B = Br Bg Bb”
where:
- R stands for Red;
- G stands for Green;
- B stands for Blue;
- Br is the band number associated to the Red color;
- Bg is the band number associated to the Green color;
- Bb is the band number associated to the Blue color.
The following Figure Color composite of a Landsat 8 image shows a color composite „R G B = 4 3 2” of a Landsat 8 image (for Landsat 7 the same color composite is R G B = 3 2 1; for Sentinel-2 is R G B = 4 3 2) and a color composite „R G B = 5 4 3” (for Landsat 7 the same color composite is R G B = 4 3 2; for Sentinel-2 is R G B = 8 4 3). The composite „R G B = 5 4 3” is useful for the interpretation of the image because vegetation pixels appear red (healthy vegetation reflects a large part of the incident light in the near-infrared wavelength, resulting in higher reflectance values for band 5, thus higher values for the associated color red).

Color composite of a Landsat 8 image
Data available from the U.S. Geological Survey
Training Areas¶
Usually, supervised classifications require the user to select one or more Regions of Interest (ROIs, also Training Areas) for each land cover class identified in the image. ROIs are polygons drawn over homogeneous areas of the image that overlay pixels belonging to the same land cover class.
Region Growing Algorithm¶
The Region Growing Algorithm allows to select pixels similar to a seed one, considering the spectral similarity (i.e. spectral distance) of adjacent pixels. In SCP the Region Growing Algorithm is available for the training area creation. The parameter distance is related to the similarity of pixel values (the lower the value, the more similar are selected pixels) to the seed one (i.e. selected clicking on a pixel). An additional parameter is the maximum width, which is the side length of a square, centred at the seed pixel, which inscribes the training area (if all the pixels had the same value, the training area would be this square). The minimum size is used a constraint (for every single band), selecting at least the pixels that are more similar to the seed one until the number of selected pixels equals the minimum size.
In figure Region growing example the central pixel is used as seed (image a) for the region growing of one band (image b) with the parameter spectral distance = 0.1; similar pixels are selected to create the training area (image c and image d).

Region growing example
Classes and Macroclasses¶
Land cover classes are identified with an arbitrary ID code (i.e. Identifier).
SCP allows for the definition of Macroclass ID (i.e. MC ID) and Class ID (i.e. C ID), which are the identification codes of land cover classes.
A Macroclass is a group of ROIs having different Class ID, which is useful when one needs to classify materials that have different spectral signatures in the same land cover class.
For instance, one can identify grass (e.g. ID class = 1
and Macroclass ID = 1
) and trees (e.g. ID class = 2
and Macroclass ID = 1
) as vegetation class (e.g. Macroclass ID = 1
).
Multiple Class IDs can be assigned to the same Macroclass ID, but the same Class ID cannot be assigned to multiple Macroclass IDs, as shown in the following table.
Example of Macroclasses
Macroclass name | Macroclass ID | Class name | Class ID |
---|---|---|---|
Vegetation | 1 | Grass | 1 |
Vegetation | 1 | Trees | 2 |
Built-up | 2 | Buildings | 3 |
Built-up | 2 | Roads | 4 |
Therefore, Classes are subsets of a Macroclass as illustrated in Figure Macroclass example.

Macroclass example
If the use of Macroclass is not required for the study purpose, then the same Macroclass ID can be defined for all the ROIs (e.g. Macroclass ID = 1) and Macroclass values are ignored in the classification process.
Classification Algorithms¶
The spectral signatures (spectral characteristics) of reference land cover classes are calculated considering the values of pixels under each ROI having the same Class ID (or Macroclass ID). Therefore, the classification algorithm classifies the whole image by comparing the spectral characteristics of each pixel to the spectral characteristics of reference land cover classes. SCP implements the following classification algorithms.
Minimum Distance¶
Minimum Distance algorithm calculates the Euclidean distance \(d(x, y)\) between spectral signatures of image pixels and training spectral signatures, according to the following equation:
where:
- \(x\) = spectral signature vector of an image pixel;
- \(y\) = spectral signature vector of a training area;
- \(n\) = number of image bands.
Therefore, the distance is calculated for every pixel in the image, assigning the class of the spectral signature that is closer, according to the following discriminant function (adapted from Richards and Jia, 2006):
where:
- \(C_k\) = land cover class \(k\);
- \(y_k\) = spectral signature of class \(k\);
- \(y_j\) = spectral signature of class \(j\).
It is possible to define a threshold \(T_i\) in order to exclude pixels below this value from the classification:
Maximum Likelihood¶
Maximum Likelihood algorithm calculates the probability distributions for the classes, related to Bayes’ theorem, estimating if a pixel belongs to a land cover class. In particular, the probability distributions for the classes are assumed the of form of multivariate normal models (Richards & Jia, 2006). In order to use this algorithm, a sufficient number of pixels is required for each training area allowing for the calculation of the covariance matrix. The discriminant function, described by Richards and Jia (2006), is calculated for every pixel as:
where:
- \(C_k\) = land cover class \(k\);
- \(x\) = spectral signature vector of a image pixel;
- \(p(C_k)\) = probability that the correct class is \(C_k\);
- \(| \Sigma_{k} |\) = determinant of the covariance matrix of the data in class \(C_k\);
- \(\Sigma_{k}^{-1}\) = inverse of the covariance matrix;
- \(y_k\) = spectral signature vector of class \(k\).
Therefore:

Maximum Likelihood example
In addition, it is possible to define a threshold to the discriminant function in order to exclude pixels below this value from the classification. Considering a threshold \(T_i\) the classification condition becomes:
Maximum likelihood is one of the most common supervised classifications, however the classification process can be slower than Minimum Distance.
Spectral Angle Mapping¶
The Spectral Angle Mapping calculates the spectral angle between spectral signatures of image pixels and training spectral signatures. The spectral angle \(\theta\) is defined as (Kruse et al., 1993):
Where:
- \(x\) = spectral signature vector of an image pixel;
- \(y\) = spectral signature vector of a training area;
- \(n\) = number of image bands.
Therefore a pixel belongs to the class having the lowest angle, that is:
where:
- \(C_k\) = land cover class \(k\);
- \(y_k\) = spectral signature of class \(k\);
- \(y_j\) = spectral signature of class \(j\).

Spectral Angle Mapping example
In order to exclude pixels below this value from the classification it is possible to define a threshold \(T_i\):
Spectral Angle Mapping is largely used, especially with hyperspectral data.
Parallelepiped Classification¶
Parallelepiped classification is an algorithm that considers a range of values for each band, forming a multidimensional parallelepiped that defines a land cover class. A pixel is classified if the values thereof are inside a parallelepiped. One of the major drawbacks is that pixels whose signatures lie in the overlapping area of two or more parallelepipeds cannot be classified (Richards and Jia, 2006).
Land Cover Signature Classification¶
Land Cover Signature Classification is available in SCP (see Land Cover Signature Classification). This classification allows for the definition of spectral thresholds for each training input signature (a minimum value and a maximum value for each band). The thresholds of each training input signature define a spectral region belonging to a certain land cover class.
Spectral signatures of image pixels are compared to the training spectral signatures; a pixel belongs to class X
if pixel spectral signature is completely contained in the spectral region defined by class X
.
In case of pixels falling inside overlapping regions or outside any spectral region, it is possible to use additional classification algorithms (i.e. Minimum Distance, Maximum Likelihood, Spectral Angle Mapping) considering the spectral characteristics of the original input signature.
In the following image, a scheme illustrates the Land Cover Signature Classification for a simple case of two spectral bands \(x\) and \(y\). User defined spectral regions define three classes (\(g_a\), \(g_b\), and \(g_c\)). Point \(p_1\) belongs to class \(g_a\) and point \(p_2\) belongs to class \(g_b\). However, point \(p_3\) is inside the spectral regions of both classes \(g_b\) and \(g_c\) (overlapping regions); in this case, point \(p_3\) will be unclassified or classified according to an additional classification algorithm. Point \(p_4\) is outside any spectral region, therefore it will be unclassified or classified according to an additional classification algorithm. Given that point \(p_4\) belongs to class \(g_c\), the spectral region thereof could be extended to include point \(p_4\) .

Land cover signature classification
This is similar to Parallelepiped Classification, with the exception that spectral regions are defined by user, and can be assigned independently for the upper and lower bounds. One can imagine spectral regions as the set of all the spectral signatures of pixels belonging to one class.
In figure Plot of spectral ranges the spectral ranges of three classes (\(g_a\), \(g_b\), and \(g_c\)) are displayed; the colored lines inside the ranges (i.e. semi-transparent area) represent the spectral signatures of pixels that defined the upper and lower bounds of the respective ranges. Pixel \(p_1\) (dotted line) belongs to class \(g_b\) because the spectral signature thereof is completely inside the range of class \(g_b\) (in the upper limit); pixel \(p_2\) (dashed line) is unclassified because the spectral signature does not fall completely inside any range; pixel \(p_3\) (dotted line) belongs to class \(g_a\).

Plot of spectral ranges
It is worth noticing that these spectral thresholds can be applied to any spectral signature, regardless of spectral characteristics thereof; this function can be very useful for separating similar spectral signatures that differ only in one band, defining thresholds that include or exclude specific signatures. In fact, classes are correctly separated if the spectral ranges thereof are not overlapping at least in one band. Of course, even if spectral regions are overlapping, chances are that no pixel will fall inside the overlapping region and be misclassified; which is the upper (or lower) bound of a range do not imply the existence, in the image, of any spectral signature having the maximum (or minimum) range values for all the bands (for instance pixel \(p_1\) of figure Plot of spectral ranges could not exist).
One of the main benefit of the Land Cover Signature Classification is that it is possible to select pixels and and include the signature thereof in a spectral range; therefore, the classification should be the direct representation of the class expected for every spectral signature. This is very suitable for the classification of a single land cover class (defined by specific spectral thresholds), and leave unclassified the rest of the image that is of no interest for the purpose of the classification.
Algorithm raster¶
An algorithm raster represents the „distance” (according to the definition of the classification algorithm) of an image pixel to a specific spectral signature.
In general, an algorithm raster is produced for every spectral signature used as training input.
The value of every pixel is the result of the algorithm calculation for a specific spectral signature.
Therefore, a pixel belongs to class X
if the value of the algorithm raster corresponding to class X
is the lowest in case of Minimum Distance or Spectral Angle Mapping (or highest in case of Maximum Likelihood).
Given a classification, a combination of algorithm rasters can be produced, in order to create a raster with the lowest „distances” (i.e. pixels have the value of the algorithm raster corresponding to the class they belong in the classification). Therefore, this raster can be useful to identify pixels that require the collection of more similar spectral signatures (see Classification preview).
Spectral Distance¶
It is useful to evaluate the spectral distance (or separability) between training signatures or pixels, in order to assess if different classes that are too similar could cause classification errors. The SCP implements the following algorithms for assessing similarity of spectral signatures.
Jeffries-Matusita Distance¶
Jeffries-Matusita Distance calculates the separability of a pair of probability distributions. This can be particularly meaningful for evaluating the results of Maximum Likelihood classifications.
The Jeffries-Matusita Distance \(J_{xy}\) is calculated as (Richards and Jia, 2006):
where:
where:
- \(x\) = first spectral signature vector;
- \(y\) = second spectral signature vector;
- \(\Sigma_{x}\) = covariance matrix of sample \(x\);
- \(\Sigma_{y}\) = covariance matrix of sample \(y\);
The Jeffries-Matusita Distance is asymptotic to 2 when signatures are completely different, and tends to 0 when signatures are identical.
Spectral Angle¶
The Spectral Angle is the most appropriate for assessing the Spectral Angle Mapping algorithm. The spectral angle \(\theta\) is defined as (Kruse et al., 1993):
Where:
- \(x\) = spectral signature vector of an image pixel;
- \(y\) = spectral signature vector of a training area;
- \(n\) = number of image bands.
Spectral angle goes from 0 when signatures are identical to 90 when signatures are completely different.
Euclidean Distance¶
The Euclidean Distance is particularly useful for the evaluating the result of Minimum Distance classifications. In fact, the distance is defined as:
where:
- \(x\) = first spectral signature vector;
- \(y\) = second spectral signature vector;
- \(n\) = number of image bands.
The Euclidean Distance is 0 when signatures are identical and tends to increase according to the spectral distance of signatures.
Bray-Curtis Similarity¶
The Bray-Curtis Similarity is a statistic used for assessing the relationship between two samples (read this). It is useful in general for assessing the similarity of spectral signatures, and Bray-Curtis Similarity \(S(x, y)\) is calculated as:
where:
- \(x\) = first spectral signature vector;
- \(y\) = second spectral signature vector;
- \(n\) = number of image bands.
The Bray-Curtis similarity is calculated as percentage and ranges from 0 when signatures are completely different to 100 when spectral signatures are identical.
Classification Result¶
The result of the classification process is a raster (see an example of Landsat classification in Figure Landsat classification), where pixel values correspond to class IDs and each color represent a land cover class.

Landsat classification
Data available from the U.S. Geological Survey
A certain amount of errors can occur in the land cover classification (i.e. pixels assigned to a wrong land cover class), due to spectral similarity of classes, or wrong class definition during the ROI collection.
Accuracy Assessment¶
After the classification process, it is useful to assess the accuracy of land cover classification, in order to identify and measure map errors. Usually, accuracy assessment is performed with the calculation of an error matrix, which is a table that compares map information with reference data (i.e. ground truth data) for a number of sample areas (Congalton and Green, 2009).
The following table is a scheme of error matrix, where k is the number of classes identified in the land cover classification, and n is the total number of collected sample units. The items in the major diagonal (aii) are the number of samples correctly identified, while the other items are classification error.
Scheme of Error Matrix
Ground truth 1 | Ground truth 2 | … | Ground truth k | Total | |
---|---|---|---|---|---|
Class 1 | \(a_{11}\) | \(a_{12}\) | … | \(a_{1k}\) | \(a_{1+}\) |
Class 2 | \(a_{21}\) | \(a_{22}\) | … | \(a_{2k}\) | \(a_{2+}\) |
… | … | … | … | … | … |
Class k | \(a_{k1}\) | \(a_{k2}\) | … | \(a_{kk}\) | \(a_{k+}\) |
Total | \(a_{+1}\) | \(a_{+2}\) | … | \(a_{+k}\) | \(n\) |
Therefore, it is possible to calculate the overall accuracy as the ratio between the number of samples that are correctly classified (the sum of the major diagonal), and the total number of sample units n (Congalton and Green, 2009).
The overall accuracy (also expressed in percentage) is defined as:
Ther user’s accuracy for each class is defined as the ratio (also expressed in percentage) between correct samples and the row total:
The commission error \(CE_i = 1 - U_i\) corresponds to pixels classified as class \(i\) that actually belong to a different class.
The producer’s accuracy for each class is calculated as the ratio (also expressed in percentage) between correct samples and the column total:
The omission error \(OE_i = 1 - P_i\) corresponds to pixels actually belonging to class \(i\) that were classified erroneously as a different class.
User’s accuracy is It is recommended to calculate the area based error matrix (Olofsson, et al., 2014) where each element represents the estimated area proportion of each class. This allows for estimating the unbiased user’s accuracy and producer’s accuracy, the unbiased area of classes according to reference data, and the standard error of area estimates.
For further information, the following documentation is freely available: Landsat 7 Science Data User’s Handbook, Remote Sensing Note , or Wikipedia.
Image processing¶
Remote sensing images can be processed in various ways in order to obtain classification, indices, or other derived information that can be useful for land cover characterization.
Principal Component Analysis¶
Principal Component Analysis (PCA) is a method for reducing the dimensions of measured variables (bands) to the principal components (JARS, 1993).
Th principal component transformation provides a new set of bands (principal components) having the following characteristic: principal components are uncorrelated; each component has variance less than the previous component. Therefore, this is an efficient method for extracting information and data compression (Ready and Wintz, 1973).
Given an image with N spectral bands, the principal components are obtained by matrix calculation (Ready and Wintz, 1973; Richards and Jia, 2006):
where:
- \(Y\) = vector of principal components
- \(D\) = matrix of eigenvectors of the covariance matrix \(C_x\) in X space
- \(t\) denotes vector transpose
And \(X\) is calculated as:
- \(P\) = vector of spectral values associated with each pixel
- \(M\) = vector of the mean associated with each band
Thus, the mean of \(X\) associated with each band is 0. \(D\) is formed by the eigenvectors (of the covariance matrix \(C_x\)) ordered as the eigenvalues from maximum to minimum, in order to have the maximum variance in the first component. This way, the principal components are uncorrelated and each component has variance less than the previous component(Ready and Wintz, 1973).
Usually the first two components contain more than the 90% of the variance. For example, the first principal components can be displayed in a Color Composite for highlighting Land Cover classes, or used as input for Supervised Classification.
Pan-sharpening¶
Pan-sharpening is the combination of the spectral information of multispectral bands (MS), which have lower spatial resolution (for Landsat bands, spatial resolution is 30m), with the spatial resolution of a panchromatic band (PAN), which for Landsat 7 and 8 it is 15m. The result is a multispectral image with the spatial resolution of the panchromatic band (e.g. 15m). In SCP, a Brovey Transform is applied, where the pan-sharpened values of each multispectral band are calculated as (Johnson, Tateishi and Hoan, 2012):
where \(I\) is Intensity, which is a function of multispectral bands.
The following weights for I are defined, basing on several tests performed using the SCP. For Landsat 8, Intensity is calculated as:
For Landsat 7, Intensity is calculated as:

Example of pan-sharpening of a Landsat 8 image. Left, original multispectral bands (30m); right, pan-sharpened bands (15m)
Data available from the U.S. Geological Survey
Spectral Indices¶
Spectral indices are operations between spectral bands that are useful for extracting information such as vegetation cover (JARS, 1993). One of the most popular spectral indices is the Normalized Difference Vegetation Index (NDVI), defined as (JARS, 1993):
NDVI values range from -1 to 1. Dense and healthy vegetation show higher values, while non-vegetated areas show low NDVI values.
Another index is the Enhanced Vegetation Index (EVI) which attempts to account for atmospheric effects such as path radiance calculating the difference between the blue and the red bands (Didan,et al., 2015). EVI is defined as:
where: \(G\) is a scaling factor, \(C_1\) and \(C_2\) are coefficients for the atmospheric effects, and \(L\) is a factor for accounting the differential NIR and Red radiant transfer through the canopy. Typical coefficient values are: \(G = 2.5\), \(L = 1\), \(C_1 = 6\), \(C_2 = 7.5\) (Didan,et al., 2015).
Clustering¶
Clustering is the grouping of pixels based on spectral similarity (e.g. Euclidean Distance or Spectral Angle) calculated for a multispectral image (Richards and Jia, 2006).
Clustering can be used for unsupervised classification or for the automatic selection of spectral signatures. It is worth noticing that, while Supervised Classification produces a classification whith the classes identified during the trainining process, the classes produced by clustering (i.e. clusters) have no definition and consequently the user must assign a land cover label to each class.
The main advantage of clustering resides in automation. Of course, clusters do not necessarily represent a particular land cover type and additional processing could be required for producing an accurate classification.
There are several types of clustering, mainly based on iterative methods; the following are the algorithms provided in SCP.
K-means¶
The K-means method is based on the calculation of the average spectral signature of clusters (Wikipedia, 2017; JARS, 1993).
At first, the user defines the number of clusters expected in the image, which correspond to as many spectral signatures (i.e. seeds). Starting spectral signatures can be selected in various ways (e.g. randomly, provided by the user, calculated automatically from image values).
During the first iteration clusters are produced calculating the pixel spectral distance with initial spectral signatures. The algorithms Euclidean Distance or Spectral Angle can be used for distance calculation. Pixels are assigned according to the most similar spectral signature, therefore producing clusters.
Then, the average spectral signature is calculated for each cluster of pixels, resulting in the spectral signatures that will be used in the following iteration.
This process continues iteratively producing clusters and mean spectral signatures, until one of the following condition is verified:
- the spectral distance between the spectral signatures produced in this iteration with the corresponding ones produced in the previous iteration is lower than a certain threshold;
- the maximum number of iterations is reached.
After the last iteration, a raster of clusters is produced using the spectral signatures derived from the last iteration.
ISODATA¶
The ISODATA (Iterative Self-Organizing Data Analysis Technique) method is similar to K-means but with the additional steps of merging clusters having similar spectral signatures and splitting clusters having too high varability (i.e. standard deviation) of spectral signatures (Ball & Hall, 1965). Following, the SCP implementation of ISODATA is described.
At first, the user defines the number of clusters expected in the image, which correspond to as many spectral signatures (i.e. seeds). Starting spectral signatures can be selected in various ways (e.g. randomly, provided by the user, calculated automatically from image values). Initial parameteres provided by user are:
- \(C\) = number of desired clusters
- \(N_{min}\) = minimum number of pixels for a cluster
- \(\sigma_{t}\) = maximum standard deviation threshold for splitting
- \(D_{t}\) = distance threshold for merging
During the first iteration clusters are produced calculating the Euclidean Distance of pixels with initial spectral signatures. Pixels are assigned according to the most similar spectral signature, therefore producing clusters.
Therefore, the following parameters are calculated:
- \(N_{i}\) = number of pixels of cluster \(i\)
- \(S_{i}\) = average spectral signature of cluster \(i\)
- \(AVERAGEDIST_{i}\) = average distance of cluster \(i\) with the seed spectral signature
- \(AVERAGEDISTANCE\) = overall average distance of all clusters
- \(\sigma_{ij}\) = standard deviation of cluster \(i\) in band \(j\)
- \(\sigma max_{i}\) = maximum standard deviation of cluster \(i\) (i.e. \(max( \sigma_{ij} )\))
- \(k_{i}\) = band where \(\sigma max_{i}\) occurred
- \(Sk_{i}\) = value of \(S_{i}\) at band \(k_{i}\)
- \(P\) = number of clusters
Then, for each cluster \(i\), if \(N_{i}\) < \(N_{min}\) , then the cluster \(i\) is discarded.
If \(P\) <= \(C\) then try to split clusters. For each cluster \(i\):
If \(\sigma max_{i}\) > \(\sigma_{t}\) :
If ((\(AVERAGEDIST_{i}\) > \(AVERAGEDISTANCE\)) AND (\(N_{i}\) > (2 * \(N_{min}\) + 2) )) OR (\(C\) > 2 * \(P\)):
- create a new spectral signature \(S_{p + 1}\) = \(S_{i}\)
- in \(S_{i}\) set the value \(Sk_{i}\) = \(Sk_{i}\) + \(\sigma max_{i}\)
- in \(S_{p + 1}\) set the value \(Sk_{p + 1}\) = \(Sk_{i}\) - \(\sigma max_{i}\)
- \(P\) = \(P\) + 1
- start a new iteration
If \(P\) > (2 * \(C\)) then try to merge clusters.
For each combination \(xy\) of spectrals signatures calculate \(D_{xy}\) = Euclidean Distance of spectral signatures \(S_{x}\) and \(S_{y}\) .
If the minimum \(D_{xy}\) is greater than \(D_{t}\):
- S_{i} = (\(N_{i}\) * S_{i} + \(N_{j}\) * S_{j})/(\(N_{i}\) + \(N_{j}\))
- discard S_{j}
- \(P\) = \(P\) - 1
- start a new iteration
After the last iteration, a raster of clusters is produced using the spectral signatures derived from the last iteration. The number of clusters can vary according to the processes of splitting and merging.
Image conversion to reflectance¶
This chapter provides information about the conversion to reflectance implemented in SCP.
Radiance at the Sensor’s Aperture¶
Radiance is the „flux of energy (primarily irradiant or incident energy) per solid angle leaving a unit surface area in a given direction”, „Radiance is what is measured at the sensor and is somewhat dependent on reflectance” (NASA, 2011, p. 47).
Images such as Landsat or Sentinel-2 are composed of several bands and a metadata file which contains information required for the conversion to reflectance.
Landsat images are provided in radiance, scaled prior to output. for Landsat images Spectral Radiance at the sensor’s aperture (\(L_{\lambda}\), measured in [watts/(meter squared * ster * \(\mu m\))]) is given by (https://landsat.usgs.gov/Landsat8_Using_Product.php):
where:
- \(M_{L}\) = Band-specific multiplicative rescaling factor from Landsat metadata (RADIANCE_MULT_BAND_x, where x is the band number)
- \(A_{L}\) = Band-specific additive rescaling factor from Landsat metadata (RADIANCE_ADD_BAND_x, where x is the band number)
- \(Q_{cal}\) = Quantized and calibrated standard product pixel values (DN)
Sentinel-2 images (Level-1C) are already provided in Top Of Atmosphere (TOA) Reflectance, scaled prior to output (ESA, 2015).
Top Of Atmosphere (TOA) Reflectance¶
Images in radiance can be converted to Top Of Atmosphere (TOA) Reflectance (combined surface and atmospheric reflectance) in order to reduce the in between-scene variability through a normalization for solar irradiance. This TOA reflectance (\(\rho_{p}\)), which is the unitless ratio of reflected versus total power energy (NASA, 2011), is calculated by:
where:
- \(L_{\lambda}\) = Spectral radiance at the sensor’s aperture (at-satellite radiance)
- \(d\) = Earth-Sun distance in astronomical units (provided with Landsat 8 metadata file, and an excel file is available from http://landsathandbook.gsfc.nasa.gov/excel_docs/d.xls)
- \(ESUN_{\lambda}\) = Mean solar exo-atmospheric irradiances
- \(\theta_{s}\) = Solar zenith angle in degrees, which is equal to \(\theta_{s}\) = 90° - \(\theta_{e}\) where \(\theta_{e}\) is the Sun elevation
It is worth pointing out that Landsat 8 images are provided with band-specific rescaling factors that allow for the direct conversion from DN to TOA reflectance.
Sentinel-2 images are already provided in scaled TOA reflectance, which can be converted to TOA reflectance with a simple calculation using the Quantification Value provided in the metadata (see https://sentinel.esa.int/documents/247904/349490/S2_MSI_Product_Specification.pdf).
Sentinel-3 images are already provided in scaled TOA radiance.
Conversion to reflectance is performed applying the coefficients scale_factor
and add_offset
provided in the metadata of each band.
The ancillary raster tie_geometries.nc
provides the value of sun zenith angle and the ancillary raster instrument_data
provides information about the solar flux for each band, which are used for the conversion to reflectance with the correction for sun angle.
In addition, the georeferencing of the bands is performed using the ancillary raster geo_coordinates.nc
which provides coordinates of every pixel.
Surface Reflectance¶
The effects of the atmosphere (i.e. a disturbance on the reflectance that varies with the wavelength) should be considered in order to measure the reflectance at the ground.
As described by Moran et al. (1992), the land surface reflectance (\(\rho\)) is:
where:
- \(L_{p}\) is the path radiance
- \(T_{v}\) is the atmospheric transmittance in the viewing direction
- \(T_{z}\) is the atmospheric transmittance in the illumination direction
- \(E_{down}\) is the downwelling diffuse irradiance
Therefore, we need several atmospheric measurements in order to calculate \(\rho\) (physically-based corrections). Alternatively, it is possible to use image-based techniques for the calculation of these parameters, without in-situ measurements during image acquisition. It is worth mentioning that Landsat Surface Reflectance High Level Data Products for Landsat 8 are available (for more information read http://landsat.usgs.gov/CDR_LSR.php).
DOS1 Correction¶
The Dark Object Subtraction (DOS) is a family of image-based atmospheric corrections. Chavez (1996) explains that „the basic assumption is that within the image some pixels are in complete shadow and their radiances received at the satellite are due to atmospheric scattering (path radiance). This assumption is combined with the fact that very few targets on the Earth’s surface are absolute black, so an assumed one-percent minimum reflectance is better than zero percent”. It is worth pointing out that the accuracy of image-based techniques is generally lower than physically-based corrections, but they are very useful when no atmospheric measurements are available as they can improve the estimation of land surface reflectance. The path radiance is given by (Sobrino, et al., 2004):
where:
- \(L_{min}\) = „radiance that corresponds to a digital count value for which the sum of all the pixels with digital counts lower or equal to this value is equal to the 0.01% of all the pixels from the image considered” (Sobrino, et al., 2004, p. 437), therefore the radiance obtained with that digital count value (\(DN_{min}\))
- \(L_{DO1\%}\) = radiance of Dark Object, assumed to have a reflectance value of 0.01
In particular for Landsat images:
Sentinel-2 images are converted to radiance prior to DOS1 calculation.
The radiance of Dark Object is given by (Sobrino, et al., 2004):
Therefore the path radiance is:
There are several DOS techniques (e.g. DOS1, DOS2, DOS3, DOS4), based on different assumption about \(T_{v}\), \(T_{z}\) , and \(E_{down}\) . The simplest technique is the DOS1, where the following assumptions are made (Moran et al., 1992):
- \(T_{v}\) = 1
- \(T_{z}\) = 1
- \(E_{down}\) = 0
Therefore the path radiance is:
And the resulting land surface reflectance is given by:
ESUN [W /(m2 * \(\mu m\))] values for Landsat sensors are provided in the following table.
ESUN values for Landsat bands
Band | Landsat 1 MSS* | Landsat 2 MSS* | Landsat 3 MSS* | Landsat 4 TM* | Landsat 5 TM* | Landsat 7 ETM+** |
---|---|---|---|---|---|---|
1 | 1983 | 1983 | 1970 | |||
2 | 1795 | 1796 | 1842 | |||
3 | 1539 | 1536 | 1547 | |||
4 | 1823 | 1829 | 1839 | 1028 | 1031 | 1044 |
5 | 1559 | 1539 | 1555 | 219.8 | 220 | 225.7 |
6 | 1276 | 1268 | 1291 | |||
7 | 880.1 | 886.6 | 887.9 | 83.49 | 83.44 | 82.06 |
8 | 1369 |
* from Chander, Markham, & Helder (2009)
** from http://landsathandbook.gsfc.nasa.gov/data_prod/prog_sect11_3.html
For Landsat 8, \(ESUN\) can be calculated as (from http://grass.osgeo.org/grass65/manuals/i.landsat.toar.html):
where RADIANCE_MAXIMUM and REFLECTANCE_MAXIMUM are provided by image metadata.
ESUN [W /(m2 * \(\mu m\))] values for Sentinel-2 sensor (provided in image metadata) are illustrated in the following table.
ESUN values for Sentinel-2 bands
Band | Sentinel-2 |
---|---|
1 | 1913.57 |
2 | 1941.63 |
3 | 1822.61 |
4 | 1512.79 |
5 | 1425.56 |
6 | 1288.32 |
7 | 1163.19 |
8 | 1036.39 |
8A | 955.19 |
9 | 813.04 |
10 | 367.15 |
11 | 245.59 |
12 | 85.25 |
ESUN [W /(m2 * \(\mu m\))] values for ASTER sensor are illustrated in the following table (from Finn, et al., 2012).
ESUN values for ASTER bands
Band | ASTER |
---|---|
1 | 1848 |
2 | 1549 |
3 | 1114 |
4 | 225.4 |
5 | 86.63 |
6 | 81.85 |
7 | 74.85 |
8 | 66.49 |
9 | 59.85 |
An example of comparison of to TOA reflectance, DOS1 corrected reflectance and the Landsat Surface Reflectance High Level Data Products (ground truth) is provided in Figure Spectral signatures of a built-up pixel.

Spectral signatures of a built-up pixel
Comparison of TOA reflectance, DOS1 corrected reflectance and Landsat Surface Reflectance High Level Data Products
Conversion to Temperature¶
This chapter provides the basic information about the conversion to At-Satellite Brightness Temperature implemented in SCP and the estimation of Land Surface Temperature.
Conversion to At-Satellite Brightness Temperature¶
For thermal bands, the conversion of DN to At-Satellite Brightness Temperature is given by (from https://landsat.usgs.gov/Landsat8_Using_Product.php):
where:
- \(K_{1}\) = Band-specific thermal conversion constant (in watts/meter squared * ster * \(\mu m\))
- \(K_{2}\) = Band-specific thermal conversion constant (in kelvin)
and \(L_{\lambda}\) is the Spectral Radiance at the sensor’s aperture, measured in watts/(meter squared * ster * \(\mu m\)).
The \(K_{1}\) and \(K_{2}\) constants for Landsat sensors are provided in the following table.
Thermal Conversion Constants for Landsat
Constant | Landsat 4* | Landsat 5* | Landsat 7** |
---|---|---|---|
\(K_{1}\) | 671.62 | 607.76 | 666.09 |
\(K_{2}\) | 1284.30 | 1260.56 | 1282.71 |
* from Chander & Markham (2003)
** from NASA (2011)
For Landsat 8, the \(K_{1}\) and \(K_{2}\) values are provided in the image metadata file.
\(K_{1}\) and \(K_{2}\) are calculated as (Jimenez-Munoz & Sobrino, 2010):
where (Mohr, Newell, & Taylor, 2015):
- \(c_{1}\) = first radiation constant = \(1.191 * 10^{-16} W m^{2} sr^{-1}\)
- \(c_{2}\) = second radiation constant = \(1.4388 * 10^{-2} m K\)
Therefore, for ASTER bands \(K_{1}\) and \(K_{2}\) are provided in the following table.
Thermal Conversion Constants for ASTER
Constant | Band 10 | Band 11 | Band 12 | Band 13 | Band 14 |
---|---|---|---|---|---|
\(K_{1}\) | \(3.024 * 10^{3}\) | \(2.460 * 10^{3}\) | \(1.909 * 10^{3}\) | \(8.900 * 10^{2}\) | \(6.464 * 10^{2}\) |
\(K_{2}\) | \(1.733 * 10^{3}\) | \(1.663 * 10^{3}\) | \(1.581 * 10^{3}\) | \(1.357 * 10^{3}\) | \(1.273 * 10^{3}\) |
Estimation of Land Surface Temperature¶
Several studies have described the estimation of Land Surface Temperature. Land Surface Temperature can be calculated from At-Satellite Brightness Temperature \(T_{B}\) as (Weng, et al. 2004):
where:
- \(\lambda\) = wavelength of emitted radiance
- \(c_{2} = h * c / s = 1.4388 * 10^{-2}\) m K
- \(h\) = Planck’s constant = \(6.626 * 10^{-34}\) J s
- \(s\) = Boltzmann constant = \(1.38 * 10^{-23}\) J/K
- \(c\) = velocity of light = \(2.998 * 10^{8}\) m/s
The values of \(\lambda\) for the thermal bands of Landsat and ASTER satellites can be calculated from the tables in Landsat Satellites and ASTER Satellite.
Several studies used NDVI for the estimation of land surface emissivity (Sobrino, et al., 2004); other studies used a land cover classification for the definition of the land surface emissivity of each class (Weng, et al. 2004). For instance, the emissivity (\(e\)) values of various land cover types are provided in the following table (from Mallick, et al. 2012).
Emissivity values
Land surface | Emissivity e |
---|---|
Soil | 0.928 |
Grass | 0.982 |
Asphalt | 0.942 |
Concrete | 0.937 |
References¶
- Ball, G. H. & Hall, D. J., 1965. ISODATA. A novel method of data analysis and pattern classification. Menlo Park: Stanford Research Institute.
- Chander, G. & Markham, B., 2003. Revised Landsat-5 TM radiometric calibration procedures and postcalibration dynamic ranges Geoscience and Remote Sensing, IEEE Transactions on, 41, 2674 - 2677
- Chavez, P. S., 1996. Image-Based Atmospheric Corrections - Revisited and Improved Photogrammetric Engineering and Remote Sensing, [Falls Church, Va.] American Society of Photogrammetry, 62, 1025-1036
- Congalton, R. and Green, K., 2009. Assessing the Accuracy of Remotely Sensed Data: Principles and Practices. Boca Raton, FL: CRC Press
- Didan, K.; Barreto Munoz, A.; Solano, R. & Huete, A., 2015. MODIS Vegetation Index User’s Guide. Collection 6, NASA
- ESA, 2015. Sentinel-2 User Handbook. Available at https://sentinels.copernicus.eu/documents/247904/685211/Sentinel-2_User_Handbook
- ESA, 2013. Sentinel-3 User Handbook. Available at https://sentinels.copernicus.eu/documents/247904/685236/Sentinel-3_User_Handbook
- Finn, M.P., Reed, M.D, and Yamamoto, K.H., 2012. A Straight Forward Guide for Processing Radiance and Reflectance for EO-1 ALI, Landsat 5 TM, Landsat 7 ETM+, and ASTER. Unpublished Report from USGS/Center of Excellence for Geospatial Information Science, 8 p, http://cegis.usgs.gov/soil_moisture/pdf/A%20Straight%20Forward%20guide%20for%20Processing%20Radiance%20and%20Reflectance_V_24Jul12.pdf
- Fisher, P. F. and Unwin, D. J., eds., 2005. Representing GIS. Chichester, England: John Wiley & Sons
- JARS, 1993. Remote Sensing Note. Japan Association on Remote Sensing. Available at http://www.jars1974.net/pdf/rsnote_e.html
- Jimenez-Munoz, J. C. & Sobrino, J. A., 2010. A Single-Channel Algorithm for Land-Surface Temperature Retrieval From ASTER Data IEEE Geoscience and Remote Sensing Letters, 7, 176-179
- Johnson, B. A., Tateishi, R. and Hoan, N. T., 2012. Satellite Image Pansharpening Using a Hybrid Approach for Object-Based Image Analysis ISPRS International Journal of Geo-Information, 1, 228. Available at http://www.mdpi.com/2220-9964/1/3/228)
- Kruse, F. A., et al., 1993. The Spectral Image Processing System (SIPS) - Interactive Visualization and Analysis of Imaging spectrometer. Data Remote Sensing of Environment
- Mallick, J.; Singh, C. K.; Shashtri, S.; Rahman, A. & Mukherjee, S., 2012. Land surface emissivity retrieval based on moisture index from LANDSAT TM satellite data over heterogeneous surfaces of Delhi city International Journal of Applied Earth Observation and Geoinformation, 19, 348 - 358
- Mohr, P. J.; Newell, D. B. & Taylor, B. N., 2015. CODATA Recommended Values of the Fundamental Physical Constants: 2014 National Institute of Standards and Technology, Committee on Data for Science and Technology
- Moran, M.; Jackson, R.; Slater, P. & Teillet, P., 1992. Evaluation of simplified procedures for retrieval of land surface reflectance factors from satellite sensor output Remote Sensing of Environment, 41, 169-184
- NASA, 2011. Landsat 7 Science Data Users Handbook Landsat Project Science Office at NASA’s Goddard Space Flight Center in Greenbelt, 186 http://landsathandbook.gsfc.nasa.gov/pdfs/Landsat7_Handbook.pdf
- NASA, 2013. Landsat 7 Science Data User’s Handbook. Available at http://landsathandbook.gsfc.nasa.gov
- Olofsson, P.; Foody, G. M.; Herold, M.; Stehman, S. V.; Woodcock, C. E. & Wulder, M. A., 2014. Good practices for estimating area and assessing accuracy of land change. Remote Sensing of Environment, 148, 42 – 57
- Ready, P. and Wintz, P., 1973. Information Extraction, SNR Improvement, and Data Compression in Multispectral Imagery. IEEE Transactions on Communications, 21, 1123-1131
- Richards, J. A. and Jia, X., 2006. Remote Sensing Digital Image Analysis: An Introduction. Berlin, Germany: Springer
- Sobrino, J.; Jiménez-Muñoz, J. C. & Paolini, L., 2004. Land surface temperature retrieval from LANDSAT TM 5 Remote Sensing of Environment, Elsevier, 90, 434-440
- USGS, 2015. Advanced Spaceborne Thermal Emission and Reflection Radiometer (ASTER) Level 1 Precision Terrain Corrected Registered At-Sensor Radiance Product (AST_L1T). AST_L1T Product User’s Guide. USGS EROS Data Center.
- Vermote, E. F.; Roger, J. C. & Ray, J. P., 2015. MODIS Surface Reflectance User’s Guide. Collection 6, NASA
- Weng, Q.; Lu, D. & Schubring, J., 2004. Estimation of land surface temperature–vegetation abundance relationship for urban heat island studies. Remote Sensing of Environment, Elsevier Science Inc., Box 882 New York NY 10159 USA, 89, 467-483
- Wikipedia, 2017. k-means clustering. Available at https://en.wikipedia.org/wiki/K-means_clustering
Podręczniki podstawowe¶
The following are very basic tutorials for land cover classification using the Semi-Automatic Classification Plugin (SCP). It is assumed that you have a basic knowledge of QGIS (you can find a guide to QGIS interface at this page).
Tutorial 1¶
The following is a basic tutorial about the land cover classification using the Semi-Automatic Classification Plugin (SCP). It is assumed that you have a basic knowledge of QGIS.
Tutorial 1: Your First Land Cover Classification¶
This is a basic tutorial about the use of SCP for the classification of a multispectral image. It is recommended to read the Brief Introduction to Remote Sensing before this tutorial.
The purpose of the classification is to identify the following land cover classes:
- Water;
- Built-up;
- Vegetation;
- Bare soil.
The study area of this tutorial is Greenbelt (Maryland, USA) which is the site of NASA’s Goddard Space Flight Center (the institution that will lead the development of the future Landsat 9 flight segment).
Following the video of this tutorial.
http://www.youtube.com/watch?v=fUZgYxgDjsk
Download the Data¶
We are going to download a Landsat Satellites image (data available from the U.S. Geological Survey) and use the following bands:
Blue;
Green;
Red;
Near-Infrared;
Short Wavelength Infrared 1;
Short Wavelength Infrared 2.
TIP : In case you have a slow connection you can download an image subset from this archive (about 5 MB, data available from the U.S. Geological Survey), unzip the downloaded file, and skip to Convert Data to Surface Reflectance.
Start QGIS and the SCP.
Open the tab Download products clicking the button in the Home, or in the Menu SCP,
We are searching a specific image acquired on 16 April 2017 because it is cloud free. In Search parameters enter the point coordinates:
UL: -77 / 39
LR: -76.9 / 38.9
Select L8 OLI/TIRS from the Products and set:
- Date from: 2017-04-16
- to: 2017-04-16
Now click the button Find and after a few seconds the image will be listed in the Product list.
Click the item in the table to display a preview that is useful for assessing the quality of the image and the cloud cover.
Now click the button to load the preview in the map.
We can also select the bands to be downloaded according to our purpose. In particular, select the tab Download options and check only the Landsat bands (that will be used in this tutorial): 2, 3, 4, 5, 6, 7, and the ancillary data.
For the purpose of this tutorial, uncheck the option Preprocess images (you should usually leave this checked) because we are going to preprocess the image in Convert Data to Surface Reflectance.
To start the image download, click the button RUN
and select a directory where bands are saved.
The download could last a few minutes according to your internet connection speed.
The download progress is displayed in a bar.
After the download, all the bands are automatically loaded in the map.
Clip the Data¶
For for limiting the study area (and reducing the processing time) we can clip the image.
First, we need to define a Band set containing the bands to be clipped.
Open the tab Band set clicking the button in the Menu SCP or the SCP dock.
Click the button to refresh the layer list, and select the bands: 2, 3, 4, 5, 6, and 7; then click
to add selected rasters to the Band set 1.
In Preprocessing open the tab Clip multiple rasters. We are going to clip the Band set 1 which contains Landsat bands.
Click the button and select an area such as the following image (left click in the map for the UL point and right click in the map for the LR point), or enter the following values:
- UL: 330015 / 4324995
- LR: 349995 / 4309995
Click the button RUN and select a directory where clipped bands are saved.
New files will be created with the file name prefix defined in Output name prefix.
When the process is completed, clipped rasters are loaded and displayed.
Convert Data to Surface Reflectance¶
Conversion to reflectance (see Radiance and Reflectance) can be performed automatically.
The metadata file (a .txt file whose name contains MTL
) downloaded with the images contains the required information for the conversion.
Read Image conversion to reflectance for information about the Top Of Atmosphere (TOA) Reflectance and Surface Reflectance.
In order to convert bands to reflectance, open the Preprocessing clicking the button in the Menu SCP or the SCP dock, and select the tab Landsat.
Click the button Directory containing Landsat bands and select the directory of clipped Landsat bands.
The list of bands is automatically loaded in the table Metadata.
Click the button Select MTL file and select the metadata file
LC08_L1TP_015033_20170416_20170501_01_T1_MTL.txt
from the directory of downloaded Landsat images.
Metadata information is added to the table Metadata.
In order to calculate Surface Reflectance we are going to apply the DOS1 Correction; therefore, enable the option Apply DOS1 atmospheric correction.
TIP : In general, it is recommended to perform the DOS1 atmospheric correction for the entire image (before clipping the image) in order to improve the calculation of parameters based on the image.
For the purpose of this tutorial, uncheck the option Create Band set and use Band set tools because we are going to define this in the following step Define the Band set and create the Training Input File.
In order to start the conversion process, click the button RUN and select the directory where converted bands are saved.
After a few minutes, converted bands are loaded and displayed (file name beginning with RT_
).
If Play sound when finished is checked in Classification process settings, a sound is played when the process is finished.
We can remove all the bands loaded in QGIS layers except the ones whose name begin with RT_
.
Define the Band set and create the Training Input File¶
Now we need to define the Band set which is the input image for SCP.
Open the tab Band set clicking the button in the Menu SCP or the SCP dock.
In Band set definition click the button to clear all the bands from active band set created during the previous steps.
Click the button to refresh the layer list, and select all the converted bands; then click
to add selected rasters to the Band set.
In the table Band set definition order the band names in ascending order (click to sort bands by name automatically).
Finally, select Landsat 8 OLI from the list Quick wavelength settings, in order to set automatically the Center wavelength of each band and the Wavelength unit (required for spectral signature calculation).
We can display a Color Composite of bands: Near-Infrared, Red, and Green: in the Working toolbar, click the list RGB= and select the item 4-3-2
(corresponding to the band numbers in Band set).
You can see that image colors in the map change according to the selected bands, and vegetation is highlighted in red (if the item 3-2-1
was selected, natural colors would be displayed).
TIP : If a Band set is defined, a temporary virtual raster (namedVirtual Band Set 1
) is created automatically, which allows for the display of Color Composite. In order to speed up the visualization, you can show only the virtual raster and hide all the layers in the QGIS Layers.
Now we need to create the Training input in order to collect Training Areas (ROIs) and calculate the Spectral Signature thereof (which are used in classification).
In the SCP dock select the tab Training input and click the button to create the Training input (define a name such as
training.scp
).
The path of the file is displayed and a vector is added to QGIS layers with the same name as the Training input (in order to prevent data loss, you should not edit this layer using QGIS functions).

Definition of Training input in SCP
Create the ROIs¶
We are going to create ROIs defining the Classes and Macroclasses. Each ROI is identified by a Class ID (i.e. C ID), and each ROI is assigned to a land cover class through a Macroclass ID (i.e. MC ID).
Macroclasses are composed of several materials having different spectral signatures; in order to achieve good classification results we should separate spectral signatures of different materials, even if belonging to the same macroclass. Thus, we are going to create several ROIs for each macroclass (setting the same MC ID, but assigning a different C ID to every ROI).
We are going to used the Macroclass IDs defined in the following table.
Macroclasses
Macroclass name | Macroclass ID |
---|---|
Water | 1 |
Built-up | 2 |
Vegetation | 3 |
Bare soil (low vegetation) | 4 |
ROIs can be created by manually drawing a polygon or with an automatic region growing algorithm.
Zoom in the map over the dark area in the upper right corner of the image which is a water body.
In order to create manually a ROI inside the dark area, click the button in the Working toolbar.
Left click on the map to define the ROI vertices and right click to define the last vertex closing the polygon.
An orange semi-transparent polygon is displayed over the image, which is a temporary polygon (i.e. it is not saved in the Training input).
TIP : You can draw temporary polygons (the previous one will be overridden) until the shape covers the intended area.
If the shape of the temporary polygon is good we can save it to the Training input.
Open the Training input to define the Classes and Macroclasses .
In the ROI Signature list set MC ID = 1 and MC Info = Water
; also set C ID = 1 and C Info = Lake
.
Now click to save the ROI in the Training input.
After a few seconds, the ROI is listed in the ROI Signature list and the spectral signature is calculated (because Signature was checked).

The ROI saved in the Training input
As you can see, the C ID in ROI Signature list is automatically increased by 1. Saved ROI is displayed as a dark polygon in the map and the temporary ROI is removed. Also, in the ROI Signature list you can notice that the Type is B, meaning that the ROI spectral signature was calculated and saved in the Training input.
You can also see in the tab Macroclasses that the first macroclass has been added to the table Macroclasses .

Macroclasses
Now we are going to create a second ROI for the built-up class using the automatic region growing algorithm.
Zoom in the lower region of the image.
In Working toolbar set the Dist value to 0.08 .
Click the button in the Working toolbar and click over the purple area of the map.
After a while the orange semi-transparent polygon is displayed over the image.
TIP : Dist value should be set according to the range of pixel values; in general, increasing this value creates larger ROIs.
In the ROI Signature list set MC ID = 2 and MC Info = Built-up
; also set C ID = 2 (it should be already set) and C Info = Buildings
.

The ROI saved in the Training input
Again, the C ID in ROI Signature list is automatically increased by 1.
After clicking the button in the Working toolbar you should notice that the cursor in the map displays a value changing over the image.
This is the NDVI value of the pixel beneath the cursor (NDVI is displayed because the function
Display is checked in Training input).
The NDVI value can be useful for identifying spectrally pure pixels, in fact vegetation has higher NDVI values than soil.
For instance, move the mouse over a vegetation area and left click to create a ROI when you see a local maximum value. This way, the created ROI and the spectral signature thereof will be particularly representative of healthy vegetation.
Create a ROI for the class Vegetation
(red pixels in color composite RGB=4-3-2
) and a ROI for the class Bare soil (low vegetation)
(green pixels in color composite RGB=4-3-2
) following the same steps described previously.
The following images show a few examples of these classes identified in the map.
Assess the Spectral Signatures¶
Spectral signatures are used by Classification Algorithms for labelling image pixels. Different materials may have similar spectral signatures (especially considering multispectral images) such as built-up and soil. If spectral signatures used for classification are too similar, pixels could be misclassified because the algorithm is unable to discriminate correctly those signatures. Thus, it is useful to assess the Spectral Distance of signatures to find similar spectral signatures that must be removed. Of course the concept of distance vary according to the algorithm used for classification.
One can simply assess spectral signature similarity by displaying a signature plot.
In order to display the signature plot, in the ROI Signature list highlight two or more spectral signatures (with click in the table), then click the button .
The Wykres sygnatur widmowych is displayed in a new window.
Move and zoom inside the Wykres to see if signatures are similar (i.e. very close).
Double click the color in the Lista sygnatur w wykresie to change the line color in the plot.
We can see in the following figure a signature plot of different materials.
In the plot we can see the line of each signature (with the color defined in the ROI Signature list), and the spectral range (minimum and maximum) of each band (i.e. the semi-transparent area colored like the signature line). The larger is the semi-transparent area of a signature, the higher is the standard deviation, and therefore the heterogeneity of pixels that composed that signature. Spectral similarity between spectral signatures is highlighted in orange in the Lista sygnatur w wykresie.
Additionally, we can calculate the spectral distances of signatures (for more information see Spectral Distance).
Highlight two or more spectral signatures with click in the table Lista sygnatur w wykresie, then click the button ; distances will be calculated for each pair of signatures.
Now open the tab Odległości widmowe; we can notice that similarity between signatures vary according to considered algorithm.
For instance, two signatures can be very similar for Spectral Angle Mapping (very low Spectral Angle), but quite distant for the Maximum Likelihood (Jeffries-Matusita Distance value near 2). The similarity of signatures is affected by the similarity of materials (in relation to the number of spectral bands available); also, the way we create ROIs influences the signatures.
Spectral signature values, standard deviation and other details such as the number of ROI pixels are displayed in the Szczegóły sygnatury.
We need to create several ROIs (i.e. spectral signatures) for each macroclass (repeating the steps in Create the ROIs), assigning a unique C ID to each spectral signature, and assess the spectral distance thereof in order to avoid the overlap of spectral signatures belonging to different macroclasses.
In the list RGB= of the Working toolbar type 3-4-6
(you can also use the tool RGB list).
Using this color composite, urban areas are purple and vegetation is green.
You can notice that this color composite RGB = 3-4-6
highlights roads more than natural color (RGB = 3-2-1
).
The following examples display a few RGB color composites of Landsat images.
TIP : Change frequently the Color Composite in order to clearly identify the materials at the ground; use the mouse wheel on the list RGB= of the Working toolbar for changing the color composite rapidly; also use the buttonsand
for better displaying the Input image (i.e. image stretching).
It is worth mentioning that you can show or hide the temporary ROI clicking the button ROI in Working toolbar.
TIP : Install the plugin QuickMapServices in QGIS, and add a map (e.g. OpenStreetMap) in order to facilitate the identification of ROIs using high resolution data.
Create a Classification Preview¶
The classification process is based on collected ROIs (and spectral signatures thereof). It is useful to create a Classification preview in order to assess the results (influenced by spectral signatures) before the final classification. In case the results are not good, we can collect more ROIs to better classify land cover.
Before running a classification (or a preview), set the color of land cover classes that will be displayed in the classification raster. In the ROI Signature list, double click the color (in the column Color) of each ROI to choose a representative color of each class.

Definition of class colors
Also, we need to set the color for macroclasses in table Macroclasses.

Definition of macroclass colors
Now we need to select the classification algorithm. In this tutorial we are going to use the Maximum Likelihood.
Open the Classification to set the use of classes or macroclasses.
Check Use C ID and in Algorithm select the Maximum Likelihood.

Setting the algorithm and using C ID
In Classification preview set Size = 300; click the button and then left click a point of the image in the map.
The classification process should be rapid, and the result is a classified square centered in clicked point.
Previews are temporary rasters (deleted after QGIS is closed) placed in a group named Class_temp_group in the QGIS panel Layers.
Now in Classification check Use MC ID and click the button
in Classification preview.
We can see that now there are only 4 colors representing the macroclasses.
TIP : When loading a previously saved QGIS project, a message could ask to handle missing layers, which are temporary layers that SCP creates during each session and are deleted afterwards; you can click Cancel and ignore these layers; also, you can delete these temporary layers clicking the buttonin Working toolbar.
In general, it is good to perform a classification preview every time a ROI (or a spectral signature) is added to the ROI Signature list. Therefore, the phases Create the ROIs and Create a Classification Preview should be iterative and concurrent processes.
Create the Classification Output¶
Assuming that the results of classification previews were good (i.e. pixels are assigned to the correct class defined in the ROI Signature list), we can perform the actual land cover classification of the whole image.
In Classification check Use MC ID.
In the Classification output click the button
and define the path of the classification output, which is a raster file (.tif).
If
Play sound when finished is checked in Classification process settings, a sound is played when the process is finished.
Well done! You have just performed your first land cover classification.
However, you can see that there are several classification errors, because the number of ROIs (spectral signatures) is insufficient.
We can improve the classification using some of the tools that will be described in other tutorials.
Tutorial 2¶
The following is a tutorial about the functions of the Semi-Automatic Classification Plugin (SCP). It is assumed that you have a basic knowledge of QGIS.
Tutorial 2: Cloud Masking, Image Mosaic, and Land Cover Change Location¶
This tutorial is about the use of SCP for the assessment of land cover change of a multispectral image. It is recommended to complete the Tutorial 1: Your First Land Cover Classification before this tutorial.
The purpose of this tutorial is to locate land cover change over one year (between 2017 and 2018), using free Sentinel-2 images.
Following the video of this tutorial.
http://www.youtube.com/watch?v=xm9s97GPs0Y
Download the Data¶
We are going to download a Sentinel-2 Satellite image (Copernicus land monitoring services) and use the bands illustrated in the following table.
Sentinel-2 Bands | Central Wavelength [micrometers] | Resolution [meters] |
---|---|---|
Band 2 - Blue | 0.490 | 10 |
Band 3 - Green | 0.560 | 10 |
Band 4 - Red | 0.665 | 10 |
Band 5 - Vegetation Red Edge | 0.705 | 20 |
Band 6 - Vegetation Red Edge | 0.740 | 20 |
Band 7 - Vegetation Red Edge | 0.783 | 20 |
Band 8 - NIR | 0.842 | 10 |
Band 8A - Vegetation Red Edge | 0.865 | 20 |
Band 11 - SWIR | 1.610 | 20 |
Band 12 - SWIR | 2.190 | 20 |
Start QGIS and the SCP .
Open the tab Download products clicking the button in the Home, or in the Menu SCP.
In the tab Download products click the button
to display the OpenStreetMap tiles (© OpenStreetMap contributors) in the QGIS map, licensed as CC BY-SA (Tile Usage Policy ).
In general it is possible to define the area coordinates clicking the button , then left click in the map for the UL point and right click in the map for the LR point.
In this tutorial the study area is Rome (Italy), therefore click in the map to define the search area, or alternatively, enter these point coordinates in Search parameters:
- UL: 12.4 / 41.9
- LR: 12.5 / 41.8
The purpose of this tutorial is to map the land cover change between 2017 and 2018, therefore we need to download at least two images. Because of cloud cover, we are going to download an additional image for 2016, which will be used to replace pixels covered by clouds in the first image. We are searching for three images (tile 33TTG) acquired on:
- 01 January 2017
- 10 February 2017
- 10 February 2018
Therefore, we need to perform three searches.
Select Sentinel-2 from the Products and set:
- Date from: 2017-01-01
- to: 2017-01-01
In this case, enter L1C_T33TTG
in Filter to filter the results only for the tile 33TTG.
Now click the button Find and after a few seconds the image will be listed in the Product list.
Click the item in the table to display a preview that is useful for assessing the quality of the image and the cloud cover.
Repeat the date definition and the search also for the 2017-02-10 image. You can notice that there are a few clouds over the area, therefore we are going to mosaic this image with the one acquired on 2017-01-01.
Finally, repeat the search for the 2018-02-10 image.
We can also select the bands to be downloaded according to our purpose. In particular, select the tab Download options and check only the Sentinel-2 bands that will be used in this tutorial and the ancillary data.
For the purpose of this tutorial, uncheck the option Only if preview in Layers because we want to download and preprocess all the images listed in the table.
Before starting the download we need to set the preprocessing options in the tab Sentinel-2 for preforming the DOS1 Correction.
Check the options Apply DOS1 atmospheric correction and
Add bands in a new Band set to automatically create a Band set for each image.
To start the image download, in the tab Download products click the button RUN and select a directory where bands are saved (a new directory will be created for each image).
The download could last a few minutes according to your internet connection speed.
The download progress is displayed in a bar.
After the download, all the bands of all the Sentinel-2 images (© Copernicus Sentinel data 2018) are automatically loaded in the map.
We can also display the RGB color composite of the Band sets clicking the list RGB= in the Working toolbar, and selecting the item 3-2-1
.
Create the cloud cover mask¶
Before the land cover change assessment, we need to remove cloud cover pixels in the image acquired on 2017-02-10. Of course we could perform the same process for all the other images.
In QGIS, load the file MSK_CLOUDS_B00.gml
that should be inside the directory L1C_T33TTG_A008556_20170210T100132_2017-02-10
.
This vector file represents most of the cloud cover in the image.
In QGIS Layers Panel, left click the vector MSK_CLOUDS_B00 MaskFeature
and select Export > Save Feature as
to save this gml file to shapefile (e.g. clouds.shp
).
We can convert this vector file to raster using the tab Vector to raster.
Click the button to refresh the layer list, and select the vector
clouds
.
Check the Use constant value to set the raster value 1 for clouds.
Also, in Select the reference raster select the name of a band.
This will create a raster with the same size and aligned to the Sentinel-2 image.
Finally click the button RUN
to create the mask.
We could also improve the mask by manually editing the pixel of the raster using the tool Edit raster or creating a semi-automatic classification of clouds.
Mask clouds in the Sentinel-2 image¶
We are going to mask all the pixels covered by clouds in all the bands composing the Band set of the image acquired on 2017-02-10.
In the tab Cloud masking, set the number of the 2017-02-10 Band set in Select input band set.
In Select the classification we select the mask created at the previous step.
Enter 1 in Mask class values.
Finally, uncheck Use buffer of pixel size to speed up the masking process.
Now click the button RUN to select the output directory and start the masking process.
Mosaic the Sentinel-2 images¶
We are going to mosaic the 2017 images in order to create a cloud free image to be used for land cover change.
We use the image acquired on 2017-01-01 to fill the gaps in the 2017-02-10 image.
In the tab Band set, add a new Band set with the button and add the masked bands.
Now we can mosaic the 2017 images.
In the tab Mosaic of band sets, in the Band set list enter the number of the 2017-02-10 masked Band set, followed by comma, followed by the number of the 2017-01-01 Band set.
Now click the button RUN to select the output directory and start the masking process.
We could have used more than 2 Band sets. The process automatically mosaic the corresponding bands of the input Band sets filling the NoData gaps of the first Band set with the pixels of the following Band sets. The mosaic bands are automatically added to the map.
Land cover change¶
We are going to automatically locate the land cover change between the image mosaic of 2017 and the 2018 image.
SCP includes a tool that allows for calculating the spectral distance between every corresponding pixel of two Band sets, and creating a raster of changes through a spectral distance threshold.
In the tab Band set, add a new Band set with the button and add the mosaic bands.
In the tab Spectral distance, set the number of the 2017 mosaic Band set in Select first input band set, and set the number of the 2018 Band set in Select second input band set.
In Distance algorithm check the Spectral Angle Mapping.
Check the
Distance threshold and set the value 10 that is the threshold used for creating the raster of changes.
Now click the button RUN to select the output directory and start the masking process.
After a while, the spectral distance raster and the raster of changes are added to the map
This is an automatic method for locating land cover changes. We can see that most land cover changes are due to crop variations.
For instance, this method could be useful to assess vegetation burnt area or forest logging. We could set a different threshold value for increasing or reducing the number of pixels identified as changes.
Of course, in order to identify the type of land cover change we should identify the land cover classes of the images through photo-interpretation or with semi-automatic classification.
Advanced Tutorials¶
The following are advanced tutorials using the Semi-Automatic Classification Plugin (SCP). It is assumed that you have already performed the Podręczniki podstawowe.
Tutorial 3¶
The following is a tutorial about the functions of the Semi-Automatic Classification Plugin (SCP). It is assumed that you have a basic knowledge of QGIS.
Tutorial 3: Accuracy Assessment of a Land Cover Classification¶
Accuracy assessment is a fundamental step after land cover classification in order to evaluate errors, globally and for each class, and finally evaluate the reliability of the map.
This post is a tutorial about accuracy assessment of a land cover classification using the Semi-Automatic Classification Plugin (SCP) for QGIS. We are going to use the function of SCP to create ROIs using stratified random points (a new function of SCP 6.4.0), which will be photo-interpreted and used as reference for the accuracy assessment. The SCP tool Accuracy will take care of the rest, providing the error matrix and the accuracy estimates.
The following is the video tutorial, and the following text illustrates the phases in detail.
http://www.youtube.com/watch?v=H1cL0yhIygg
Accuracy assessment is performed comparing a sample of points (ground truth) to the classification. There are several ways to choose the sample size and the allocation thereof (sample scheme). The sample should be designed in order to achieve low standard errors of accuracy estimates, and usually this is achieved by random selection of samples.
Sample design depends on several variables such as the proportions of land cover classes and the standard errors that we expect for the overall land cover classification and single classes. In order to reduce standard errors of class specific estimates, it is recommended to stratify the sample. For further details about how to determine the sample size and the stratification, please refer to „Olofsson, et al., 2014. Good practices for estimating area and assessing accuracy of land change. Remote Sensing of Environment, 148, 42 – 57”.
Sample Design¶
This tutorial assumes that you have already performed the classification of a Landsat image following the instructions of this previous Tutorial 1: Your First Land Cover Classification. You can download the classification raster from this archive .
The land cover classes are described in the following table.
Classes
Macroclass name | Class ID |
---|---|
Water | 1 |
Built-up | 2 |
Vegetation | 3 |
Bare soil (low vegetation) | 4 |
Basically, the main requirement is to provide an adequate number of samples for each class, even if the class area proportion (\(W_i\)) is low. The number of samples (\(N\)) should be calculated as (Olofsson, et al., 2014):
where:
- \(W_i\) = mapped area proportion of class i;
- \(S_i\) = standard deviation of stratum i;
- \(S_o\) = expected standard deviation of overall accuracy;
- \(c\) = total number of classes;
This requires some conjectures about overall accuracy and user’s accuracy of each class. We should base these conjectures on previous studies. One can hypothesize that user’s accuracy is lower and standard deviations \(S_i\) is higher for classes having low area proportion, but of course these values should be carefully evaluated.
To get \(W_i\) start QGIS and load the classification raster.
Open the Menu SCP and click the tab Classification report under the submenu
Postprocessing
.
This tool allows for estimating class area and class percentage.
Click the button to refresh the layer list, and select the classification raster in Select the classification
; next click RUN
to start the calculation; the output report is saved in a text file and displayed in the tab Output.
The report table contains the percentage of each class, which we divide by 100 to get the required \(W_i\). In this tutorial we assume \(S_o = 0.01\) and conjecture the \(S_i\) values reported in the following table (of course, these assumptions are specific of this classification, other assumptions should be made for other classifications).
Conjectured standard deviations
Land Cover Class | Area \(m^2\) | \(W_i\) | \(S_i\) | \(W_i * S_i\) |
---|---|---|---|---|
1 | 976,500 | 0.0033 | 0.4 | 0.0013 |
2 | 111,267,000 | 0.3713 | 0.3 | 0.1114 |
3 | 187,018,200 | 0.6240 | 0.2 | 0.1248 |
4 | 438,300 | 0.0015 | 0.5 | 0.0007 |
Total | 0.2382 |
Therefore, \(N = (0.2382 / 0.01)^2 = 567\) is the number of samples that we should distribute among classes.
To stratify the sample we should conjecture user’s accuracy and standard deviations of strata (Olofsson, et al., 2014).
A rough approximation is considering the mean value between equal distribution (\(N_i = N / c\)) and weighted distribution (\(N_i = N * W_i\)), which is \(N_i = (N / c + N * W_i) / 2\) as illustrated in the following table.
Sample stratification
Land Cover Class | Weighted | Equal | Mean |
---|---|---|---|
1 | 2 | 142 | 72 |
2 | 210 | 142 | 176 |
3 | 354 | 142 | 248 |
4 | 1 | 142 | 71 |
Total | 567 |
Sample Collection and Photo-Intepretation¶
This phase involves the creation of (randomly selected) single pixel Training Areas (ROIs), and the attribution of a land cover class based on photo-interpretation of each ROI.
First, we need to define a Band set containing the classification raster that is an input required by the other tools we are going to use.
Open the tab Band set clicking the button in the Menu SCP or the SCP dock.
Click the button
to refresh the layer list, and select the classification raster; then click
to add selected raster to the Band set 1.
We need to create the Training input in order to collect ROIs that will be the actual samples.
In the SCP dock select the tab Training input and click the button to create the Training input (define a name such as
sample.scp
).
The path of the file is displayed and a vector is added to QGIS layers with the same name as the Training input (in order to prevent data loss, you should not edit this layer using QGIS functions).

Training input
Now we are going to create the stratified random sample using the SCP tool Multiple ROI creation. This tool allows for the random creation of point coordinates according to the sample scheme previously defined.
This tool works in two steps:
- randomly select point coordinates defining ROI parameters;
- actually create ROI polygons based on point coordinates;
During the first step, in addition to point coordinates, other fields are automatically filled in the table from the parameters set in the Working toolbar, such as the minimum and maximum ROI size. In this tutorial we use single pixel ROIs, although cluster sampling (several pixels per ROI) is also used for accuracy assessment. To avoid manually editing these fields after the random point creation, in Temporary ROI we need to set the parameters Min = 1 and Max = 1. Created random samples will have the size of 1 pixel.
Now, open the Menu SCP and click the tab Multiple ROI Creation under the submenu
Basic tools
.
To reduce the photo-intepretation time (considering the illustrative purpose of this tutorial and that the classification is a subset of a Landsat image), we are going to divide the number of samples by 10 according to the following table (of course, in real cases we must use all the samples as designed).
Number of stratified samples
Land Cover Class | Samples |
---|---|
1 | 7 |
2 | 18 |
3 | 25 |
4 | 7 |
Total | 57 |
In Number of points enter 7 that is the number of samples designed for class 1.
In the tab Multiple ROI Creation check the option
stratified for the values and enter the first expression
raster == 1
(notice the double „=”).
This expression means that we are going to randomly select points that fall over pixels having value 1 of the classification (that is the first band of the Band set 1).
Therefore click Create points to start the random creation.
After a while point coordinates will be added to the table Point coordinates and ROI definition.
Now we repeat the above steps for class 2.
In Number of points enter 18 and in stratified for the values enter raster == 2
.
Click Create points and the samples will be added to the table.
Repeat the same steps for class 3 (25 points and raster == 3
) and for class 4 (57 points and raster == 4
).
Now that we have all the required samples we can create the ROIs (the single pixel polygons that will be photo-interpreted).
Uncheck the option Calculate sig. because we don’t need the spectral signature of ROIs and click RUN
.
After a while the ROIs will be added to the the Training input.

Samples added to the training input
The type R
means that, of course, spectral signatures were not calculated.
All the created ROIs have the same MC ID (i.e. macroclass ID) and C ID (i.e. class ID); now we can assign the correct class (MC ID) to each ROI with photo-interpretation using images with resolution higher than the classification, or other services such as OpenStreetMap).
In the ROI Signature list, double click on the first ROI in order to zoom to the ROI; after photo-interpreting the class we can assing the correct MC ID and C ID with a click on the corresponding field in the ROI list.
Of course we need to perform the photo-interpretation of all the samples, assigning the correct code. The photo-interpretation should be performed without considerding the classification raster. It is worth highlighting that spatial resolution (i.e. 30m) implies mixed pixels (i.e. pixels made of multiple materials at ground); therefore, during the photo-interpretation we must consider the most prevalent land cover in the ROI area.
Calculation of Accuracy Statistics¶
After the photo-interpretation of all the samples, we can perform the accuracy assessment by comparing the ROIs to the classification. If you have skipped the previous step, you can download the photo-interpreted sample from here .
The process will produce an an error raster (a .tif
file showing the errors in the map, where pixel values represent the combinations between the classification and reference identified by the ErrorMatrixCode
in the error matrix) and a text file (i.e. a .csv
file separated by tab) containing the error matrix and the accuracy statistics.
Open the Menu SCP and click the tab Accuracy under the submenu
Postprocessing .
In Select the classification to assess select the
classification
(click the button if the raster isn’t in the list).
In Select the reference vector or raster select the
sample
vector that is the Training input, and in Vector field select
MC_ID
that is the vector field containing the class values.
Now we can click RUN to start the raster processing.
After the calculation the accuracy statistics are displayed in the output interface and the error raster is loaded in QGIS.
Several statistics are calculated such as overall accuracy, user’s accuracy, producer’s accuracy, and Kappa hat. In particular, these statistics are calculated according to the area based error matrix (Olofsson, et al., 2014) where each element represents the estimated area proportion of each class. This allows for estimating the unbiased user’s accuracy and producer’s accuracy, the unbiased area of classes according to reference data, and the standard error of area estimates and the confidence intervals. Of course the standard errors are influenced by the low number of samples that we have collected in this tutorial.
Area based error matrix
Reference | |||||
---|---|---|---|---|---|
1 | 2 | 3 | 4 | ||
Classified | 1 | 0.0023 | 0 | 0.0009 | 0 |
2 | 0 | 0.3094 | 0.0619 | 0 | |
3 | 0 | 0.0998 | 0.5242 | 0 | |
4 | 0 | 0 | 0.0004 | 0.0010 | |
Total | 0.0023 | 0.4092 | 0.5874 | 0.0010 |
The overall accuracy is 83.7% that is a good result (above 80%). However, this classification was produced for the first basic tutorial, therefore the classification could be improved. Also, note that we used a number of samples lower than designed sample.
The user’s and producer’s accuracy are provided for each class.
Producer’s and user’s accuracy
1 | 2 | 3 | 4 | |
---|---|---|---|---|
Producer’s accuracy | 100.0 | 75.6 | 89.2 | 100.0 |
User’s accuracy | 71.4 | 83.3 | 84.0 | 71.4 |
We can see that classes 1 and 4 (bare soil and water respectively) have low user’s accuracy, while class 2 (built-up) has low producer’s accuracy. We also get the unbiased area estimates (in \(m^2\)) and the confidence intervals.
Unbiased area estimates
1 | 2 | 3 | 4 | |
---|---|---|---|---|
Area | 697,500 | 122,645,412 | 176,044,017 | 313,071 |
95% Confidence interval Area | 352,984 | 33,778,661 | 33,780,877 | 158,436 |
These estimates are quite different from the ones directly derived from the classification raster (in the classification report), but are based on reference data. For instance, the class 2 (built-up) has an estimated area of 122,645,412 \(m^2\), while it resulted 111,267,000 \(m^2\) from the classification raster. Also, the confidence intervals provide information about the uncertainty of these estimates.
Tutorial 4¶
The following is a tutorial about the functions of the Semi-Automatic Classification Plugin (SCP). It is assumed that you have a basic knowledge of QGIS.
Tutorial 4: Postprocessing tools for assessing land cover change¶
This tutorial aims to analyze land cover change using SCP Postprocessing tools. Basically, we are going to assess land cover change from two raster classifications, and relate the changes to a land use vector file. An overview of several postprocessing tools is also provided.
The following is the video tutorial, and the following text illustrates the phases in detail.
http://www.youtube.com/watch?v=0IUosyr4pRw
The tools can be applied to any land cover classification, but we are going to use Copernicus data, which are freely available (as established by the EU Regulation No 1159/2013 of 12 July 2013) and cover the European countries. Of course, this tutorial is designed for demonstration purposes and it is not endorsed by the European Union. The original Copernicus data (produced with funding by the European Union) are downloaded from https://land.copernicus.eu/ and remain the sole property of the European Union.
Following, a brief description of the data we are going to use.
The Copernicus High Resolution Layers are raster classifications with 20m spatial resolution. Several land cover classes are available, but in this tutorial we are going to use the Imperviousness Density for 2012 and 2015. These data classify the degree of imperviousness (0-100% of impermeable cover of soil), which is the artificially sealed area. The Imperviousness Density was produced using automatic derivation based on calibrated Normalized Difference Vegetation Index. You can find the detailed product specifications here.
The Copernicus Corine Land Cover is a land use/land cover vector produced by standard methodology of photo-interpretation of satellite images. The vector is classified in 44 classes divided in 3 hierarchical levels with minimum mapping unit of 25 hectares. In this tutorial we are considering only the first level of Corine Land Cover 2012, divided in these classes:
- artificial surfaces
- agricultural areas
- forests and semi-natural areas
- wetlands
- water bodies
Refine the classifications with direct editing¶
You can download the data for this tutorial from this archive , or use your own data (two classification rasters and a land use vector).
For this tutorial, the original Copernicus data were modified by clipping the rasters to a small area over Florence (Italy).
Start QGIS and load the two rasters IMD_2012.tif
and IMD_2015.tif
that are Copernicus Imperviousness Density for 2012 and 2015 respectively.
As you can see, the rasters have values from 0 to 100, representing the degree of imperviousness.
It is useful to refine the classification by photo-interpretation, especially for data produced by semi-automatic processing.
We can use high resolution images or other services such as OpenStreetMap. For example you can follow this tutorial Download the Data to download satellite images, or you can download a subset of a Landsat 8 image, already converted to reflectance, from this link (about 27 MB, data available from the U.S. Geological Survey), unzip the downloaded file, and load the bands in QGIS.
First, we need to define a Band set containing a classification raster (this is required for drawing ROIs).
Open the tab Band set clicking the button in the Menu SCP or the SCP dock.
Click the button
to refresh the layer list, and select the
IMD_2012
raster (just this raster is sufficient); then click to add selected raster to the Band set 1.
Optionally, we can create a band set for the satellite image to display a color composite; open the tab Band set and select all the Landsat bands in the list; click to add a new band set, then click
to add selected rasters to the Band set 2.
In QGIS zoom to an area where we want to correct the classification. In this case we are going to manually remove a few pixels pretending they are classification errors.
We need to manually create a ROI, but first check that the Band set 1 is active.
Now click the button in the Working toolbar.
Left click on the map to define the ROI vertices and right click to define the last vertex closing the polygon.
An orange semi-transparent polygon is displayed over the image, which is a temporary polygon (in this case we don’t need to define the Training input).
Now open the tool Edit raster opening the Menu SCP and the submenu
Postprocessing
.
Select the Input raster, for instance IMD_2012
.
According to the legend of Imperviousness Density, in Use constant value enter 100 (we want to correct impervious pixels; in case we would like to correct not impervious pixels we would enter the value 0).
The other options are fine.
Therefore, click RUN
to edit the raster.
Attention: the input raster is directly edited; it is recommended to create a backup copy of the input raster before using this tool in order to prevent data loss.
Of course we could repeat these steps to edit any area of the raster.
TIP : Sometimes changes are not immediately visibile because the raster is not refreshed; try to zoom out and zoom in to refresh the view.
Classification report¶
It could be interesting to know the area of each land cover class.
In order to get the area statistics, open the Menu SCP and click the tab Classification report under the submenu
Postprocessing
.
Click the button to refresh the layer list, and select the
IMD_2012
raster in Select the classification ; next click RUN
to start the calculation; the output report is saved in a text file and displayed in the tab Output.
We can repeat the same steps for the IMD_2015
raster.
Over the 86% of the area is not impervious.
Reclassification¶
Before calculating land cover change it is convenient to reclassify the imperviousness degree into two classes: built-up and not built-up. A possible threshold for the distinction between built-up and not built-up is 30% (for further information read this document ). We can reclassify the raster using the SCP tool, obtaining the simple classification 1 = built-up and 0 = not built-up.
Open the tool Reclassification.
In Select the classification select the raster
IMD_2012
.
Click the button twice to add two rows to the table.
We need to enter the expressions illustrated in the following table.
Reclassification table
Old value | New value |
---|---|
raster < 30 | 0 |
raster >= 30 | 1 |
Uncheck the options Use code from Signature list and click RUN
to start the reclassification.
A new raster will be created (e.g.
BU_2012
).
Now select the IMD_2015
(the reclassification table is the same as before) and click RUN to reclassify the 2015 raster (e.g.
BU_2015
).
Now the two reclassified rasters are loaded in the map and we can assing an appropriate symbology.
Remove isolated pixels¶
We are going to compute the land cover change, but first we may want to remove isolated pixels in order to improve the analysis. In fact, single pixels may not represent real changes between the two classifications, because of geometrical shifts or isolated classification errors. Of course, this step is not always required, and it should be avoided if the purpose of the analysis is to find also the smallest changes.
We are going to use classification sieve for removing single pixels.
Open the tool Classification sieve.
In Size threshold leave 2; all patches smaller the the selected number of pixels (i.e. single pixels) will be replaced by the value of the largest neighbour patch. Of course we could increase this value if we want to remove larger patches.
In Select the classification select the raster BU_2012
.
The option 4 in Pixel connection determines how pixels are considered connected, that is in a 3x3 window diagonal pixels are not considered connected.
If we select the option 8 also diagonal pixels are considered connected.
Now click RUN to create the new raster
BU_2012_sieve
.
Of course, we should repeat these steps also for raster BU_2015
to create the new raster BU_2015_sieve
.
Assess land cover change¶
Now we can use the tool to assess land cover change between the two classifications 2012 and 2015.
Open the tool Land cover change.
This tool is quite straightforward.
Click the button to refresh the layer list.
In Select the reference classification select the
BU_2012_sieve
raster, that is the first classification.
In Select the new classification select the BU_2015_sieve
raster, that is the latest classification.
Uncheck the option Report unchanged pixels, because we want to report only the pixels where the classification changed between 2012 and 2015.
Now click RUN
to create the new land cover change raster (e.g.
change
).
Also, a text file is created (i.e. a file .csv separated by tab) containing the land cover change statistics.
The values of the land cover change raster represent a combination between reference and new classification, as described in the text file.
In this case, only the value 1 is present that is the condition where BU_2012_sieve
= 0 and BU_2015_sieve
= 1.
From the report we ca read that 520 pixels changed from 0 to 1, while no pixel changed from 1 to 0 between years 2012 and 2015.
Analyze the context of land cover changes¶
Now, it could be interesting to compare land cover change to other data such as land use, in order to analyze the context of new built-up areas. We are going to cross the land cover changes to the vector of Corine Land Cover; this way we can differentiate the new built-up areas according to Corine Land Cover classification system.
The original Corine Land Cover data were modified by clipping to a small area over Florence (Italy) and adding a field Class_1
filled with the first level of classification.
Load in QGIS the Copernicus Corine Land Cover shapefile CLC_2012.shp
previously downloaded.
You can see the symbology of the first level Corine Land Cover classes that are:
- artificial surfaces
- agricultural areas
- forests and semi-natural areas
- wetlands
- water bodies
Open the tool Cross classification.
Click the button
to refresh the layer list.
In Select the classification select the
change
raster, that is our land cover change.
Check Use NoData value and set the value 0, in order to exclude unchanged pixels (having value 0 in the
change
raster) from the analysis.
In Select the reference vector or raster select the vector CLC_2012
and in Vector field select the field Class_1
, containing the code of first level classes.
Now click RUN to create a new raster of comparison (e.g.
change_CLC
).
The output will report the area of each combination between change
code and CLC_2012
code.
From the cross matrix we can evaluate the area in \(m^2\) of built-up changes occurrend in the 5 classes of Corine Land Cover classification.
Cross matrix
CLC_2012 | ||||||
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | ||
Change | 1 | 157600 | 48400 | 2000 | 0 | 0 |
The tool Cross classification can be very useful also for other analyses that involve the comparison with other data, such as population or flood risk, but this could be the subject of other tutorials.
Assess the spectral signature of changes¶
An optional step could be the assessment of the spectral signature of changes. We can download satellite images (see Tutorial 1: Your First Land Cover Classification for the details) and calculate spectral signatures for monitoring the changes through time.
We are going to use the Landsat 8 image downloaded at the beginning of this tutorial for calculating the spectral signature of changes.
First, we need to create a Training input to store the spectral signatures calculated from the classes.
In the SCP dock select the tab Training input and click the button to create the Training input (define a name such as
signatures.scp
).
The path of the file is displayed and a vector is added to QGIS layers with the same name as the Training input (in order to prevent data loss, you should not edit this layer using QGIS functions).
Now open the tool Class signature opening the Menu SCP and the submenu
Postprocessing
.
In Select the classification select the raster change_CLC
, thus we can distinguish the spectral signatures of changes.
In Select input band set enter the number of the band set containing the Landsat 8 bands (i.e. 2).
Now click RUN to start the calculation.
After a while the spectral signatures are loaded in the Training input.
If the changes involved vegetation, we could calculate spectral signatures for images acquired in different seasons and assess the phenological variations of vegetation through spectral signatures. Also, these spectral signatures could be used as training input for further land cover classifications.
In order to display the signature plot, in the ROI Signature list highlight two or more spectral signatures (with click in the table), then click the button .
The Wykres sygnatur widmowych is displayed in a new window.
Export the changes to vector format¶
This is an optional step that may be useful for further analyses and integration with other data. We are going to convert the change raster to vector.
Open the tool Classification to vector.
In Select the classification select the
change_CLC
raster and uncheck the Use code from Signature list.
Now click RUN
to create a new vector (e.g.
change_vector
).
In the attribute table of this change_vector
you can see the field C_ID
that represents the code of the change raster as described in Assess land cover change.
Of course we could delete the polygons with code 0 (unchanged area), displaying only changes with code 1.
Semi-Automatic OS¶
Do zaktualizowania
The Semi-Automatic OS is a lightweight virtual machine for the land cover classification of remote sensing images. It includes the Semi-Automatic Classification Plugin (SCP) for QGIS, already configured along with all the required dependencies.

pulpit Semi-Automatic OS
The Semi-Automatic OS is based on Debian , and it is designed to require very little hardware resources.
It uses LXQT as main desktop environment.
This virtual machine can be useful for testing the Semi-Automatic Classification Plugin, or when the installation of the required programs in the host system is problematic.
The Semi-Automatic OS is available as 64 bit virtual machine that can be run in the open source VirtualBox, or any other virtualization program.
The following is a guide for the installation of the Semi-Automatic OS in the open source program of virtualization VirtualBox.
Instalacja w Virtualbox-ie.¶
Pobierz VirtualBox oprogramowanie open source (wybierz właściwą wersję zależną od twojego OS) i zainstaluj go; gdy akończysz instalację zrestartuj system;
Download the Semi-Automatic OS virtual machine from here ;
Extract the virtual machine content in a directory; the file is compressed in 7z format (if needed, download the open source extraction software from http://www.7-zip.org/);
Uruchom VirtualBox i stwórz nową VM Debiana;
Kliknij w przycisk Nowy;
Wprowadź nazwę wirtualnej maszyny (np. Semi-Automatic OS); wybierz Linux i Debian (32 lub 64bit) jako typ i wersję; naciśnij Dalej;
![]()
Ustaw rozmiar pamięci; im więcej tym lepiej, ale nie przekraczaj połowy wielkości RAM systemu gospodarza (np. jeśli system podstawowy ma 1 GB RAM, wpisz 512MB); naciśnij Dalej;
![]()
W ustawieniach dysku twardego wybierz Używanie istniejącego pliku wirtualnego dysku i wskaż SemiAutomaticOS.vmdk; naciśnij Utwórz;
![]()
Uruchom Semi-Automatic OS naciskając przycisk Start;
Warto zainstalować virtual-guest-utils w maszynie wirtualnej, z Menu -> Preferencje > Synaptic Package Manager; pozwala to na lepszą integrację Semi-Automatic OS z systemem gospodarzem, np. zmianę rozmiaru okna systemowego, albo współdzielenie folderów
The Semi-Automatic OS includes a sample dataset of a Landsat image (available from the U.S. Geological Survey) that is the input for the first basic tutorial of the user manual.

Semi-Automatic OS is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 3 of the License.
Semi-Automatic OS is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the GNU General Public License for more details. See http://www.gnu.org/licenses/.
Najczęściej zadawane pytania¶
Jeśli masz uwagi lub pytania do grupy na Facebook .
Zanim zapytasz, sprawdź na oficjalnej stronie From GIS to Remote Sensing i w Najczęściej Zadawanych Pytaniach (FAQ).
- Instalacja wtyczki
- Przygotowanie danych
- Które kanały obrazowania powinny być używane w klasyfikacji półautomatycznej?
- Które kanały Landsata mogą być skonwertowane do reflektancji przy pomocy SCP?
- Czy mogę wykonać konwersję obrazów Sentinel-2 pobranych z sieci web?
- W jaki sposób są przetwarzane obrazy Sentinel-2 które mają różną rozdzielczość?
- Czy mogę wykonać konwersję sceny Landsat i korekcję DOS dla kanałów przyciętych?
- Czy mogę zastosować korekcję DOS do pasm z czarną krawędzią (np. z NoData)?
- W jaki sposób usunąć pokrywę chmur z obrazów?
- Dlaczego po pan-sharpeningu sceny Landsat 8, kanały NIR wciąż mają rozdzielczość 30m?
- Przetwarzanie
- Otrzymuję błędy klasyfikacji. W jaki sposób mogę poprawić dokładność?
- Czy możliwym jest używanie tego samego pliku treningowego dla wielu obrazów?
- Jaka jest różnica między klasą i makroklasą?
- Czy mogę użyć SCP z obrazami z dronów lub zdjęciami lotniczymi?
- Dlaczego używać tylko kanału 10 Landsata 8 dla szacowania temperatury powierzchni?
- Ostrzeżenia
- Błędy
- Różne
- Co właściwie mogę zrobić przy pomocy SCP?
- Własny wkład do SCP
- Darmowe i cenne zasoby poświęcone teledetekcji i GIS
- Zobacz również poradniki na temat SCP, również w językach innych niż Angielski.
- W jaki sposób mogę przetłumaczyć ten podręcznik użytkownika na inny język?
- Gdzie znajdę kod źródłowy SCP?
- W jaki sposób zainstalować QGIS przy użyciu OSGEO4W?
Instalacja wtyczki¶
W jaki sposób można zainstalować wtyczkę ręcznie?¶
Wtyczka SCP może być zainstalowana ręcznie (może to być przydatne, gdy połączenie internetowe jest niedostępne, lub konieczna jest instalacja na wielu komputerach), w taki sposób:
- pobierz archiwum zip SCP z https://github.com/semiautomaticgit/SemiAutomaticClassificationPlugin/archive/master.zip ;
- rozpakuj zawartość archiwum (wiele plików takich jak COPYING.txt czy folderów jak
ui
) do nowego folderuSemiAutomaticClassificationPlugin
(bez-master
); - otwórz katalog
plugins
(w Windows typowoC:\Users\username\AppData\Roaming\QGIS\QGIS3\profiles\default\python\plugins
, w Linux and Mac typowo/home/username/.local/share/QGIS/QGIS3/profiles/default/python/plugins
) i usuń katalogSemiAutomaticClassificationPlugin
jeśli istnieje; - skopiuj katalog
SemiAutomaticClassificationPlugin
do wnętrza QGIS-owego katalogu ``plugins»« - wtyczka powinna być gotowa; uruchom QGIS, otwórz Zarządzanie Wtyczkami i upewnij się że
Semi-Automatic Classification Plugin
jest zaznaczony.
W jaki sposób zainstalować wtyczkę z oficjalnego repozytorium SCP?¶
Istnieje możliwość zainstalowania wtyczki SCP z oficjalnego repozytorium projektu. To repozytorium zawiera najnowszą wersję (master
), w niektórych przypadkach wcześniej niż jej dostępność w repozytorium wtyczke QGIS. To może być przydatne, gdy potrzebujesz uzyskać dostęp do nowych funkcji lub naprawić błędy. Co więcej, wersja master
może być zainstalowana równolegle do wersji stabilnej, dostępnej w repozytorium QGIS.
W celu zainstalowania repozytorium SCP wykonaj następujące kroki:
- Uruchom QGIS;
- Z głównego meny programu wybierz
Wtyczki
>Zarządzanie wtyczkami

- Wybierz
Ustawienia
a następnie przyciskDodaj
;

- W
Szczegóły repozytorium
wprowadź:
Nazwa:
SCP
URL:
https://semiautomaticgit.github.io/SemiAutomaticClassificationPlugin/repository.xml
i naciśnij OK
;

- Po ponowym wczytaniu repozytorium, pozycja
Semi-Automatic Classification Plugin - master
powinna pojawić na liście wśród innych wtyczek;

- Z zakładki
Wszystkie
, wybierzSemi-Automatic Classification Plugin - master
i przyciskZainstaluj wtyczkę
; ostatnia, rozwojowa wersja SCP powinna automatycznie aktywowana (zignoruj błędy, restart QGIS może być wymagany do zakończenia instalacji); istnieje możliwość zdeaktywowania innej wersji SCP zainstalowanej w repozytorium QGIS;

Przygotowanie danych¶
Które kanały obrazowania powinny być używane w klasyfikacji półautomatycznej?¶
Zasadniczo, preferowane jest pomijanie kanałów podczerwieni termicznej. Jeśli używasz Landsata 4,5 lub 7, wybierz kanały: 1, 2, 3, 4, 5, 7 pomijając kanał 6 to jest Thermal Infrared; dla Landsata 8 wybierz kanały: 2, 3, 4, 5, 6, 7. Kanał 1 Landsata 8 powinien być pomijany ponieważ jest bardzo zbliżony do kanału niebieskiego a używany głównie do poznawania aerozoli wybrzeży. Kanały podczerwieni termicznej Landsata wyłączane są z klasyfikacji ponieważ ich wartości są związane głównie z temperaturą obiektu.
Dla Sentinel-2 można używać następujących kanałów: 2, 3, 4, 5, 6, 7, 8, 8A, 11, 12.
Które kanały Landsata mogą być skonwertowane do reflektancji przy pomocy SCP?¶
Wszystkie obrazy Ladsat MSS 1,2 i 3, oraz Landsat 4, 5, 7 oraz 8 pobrane z http://earthexplorer.usgs.gov/ i przygotowane przez Level 1 Product Generation System (LPGS) mogą być przekształcone do reflektancji automatycznie przy pomocy SCP; produkty generowane przez LPGS mają dołączony plik MTL który jest konieczny do konwersji
Czy mogę wykonać konwersję obrazów Sentinel-2 pobranych z sieci web?¶
Tak, możesz wykonać konwersję sceny pobranej z internetu (dokładniej, taka konwersja jest zalecana). Musisz umieścić wszystkie kanały (pliki .jp2) i jeśli dostępny, plik xml którego nazwa zawiera MDT_SAFL1C
w jednym katalogu. Wtedy wybierz ten katalog w Sentinel-2 conversion. Obrazy zostaną przekształcone do reflektancji.
W jaki sposób są przetwarzane obrazy Sentinel-2 które mają różną rozdzielczość?¶
Podczas konwersji do reflektancji, piksele pasma 20m są dzielone na 4 piksele 10-metrowe, których wartości są identyczne jak piksela 20m. Celem tej operacji jest zapewnienie obliczeń pomiędzy wszystkimi kanałami, bez zmiany oryginalnych wartości.
Czy mogę wykonać konwersję sceny Landsat i korekcję DOS dla kanałów przyciętych?¶
Tak, możesz przyciąć obrazy przed konwersją do reflektancji i skopiować plik MTL (z katalogu sceny Landsat) do katalogu z przyciętymi obrazami. Jeśli chcesz wykonać korekcję DOS (która jest operacją na obrazach), musisz wykonać konwersję oryginalnej sceny Ladsat (całej sceny) i potem przyciąć wynik konwersji (np. kanały przetworzone do reflektancji).
Czy mogę zastosować korekcję DOS do pasm z czarną krawędzią (np. z NoData)?¶
Jeśli chcesz zastosować korekcję DOS do całego kanału który posiada wartości NoData (czarna obwódka z wartością = 0), musisz zaznaczyć checkbox Użyj wartości NoData
i ustawić wartość o. To wynika z tego że korekcja DOS jest techniką operacji na obrazie, a więc wartości NoData muszą być wyłączone z obliczeń.
W jaki sposób usunąć pokrywę chmur z obrazów?¶
Korekcja DOS1 nie usuwa chmur z obrazu. Ale, sceny Landsata 8 zawierają kanał 9 który identyfikuje chmury (zobacz to witryna NASA). Możesz użyć tego kanału do stworzenia maski.
W przypadku innych satelitów Landsat, chmury mogą zostać wymaskowane przy pomocy podejścia opisanego w pracy <http://www.planning4adaptation.eu/Docs/papers/08_NWP-DoM_for_LCC_in_Dar_using_Landsat_Imagery.pdf>`_.
Zobacz również ten wideo tutorial.
Dlaczego po pan-sharpeningu sceny Landsat 8, kanały NIR wciąż mają rozdzielczość 30m?¶
Kanał panchromatyczny Landsat 8 nie zbiera danych w paśmie bliskiej podczerwieni (NIR, zobacz Landsat Satellites). Dlatego proces wyostrzania (pan-sharpeningu) nie może poprawić rozdzielczości kanałów NIR i SWIR (zobacz Pan-sharpening), które mają rozdzielczość 30m. Jednak wszystkie rastry pan-sharpen mają rozdzielczość 15m aby umożliwić obliczenia na rastrze.
Przetwarzanie¶
Otrzymuję błędy klasyfikacji. W jaki sposób mogę poprawić dokładność?¶
Niektóre materiały posiadają podobne charakterystyki widmowe (np. gleba i zabudowa, czy las i inne typy gęstej, niskiej roślinności), które mogą prowadzić do błędów klasyfikacji, jeśli OT i ich charakterystyki widmowe nie są zdefiniowane dość dobrze. Aby polepszyć wyniki, spróbuj zebrać więcej OT nad tymi obszarami, by lepiej wytrenować algorytm, do rozpoznawania różnic pomiędzy tymi bardzo podobnymi obszarami, również wyświetl Wykres sygnatur widmowych aby ocenić ich podobieństwa. Możesz użyć zakładki Signature_threshold_tab aby ograniczyć zmienność charakterystyki (tylko piksele najbardziej podobne do charakterystyki zostaną sklasyfikowane). :ref:`LCS_algorithm jest użyteczny dla klasyfikacji gdy materiały są widmowo podobne do siebie.
Czy możliwym jest używanie tego samego pliku treningowego dla wielu obrazów?¶
Tak, to jest możliwe, jeśli wszystkie obrazy mają taką samą liczbę kanałów. Jeśli jednak sceny zostały zarejestrowane w różnym okresie, pokrycie terenu się zmienia (szczególnie stan wegetacji), co wpływa na charakterystyki widmowe (w skrócie, te same piksele mają różne charakterystyki w różnych okresach). Zjawiska atmosferyczne mogą różnie wpływać na obrazy. To wszystko może zmniejszać jakość i dokładność klasyfikacji. Dlatego zaleca się zbieranie OT i charakterystyk dla każdego obrazu.
Czy mogę użyć SCP z obrazami z dronów lub zdjęciami lotniczymi?¶
Tak, możesz, jeśli obrazy takie posiadają conajmniej 4 kanały. Jeśli jest mniej niż 4 kanały, algorytmy klasyfikacji półautomatycznej nie potrafią prawidłowo sklasyfikować pokrycia terenu. Istnieją alternatywne metody klasyfikacji, jak np. klasyfikacja orientowana obiektowo, która nie jest zaimplementowana w SCP.
Dlaczego używać tylko kanału 10 Landsata 8 dla szacowania temperatury powierzchni?¶
Opracowano kilka metod szacowania temperatury powierzchni. Metoda opisana w samouczku wymaga tylko jednego kanału. Co więcej, USGS zaleca użytkownikom danych zaniechanie korzystania z kanału 11 Landsata 8 w analizie ilościowej, danych Thermal Infrared Sensor (zobacz Zmiany w danych Thermal Infrared Sensor (TIRS) by USGS).
Ostrzeżenia¶
Warning [12]: The following signature will be excluded if using Maximum Likelihood. Dlaczego?¶
Obszar treningowy jest zbyt mały lub zbyt jednorodny, dla algorytmu Maximum Likelihood ponieważ OT ma pojedyńczą macierz kowariancji. Użyj większego OT lub nie używaj algorytmu Maksymalnego Podobieństwa w procesie klasyfikacji.
Błędy¶
W jaki sposób mogę zgłosić błąd?¶
Jeśli znajdziesz błąd w działaniu wtyczki Semi-Automatic Classification, postępuj zgodnie z opisanymi krokami, aby pozyskać konieczne informacje (log file):
- zamknij QGIS jeśli jest aktualnie otwarty;
- uruchom QGIS, otwórz zakładkę Debug wtyczki i oznacz checkbox
Rejestruj zdarzenia w pliku dziennika ;

Debug
- naciśnij klawisz Testuj zalezności
w zakładce Debug ;
- wczytaj dane w QGIS (albo otwórz wcześniej zapisany projekt QGIS) i powtórz wszystkie kroki które spowodowały błąd w wtyczce;
- Jeśli usterka może być związana z wykorzystywanym zbiorem danych, spróbuj użyć zbioru przykładowego <https://docs.google.com/uc?id=0BysUrKXWIDwBc1llME4yRmpjMGc&export=download>`_ ;
- jeśli komunikat błędu się ukaże (tak jak ten na poniższym obrazie), skopiuj całą treść wiadomości do pliku tekstowego;

Wiadomość o błędzie
- otwórz zakładkę Debug i odznacz checkbox
Rejestruj zdarzenia w pliku dziennika, następnie naciśnij przycisk
i zapisz plik dziennika (jest to plik tekstowy zawierający informacje o procesach realizowanych przez wtyczkę);
- otwórz logfile i skopiuj całą zawartość pliku;
- dołącz na Facebook’u do grupy , utwórz nowy post i skopiuj komunikat błędu oraz log file (albo załącz je).
Problemy z tworzeniem wirtualnego rastra. Dlaczego?¶
Automatyczne tworzenie wirtualnego rastra po konwersji do reflektancji nie jest konieczne dla klasyfikacji. Błędy mogą się zdarzyć gdy ścieżka zapisu zawiera znaki specjalne, (np. znaki narodowe) lub spacje; spróbuj zmienić nazwę katalogu (np. zmień nazwę nowy folder
na nowy_folder
). Jeśli i to nie pomogło, możesz spróbować utworzyć wirtualny raster ręcznie.
Błąd «Plugin is damaged. Python said: ascii». Dlaczego?¶
To może być związane z nieudaną instalacją. Rozważ proszę, odinstalowanie QGIS i jego ponowną instalację na prawach administratora. Następnie uruchom QGIS i spróbuj zainstalować wtyczkę postępując zgodnie z przewodnikiem Instalacja wtyczki
Często jest to spowodowane nazwą użytkownika zawierającą znaki specjalne. Spróbuj wykonać instalację tworząc nowego użytkownika bez znaków specjalnych (np. user
).
Error [50] «Internet error». Nie można pobrać obrazów Sentinel-2. Dlaczego?¶
Komunikat błędu zawiera zazwyczaj podstawowe informacje o przyczynach. W pierwszej kolejności sprawdź nazwę użytkownika i hasło. Zazwyczaj aktywacja konta po rejestracji trwa do kilku dni, zanim możliwe będzie korzystanie z pobierania danych poprzez SCP.
Mogła również wystąpić przerwa w działaniu usługi. Dla Sentinel-2 sprawdź stronę internetową https://scihub.copernicus.eu/news/ dla informacji o stanie usługi.
W przypadku gdy wciąż otrzymujesz ten sam błąd, postępuj zgodnie z W jaki sposób mogę zgłosić błąd?.
Błąd instalacji wtyczki, możliwe braki w zależnościach. Dlaczego?¶
Wtyczka wymaga zainstalowanych GDAL, NumPy, SciPy i Matplotlib, które powinny być zainstalowane wraz z QGIS. Jeśli instalacja wtyczki nie powiodła się, spróbuj uzyskać komunikat o możliwych brakach w zależnościach, a następnie zainstalować lub zaktualizować QGIS i jego biblioteki. Zauważ że w celu uniknięcia tego błędu, zależności python nie powinny być instalowane poprzez Anacondę.
Różne¶
Co właściwie mogę zrobić przy pomocy SCP?¶
SCP pozwala na klasyfikację pokrycia terenu z obrazów satelitarnych poprzez Supervised Classification. Możesz uzyskać raster pokrycia terenu obliczony poprzez Classification Algorithms dostępne w SCP. Te algorytmy wymagają charakterystyk widmowych lub OT jako danych wejściowych (przeczytaj proszę Brief Introduction to Remote Sensing dla definicji) które zdefiniują klasy pokrycia terenu w scenie.

Obraz wielokanałowy przetworzony dla opracowania klasyfikacji pokrycia terenu
(obraz Landsat dostarczony przez USGS)
SCP potrafi pracować z obrazami wielokanałowymi pozyskanymi przez satelity, samoloty i drony. SCP pozwala również na bezpośrednie wyszukiwanie i bezpłatne pobieranie obrazów (zobacz Download products). Nie możesz użyć ortofotomapy z mniej niż 4 kanałami, danych SAR i LIDAR w SCP.
Obraz wejściowy w SCP nazywany jest Band set używany jako dane do klasyfikacji. SCP zapewnia narzędzia Preprocessing, takie jak konwersja do reflektancji i manipulowanie kanałami.
Wynik klasyfikacji może być pozyskany przy pomocy Accuracy i Classification report. Rastry mogą być również zmieniane w Postprocessing narzędziami takimi jak Classification to vector, Reclassification, Edit raster directly, Classification sieve, Classification erosion, oraz Classification dilation.
Wykres sygnatur widmowych i Wykres punktowy pozwalają na analizę charakterystyk widmowych i obszarów treningowych. Różne Basic tools są dostępne dla ułatwień przy tworzeniu obszarów treningowych i edycji charakterystyk.
Obliczenia rastrowe są dostępne poprzez pełną integrację Band calc z kanałami dostępnymi w Band set, umożliwiając wprowadzanie wyrażeń matematycznych i indeksów widmowych. Raster wynikowy może obliczony na podstawie Decision rules.
Narzędzie Batch pozwala na automatycZne wykonanie wielu funkcji SCP przy użyciu interfejsu skryptowego.
Zobacz Podręczniki podstawowe w poszukiwaniu większej ilości przykładów i informacji.
Własny wkład do SCP¶
Może wspierać rozwój SCP poprzez naprawę błędów i dodawanie nowych funkcjonalności (zobacz Gdzie znajdę kod źródłowy SCP?), lub tłumaczenie podręcznika użytkownika (zobacz W jaki sposób mogę przetłumaczyć ten podręcznik użytkownika na inny język?).
Możesz również podarować wsparcie dla projektu pod tym adresem https://fromgistors.blogspot.com/p/donations.html .
Darmowe i cenne zasoby poświęcone teledetekcji i GIS¶
Następujące linki zawierają pomocne materiały:
- The Landsat 8 Data Users Handbook by USGS;
- The Landsat 7 Science Data Users Handbook by NASA;
- Webinar: Podstawy teledetekcji w opracowaniu NASA - w języku angielskim.
- Webinar: NASA Teledetekcja dla zarządzania terenem - w języku angielskim.
- Webinar: Opracowanie i używanie indeksu Normalized Difference Vegetation Index (NDVI) ze zdjęć satelitarnych NASA.
- Webinar: Teledetekcja pokrywy leśnej i ocena zmiany dla monitoringu sekwestracji CO2 - NASA.
- Webinar: Wprowadzenie do teledetekcji dla ochrony środowiska NASA.
Zobacz również poradniki na temat SCP, również w językach innych niż Angielski.¶
Wiele poradników o SCP można znaleźć w internecie. Ta lista takich zasobów jest niekompletna (zauważ, że materiały mogą dotyczyć starszych wersji SCP);
- Angielski: Webinarium NASA ARSET klasyfikacji pokrycia terenu w oparciu o zdjęcia satelitarne;
- Angielski: Rekomendowane Praktyki UN-SPIDER dla kartowania szkód pożarowych w QGIS;
- Angielski: Używanie QGIS i SCP do pobierania i przetwarzania scen satelitarnych Sentinel 2;
- Francuski: Teledetekcja pożarów lasów;
- `Niemiecki: 2015 Jakob Wykrywanie zmian użytkowania gruntu za pomocą narzędzi przetwarzania obrazu FOSS<https://www.youtube.com/watch?v=vIsHFvLS5_Q>`_;
- Indonezyjski: Koreksi Radiometrik Menggunakan QGIS:Semi Automatic Classification;
- Włoski: Klasyfikacja mozaiki zróżnicowanych obrazów Landsat;
- Koreański: QGIS Semi-Automatic Classification Plugin;
- Portugalski: Workshop de Deteção Remota e Processamento Digital de Imagem com o QGIS e o Semi-Automatic Classification Plugin;
- Portugalski: Klasyfikacja nadzorowana scen Sentinel-2 przy pomocy QGIS i SCP;
- Portugalski: Avaliação do erro de uma imagem de satélite usando o QGIS e o SCP;
- Portugalski: Konwersja scen Sentinel-2 do reflektancji w QGIS SCP;
- Portugalski: Criar composições coloridas no QGIS com SCP;
- Portugalski: Corte de imagem Sentinel-2 usand QGIS e SCP;
- Portugalski: Deteção Remota Com O QGIS;
- Rosyjski: Опыт классификации космоснимка Sentinel- 2a с помощью Semi-Automatic Classification Plugin в QGIS;
- Hiszpański: Descarga de imágenes de satélite desde servidores públicos;
- Szwecki: Landsat 8 och fjärranalys med QGIS;
- Ukraiński: Основи дешифрування плагіном Semi-Automatic Classification 5.0;
- Ukraiński: Використання Гіс Qgis Для Отримання Та Обробки Космічних Знімків Євген Василенко;
W jaki sposób mogę przetłumaczyć ten podręcznik użytkownika na inny język?¶
Można w bardzo prosty sposób przetłumaczyć podręcznik użytkownika na dowolny język, ponieważ jest napisany w reStructuredText - języku znaczników (używając Sphinx). A więc twój współudział w tłumaczeniu tego podręcznika na znane ci języki jest fundamentalny. Ten przewodnik ilustruje główne kroki tłumaczenia, które mogą być wykonane:
- używając otwartego serwisu online Transifex;
- używając plików gettext .po.
Przed tłumaczeniem, przeczytaj ten dokument z przewodnika tłumaczenia QGIS, który pomoże ci zrozumieć reStructuredText.
Metoda 1. Tłumaczenie przy użyciu otwartej usługi sieciowej Transifex
To prawdopodobnie najłatwiejszy sposób tłumaczenia podręcznika, w oparciu o usługę sieciową.
Dołącz do projektu Semi-automatic Classification Manual
Wejdź na stronę https://www.transifex.com/semi-automatic-classification/semi-automatic-classification-plugin-manual i naciśnij na przycisk
Help translate
. możesz używać swoich danych logowania Google, Facebook, albo utworzyć bezpłatne konto.Wybierz swój język
Wybierz swój język i naciśnij przycisk
Join team
. Jeśli twój język nie jest wymieniony, naciśnij na przyciskRequest language
.Tłumaczenie
Znajduje się tu kilkanaście plików to przetłumaczenia, które odnoszą się do sekcji dokumentacji SCP. Do przetłumaczenia interfejsu użytkownika, wybierz plik
semiautomaticclassificationplugin.ts
.
Metoda 2. Tłumaczenie przy użyciu plików gettext .po
W celu używania tej metody, musisz mieć spore umiejętności używania GItHub. Ta metoda pozwala na tłumaczenie plików PO lokalnie.
Pobierz pliki tłumaczenia.
Wejdź na stronę projektu na GitHub https://github.com/semiautomaticgit/SemiAutomaticClassificationManual_v4/tree/master/locale i pobierz pliki .po twojego języka (możesz dodać swój język, jeśli nie jest na liście), albo stworzyć forka repozytorium. Każdy plik .po jest plikiem tekstowym odpowiadającym sekcji w Podręczniku Użytkownika.
Edycja plików tłumaczenia
Jesteś gotowy do tłumaczenia plików .po. Wygoda podpowiada użycie jednego z następujących programów: Poedit dla Windows i Mac OS X, lub Gtranslator dla Linux OmegaT (Java based) dla Windows, Linux i Mac OS X. Te edytoru pomogą w łatwym i sprawnym przetłumaczeniu każdego zdania Podręcznika Uzytkownika.
Gdzie znajdę kod źródłowy SCP?¶
Kod źródłowy SCP dostępny jest pod adresem https://github.com/semiautomaticgit/SemiAutomaticClassificationPlugin
W jaki sposób zainstalować QGIS przy użyciu OSGEO4W?¶
Aby zainstalować QGIS, pobierz OSGeo4W installer x86 albo OSGeo4W installer x64 dopasowany do twojego systemu operacyjnego.
Następnie uruchom instalator, wybierz Advanced Install
.

Zaznacz Install from Internet
i kliknij Next
.

Wybierz katalog instalacyjny i kliknij Next
.

Wybierz lokalny katalog do przechowywania pakietów i wybierz Next
.

Wybierz Direct connection
(albo wybierz parametry połączenia internetowego) i wybierz Next
.

Wybierz pierwszy adres pobierania i kliknij Next
.

Na liście pakietów wybierz qgis-dev
(w kategorii Desktop
) dopóki QGIS3 nie zostanie oficjalnie opublikowany..

Na liście pakietów wybierz python3-matplotlib
(w kategorii Libs
).

Na liście pakietów wybierz python3-numpy
(w kategorii Libs
).

Na liście pakietów wybierz python3-scipy
(w kategorii Libs
).

Naciśnij Next
aby zainstalować również pozostałe zależności.

Po pobraniu, QGIS powinien zainstalować się wraz z wszystkimi potrzebnymi zaleznościami.