Take me to pcigeomatics.com

PCI Geomatics Help Center

How can we help you today?

Classification Quick-Start

PCI Geomatics -

Geomatica’s Object Analyst provides an intuitive workflow wizard for performing image segmentation, classification and feature extraction. This all-in-one interface is designed to reduce complexity and give users the opportunity to develop highly accurate, object-based, thematic classification maps.

The purpose of this tutorial is to help new users get started with Geomatica’s Object Analyst’s classification workflow, by providing a short step-by-step guide to the workflow.

image001.png

image003.png

 

 

 

Downloading Tutorial Data and Software

Download the tutorial data package from our cloud:

https://pcigeomatics.sharefile.com/d-s9516ccb92064a38a

Your tutorial data package should include the following file(s):

inputs.pix – .pix is PCI’s proprietary file format and can contain many raster channels, vector layers and more. This file contains 3 imagery channels (RGB), 1 surface model and 1 greenness index channel. The surface model and greenness index channels can be generated using algorithms and tools available in Geomatica

Note: You will need to unzip the package before you can continue with the tutorial

Geomatica 2017 or later is required for this tutorial. Click on the following link and fill in the quick form to access a free trial: www.GetGeomatica.com

 

Loading and Examining Your Input File

In this section we are going to simply load and review the different layers that will be used as inputs to segmentation and object-based classification

  1. Navigate to C:\...\OA_FeatureExtractionTutorial and locate the inputs.pix file
  2. Double click on the inputs.pix file to open it in Geomatica’s Focus application

By default the RGB imagery will render as a true color composite (see below). The red band (channel 1), green band (channel 2) and blue band (channel 3) will all be used as input for both segmentation and feature extraction

image005.png

  1. Click on the Files tab in the layer and files manager on the left side of Focus
  2. Expand the Rasters branch to view the individual rasters contained in the Inputs.pix file

image007.png

In addition to the three RGB image channels, you have a normalized surface model, which provides the heights of features, such as buildings, trees, bushes, crops and a Greenness index layer, which will help identify vegetation.

 

Segmentation

This section provides the steps necessary to perform the segmentation of your imagery and subsequent layers (i.e. feature heights layer, greenness index layer).

  1. In the Focus dropdown menu bar, click on Analysis > Object Analyst

image009.png

  1. In the Object Analyst wizard, click on the Operation dropdown list and select Segmentation
  2. In the Source image layers section, click Select…
  3. In the File dropdown list, select the only file in the list (inputs.pix)
  4. Select the first 4 channels (not the 5th channel)

The layers selected in the panel below will be used for segmenting the image

image011.png

  1. Click OK
  2. In the Parameters section, set the Scale to 35
  3. In the Output section, click Browse…
  4. In the File Selector window, set the file name to seg and click Save
  5. In the Layer dropdown list, select New Layer and then rename it to tutorial_seg

image013.png

  1. Click on the Add and Run button image016.jpg
  2. After processing, your segmentation layer should be loaded into the Focus viewer

image017.png

 

Feature Extraction

The purpose of this section is to extract the statistics about the image pixels that fall within each shape, as well as the geometric characteristics of each shape. These statistics are stored in the attributes table of the segmentation layer and will be used to classify the objects during the classification step.

  1. In the Object Analyst wizard, click on the Operation dropdown list and select Feature Extraction

This feature extraction operation should not be confused with the full feature extraction workflow. This operation is responsible for extracting spectral statistics of the pixels under each shape, as well as geometric statistics about each shape. These statistics will then be used to help us create rules for extracting features such as roads

  1. In the Source Channels section, click on Select…
  2. Keep channels 1 - 4 checked, but this time also check channel 5
  3. Change the Band Alias names to the following:

B01 > Red, B02 > Green, B03 > Blue, B04 > Heights, B05 > Greenness

image019.png

  1. Click OK
  2. In the Channel statistics section, make sure that Mean is checked
  3. Check all 4 Geometrical statistics (Compactness, Elongation, Circularity, Rectangularity)

image021.png

  1. Click Add and Run image023.jpg
  2. In the Maps tab, right click on the seg.pix:2. tutorial_seg layer and in the context menu, select Attributes Manager…

In the Attributes Manager that opens, you will see a number of new columns with the headers that you just created in step 4 (e.g. Mean_red, Mean_green, Mean_blue, Rectangularity, etc.)

image024.png

  1. Close the Attribute Manager

 

Training Site Collection

This section will provide the steps required to collect training sites necessary to perform a supervised classification. Furthermore, you will also collect validation sites, which will be used for performing quantitative accuracy assessment after you run the classification process.

  1. In the Object Analyst wizard, change the Operation to Training Sites Editing
  2. Make sure that the Training Vector Layer is seg.pix: 2 [VEC]:tutorial_seg the file that you created in the Segmentation section of this tutorial
  3. Click on the Edit… button to open up the Training Sites Editing window
  4. Click on the Add Class button
  5. A new row will be added that reads Class 1 under the Class Name column
  6. Change the name to Buildings
  7. Click on the color dropdown list to select a color to represent that class (e.g. dark grey)
  8. Repeat steps 4-7, four (4) more times and name each class as follows
  • Grass (set color to bright green)
  • Pavement (set color to light grey)
  • Trees (set color to dark green)
  • Soil (set color to orange)
  1. Select the Buildings class and then click on the Individual Select tool image026.png
  2. In the Focus viewer, hold the CTRL key down a select the segmentation polygons that overlap buildings (make sure to select at least 50 buildings of different roof colors and styles)

image028.png

  1. Once you have selected a number of different building polygons, click the Assign button on the Training Sites Editing window, to add them to the Training Count column for your Buildings class

The building polygons will be shaded in a translucent grey (or whatever color you set) and the Training Count column for the Building class will now have a positive count.

image030.png

  1. Use the Individual Select tool again to select at least 20 more buildings
  2. In the Training Sites Editing window, click on the Accuracy assessment radio button (at the bottom)

image032.png

  1. Click Assign

The building polygons will be filled with a grey pattern fill, which identifies those polygons to be used exclusively for accuracy assessment. The Accuracy Count column for the Building class will now have a positive count

image034.png

  1. Repeat steps 9-14 for the remaining four classes, making sure to collect at least 50 shapes for the Training count for each class and 20 shapes for Accuracy count for each class. Try to be as accurate and diverse in your collection as possible

Your result may look similar to the following:

image036.png

  1. Close the Training Site Editing window

 

Performing a Supervised Classification

This section will provide the steps required to run the supervised classification with the Support Vector Machine algorithm

  1. In the Object Analyst window, change the Operation to Classification
  2. Click on the Select… button in the Vector Layer and Fields section

In the Vector Layer and Field Selector window, make sure that the Layer field is populated with the tutorial_seg layer and that all of the Fields have a checkmark next to them, except for Area, Perimeter and PixelValue

image038.png

  1. Click OK
  2. Make sure that Supervised is selected under Type
  3. In the Training Field dropdown list, select Training
  4. In the Output Class Field, change the name to my_classification
  5. Make sure that SVM radio button is selected and then click Add and Run image040.png
  6. Once the process has finished running, go to the Maps tab and uncheck the Training layer to view your results

image042.png

 

Accuracy Assessment & Refining Results

This section will provide the steps necessary to perform an accuracy assessment.

  1. In the Object Analyst window, click on the Operation dropdown list and select Accuracy Assessment
  2. Change the Classification field to my_classification
  3. Change the Reference field to Training
  4. Click Generate Report

An Accuracy Assessment Report opens with two useful accuracy measures:

  • Error (Confusion) Matrix – Provides details about which training and accuracy sites were classified into different classes

image044.png

  • Accuracy Statistics – Provides a range of useful statistics to see how well features were classified

image046.png

You will notice from our run, that every class had an accuracy result greater than 90%, except for Soil, which was closer to 60%. We can now use the Rule-based Classification tools to quickly and accurately improve the Soil class

  1. In the Object Analyst window, change the Operation to Rule-based Classification
  2. In the Parameters section, change the Class field to my_classification
  3. Change the Class filter field to Pavement (the class we want to reclassify shapes that are actually soil, but misclassified as pavement)
  4. Change the New class field to Soil (the class we want the identified shapes to be reclassified to)
  5. In the Maps tab, right click on the seg.pix:2. Tutorial_seg: my_classification layer and select Attributes Manager…

image048.png

  1. In the Attributes Manager, click on the Field dropdown menu and select Compute…
  2. Type the following expression into the Expression field: Mean_red/Mean_blue

Your Expression field should look like the following:

image050.png

  1. In the Output Parameters section, change the Field name to soilMetric
  2. Change the Field type to Double

image052.png

  1. Click on the Run button at the top image054.png
  2. Close the Compute window and the Attribute Manager
  3. In the Object Analyst window (Rule-based Classification section), click on the Specify condition checkbox
  4. Click Pick Range… button
  5. In the Feature Visualization window, change the Class field to my_classification
  6. Change the Class filter to Pavement
  7. Change the Range field to soilMetric

Some of the shapes on the image will now be highlighted in yellow. We can adjust the handles in the Feature Visualization window to highlight soil shapes that were incorrectly classified as pavement

  1. Drag the Maximum value handle all the way to the right (~1.56)
  2. Drag the Minimum value handle to ~1.12 (you can also type it in)

The shapes highlighted will change as you adjust the values. Now the field objects should be highlighted, but not the road objects

image056.png

  1. Click OK
  2. In the Object Analyst window, click Add and Run image058.jpg

The shapes that were highlighted should now change from the pavement class color to the soil class color. We will now rerun the accuracy assessment operation to see if our modifications improved the results

  1. Perform another accuracy assessment by repeating steps 1-4 from this section

The soil class has now increased to 85% accurate

image059.png

  1. Close the Accuracy Assessment Report window

 

Reforming your Classified Shapes

This final operation will merge abutting shapes that are of the same class to create a final output

  1. In the Object Analyst window, change the Operation to Reform Shapes
  2. Change the Class filter to my_classification
  3. In the Output section, click the Browse… button
  4. In the File Selector window, name your output file results and click Save
  5. Change the Layer to New Layer (give it a name if you want)
  6. Click Add and Run image016.jpg
  7. Once the process has completed, uncheck all of the vector layers in the Maps tab, except for the top layer (make sure to keep the imagery checked, as well)

image061.png

Your results should look similar to the following:

image063.png

 

Have more questions? Submit a request

Comments

Powered by Zendesk