0% found this document useful (0 votes)
4 views

Supervised - Classification 2

Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views

Supervised - Classification 2

Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 6

QGIS Supervised Classification

Brennan Stout

Supervised classification is the process of teaching the computer to sort the


pixels in an image into a set number of classes. This is done through the use
of a signature file, which contains information mapped by the user. The end
result of this is a version of the original image but sorted pixels. This process
is useful as it gives a number of pixels for each class and can be used for
temporal comparison between images.

Plugin: Semi-Automatic Classification Plugin

https://fromgistors.blogspot.com

Based on SCP tutorial 1

Once the plugin is installed, two new menus should be added to QGIS. (If an
error occurs at this point, it is likely from a missing python library. Addendum
1at the end of this document covers how to fix it.)
Data Setup

1. To load bands into the plugin, open the plugin window and the “band
set” tab.

2. Add .tif files via the button in the top right corner.
3. With the bands added, arrange them in the proper order for the
satellite type and check if a band quickset option is available.

4. Select the and push “run”.


5. To show bands in the main view, set the band combination with the

button in the SCP top bar.


a. If this does not work, try saving the project and restarting QGIS.
Training the classification

1. Open the “Training Input” tab in the SCP Dock

2. Use the button to create a new signature file. This will be used to
store the information about the classes.
3. With the signature file created, you can begin to set values. First, set
the MC ID, MC Name, and C Name of the first class you want to
classify, the MC ID and MC Name are the main class, with the C name
being the child class. (C ID will advance automatically has you add new
signitures.)
4. With these set, you can use the button in the top bar to create a
polygon containing pixels of your selected class.
a. Left click to add points and right click to close the polygon.
b. The signature will be captured from the pixels underneath the
polygon, so try to make sure only pixels of the class you want are
in your select area.
c. The most useful signatures are those that capture the most of
the variation within your class so the larger the area captured
the better.

d. When you are happy with your polygon close it and click the
button in the bottom right of the ROI menu to add your polygon
to your signatures for the class you have specified.
e. Multiple signatures can be contained in one macroclass or class,
with 5 – 7 signatures per class you are classifying giving you a
sufficiently accurate result.
5. With your signatures saved, you can now classify your image. Use the
“Classify Tab” in the SCP window, select you bandset, the macro or
child class to use, and the algorithm.
6. Click “RUN” (If this gets an error, restart the software, start a new
project, and re-add both the signature file and the images.)
a. This will prompt you to save a TIF file, place this somewhere you
can find it as this is your output file.
7. Once the tool has finished running, a new raster layer will be added to
your view. This will be a raster containing your classes plus an
additional “unclassified” class.
Addendum 1:

The main installation error comes from not having the library
remotior_sensus installed. This can be done by installing miniforge and
running it. In the prompt window for miniforge run these codes for
Windows.

conda create -c conda-forge --name environment python=3.10

When prompted, enter “y”.

conda activate environment

For installation of the library.

conda install -c conda-forge remotior-sensus

This will install the library, at this point try to install the plugin again.

In the case the errors persist due to the library being out of data.

Run OSGeo and run this code.

pip3 install --upgrade remotior-sensus scikit-learn torch

Restart QGIS and it should be working now.

Resources:

Installation guide

Update fix

You might also like