You are on page 1of 62

Performing object-based image analysis

Using Object Analyst in Geomatica Focus

Version 1.2
©2017 PCI Geomatics Enterprises, Inc.® All rights reserved.
COPYRIGHT NOTICE
Software copyrighted © by PCI Geomatics Enterprises, Inc., 90 Allstate Parkway, Suite 501, Markham, Ontario L3R 6H3,
CANADA Telephone number: (905) 764-0614
The Licensed Software contains material that is protected by international Copyright Law and trade secret law, and by
international treaty provisions, as well as by the laws of the country in which this software is used. All rights not granted to
Licensee herein are reserved to Licensor. Licensee may not remove any proprietary notice of Licensor from any copy of the
Licensed Software.

Page iv PCI Geomatics


Contents
Introduction 7
About Object Analyst 7
Workflow of OBIA 7
Project architecture 11

Region of study, objective, data 13


Region of study 13
Objective 14

Segmentation and feature extraction 17


Segmentation is key 17
Performing segmentation 19
Feature extraction 23

Collecting and editing training sites 27


Training sites are key 27
Selecting a training vector layer and training field 30

Classification 35
Calculating features 35
Selecting the segmentation file and fields 35
Viewing a classification 37

Accuracy Assessment 41
Evaluating classification accuracy 41

Editing and improving a classification 45


No classification is perfect 45
Rule-based classification 45
Merging and reshaping objects 51

Attaching a representation file to a classification 53


Modifying and saving the representation file 53
Importing a representation file 54

Exporting the classification 55


Converting the classification to a raster 55
Creating a pseudocolor segment 57
Exporting the pseudocolor segment to geocoded RGB 58
Creating a GeoTIFF file 59

Notes 61

PCI Geomatics Page v


Introduction

About Object Analyst


In Geomatica Focus, you can use Object Analyst, an object-based image analysis
(OBIA) feature, to segment an image into objects for classification and analysis. It
differs from the traditional pixel-based approach, which focuses on a single pixel as
the source of analysis.
Like OBIA, Object Analyst is designed primarily for use with very-high-resolution
(VHR) imagery; however, you can use Object Analyst with any imagery that meets
the necessary criteria. That is, you can use imagery of lower resolution, of various
resolutions, and that is in an input format supported by Geomatica Focus.
By working with objects, which are extracted through a segmentation process,
analysis can be both simplified and made more sophisticated. That is, by using
objects, human-visual interpretation of images can be augmented by using the
software to do much of the preliminary work in creating and determining which
shapes, of given sizes, textures, and so forth, are of interest.

Workflow of OBIA
The workflow of performing an OBIA begins with preprocessing your data. If you
are using more the one satellite image, such as is used in this tutorial, you can
merge them into a single PCIDSK file. By doing so, you can more easily apply
operations like resampling or reprojection to make the data easier to work with.
You can also add extra layers, such as vegetation indices, a DEM, or a layer
representing an area of interest (AOI).
After preprocessing, you can then use Object Analyst to segment the data.
Segmentation is the first step of the supervised OBIA process. It involves selecting
a file and the layers it contains to perform segmentation. When a file contains
many layers, you can achieve better results (better objects) by using a relevant
subset.
Other than the selected layers, segmentation is controlled by three basic
parameters: scale, shape, and compactness. To achieve segmentation that meets
the objectives of your supervised classification, some experimentation may be
necessary.
The objects (polygons) layer created by the segmentation is accompanied by an
attribute table containing a unique identification number (ID) for every object.

PCI Geomatics Page 7


Introduction Performing object-based image analysis

After segmentation, you next perform feature extraction. This involves selecting
the source channel or channels from which to compute a series of features
(statistical and geometrical) for each object in the segmentation layer. You can
select which features to compute. The features are used later during supervised
classification.
Next, you edit training sites. This consists of selecting a series objects
representative of each land-cover class of interest.
To make editing training sites easier, consider the following:
 Select approximatively the same number of training sites for each class.
 Select a few representative training objects for each class. That is, selecting
too many training objects for a class does not improve the classification
accuracy; rather, it may degrade it. Conversely, the number of verification
objects can be much greater and will improve the reliability of the accuracy
assessment report.
During supervised classification, you select one of two supervised classifiers: the
maximum likelihood (MLC) or the Support Vector Machine (SVM) classifier. Each
uses as input a selection of calculated features and one training-site field. The
output is stored in a new field, and the output classification is displayed
automatically with its legend in Focus.
You next evaluate the output classification by creating an accuracy-assessment
report and by visually inspecting the output classification using the original image
or ancillary data. If the classification is suitable, you can export it. If the
classification is not entirely satisfactory, you can do any of the following:
 Reform Shapes (A)
Use this operation to improve the aesthetic of your classification. You can
choose from two options: Automatic dissolve and Interactive edits.
Each option modifies the shape of the object and the total number of objects.
Therefore, the extracted features (statistical and geometrical) will no longer
be accurate for the edited objects. It is best to use Reform Shapes at the
end of your classification process or use it on a copy of your segmentation
file.
 Rule-based Classification (%
This operation refines an existing supervised classification by reassigning the
class of some objects based on conditions or ranges. You can define and
apply a classification rule that you have created on segments classified
already or on unclassified segments. The prerequisite is the feature extraction
of each segment. After algorithmic classification, you can either remove a
class for some or all segments, or change the membership of certain
segments in a class to improve the overall accuracy of the classification.
Another scenario is when no algorithmic classification is performed and you
want to assign certain segments to a class based on criteria you specify. You
can create an attribute field in a vector layer to store the class information
and create a rule by using the available extracted features.
 Run another supervised Classification (C)
You can run a second supervised classification by selecting a different set of
features, different training-sites field (see next item), or both if your project
contains more than one.

Page 8 PCI Geomatics


Performing object-based image analysis Introduction

 Modifying an existing training-site field or create a new one (D)


When a classification is particularly unsatisfactory and cannot be improved by
rule-based classification, it is likely that the you will have to modify the
training-sites field by: a) Modify the training site of a particular class by
deleting an existing training site or selecting new ones; b) create a new
existing land-cover class, or c) remove an existing land-cover class.
Alternatively, instead of modifying an existing training field, you can create a
new one to allow for easier analysis that will ultimately lead to a satisfactory
classification.
 Extract new features (E)
Sometimes it may be necessary to extract new features before rerunning the
supervised classification.
 Run a new segmentation (F)
If after several attempts a satisfactory classification has not been produced,
you can run a new segmentation. If you do so, you must also rerun Feature
Extraction, Training Sites Editing, and supervised Classification.

Note You can neither export nor transfer training and


verification sites from one segmentation to another.

PCI Geomatics Page 9


Introduction Performing object-based image analysis

OBIA workflow diagram


Figure 1 shows the general workflow of object-based image analysis (OBIA).

Figure 1. Workflow of OBIA

Page 10 PCI Geomatics


Performing object-based image analysis Introduction

Project architecture
It is good practice to keep all relevant files of an OBIA project in the same folder
(My_OBIA_project) and to link all files in a Geomatica project file
(My_OBIA_project.gpr). By doing so, you ensure that the project is exportable to
another location and can be reopened quickly, especially if a project contains many
classifications with a legend.
A typical OBIA project contains an image and a segmentation file. The
segmentation is performed on (all or a subset of) the image layers. The project can
also contain ancillary data: raster or vector. While you cannot use ancillary-raster
data for segmentation; that is, you can only use the layers in the image being
segmented, you can use the ancillary-raster data later in feature extraction.

Figure 2. Folder organization of a typical OBIA project


The project will also typically contain an object field, either for training or accuracy
assessment, from which a supervised classification is produced. The classification
can often be improved by extracting additional features or by editing the object
field.
A project can contain several segmentation files derived from the same image.
Each segmentation is characterized by a different set of layers and parameters
(scale, shape, compactness).
Each segmentation file contains a set features (statistical or geometrical) you
specify, and which you can expand anytime during classification ( ). A
segmentation can also contain several fields corresponding to a different set of
training and accuracy objects, where the number of land-cover (or land-use)
classes can vary and, therefore, will produce a different classification of the same
area.
However, because the calculated features depend on the configuration of a
particular segmentation, you cannot transfer training and accuracy objects from
one segmentation to another.

PCI Geomatics Page 11


Introduction Performing object-based image analysis

Figure 3. Folder organization of a more complex OBIA project


Typically, segmentation and feature extraction are performed on the same image.
However, you can perform segmentation and extract some features on one image
and use another image to extract a second set of features. To do so, you must
ensure that the second image contains the entire segmentation; otherwise, all
objects outside the boundary of the second image will be set to zero.

Page 12 PCI Geomatics


Region of study, objective, data

Region of study
The region of study (ROS) is centered in Ottawa (45°25′14.22′′N; 75°
41′47.30′′W), the capital of Canada.
The northern part of the ROS is rugged and hilly and is part of the Canadian Shield.
This region is mostly forested (deciduous and mixed deciduous) with many lakes.
Delimited by the Ottawa River, the southern part of the ROS is the Great Lakes-St.
Lawrence Lowlands. Where the drainage is good, this region is mostly prime
agricultural land while areas of poor drainage are mostly covered by a mix of
wetlands and forested areas composed of tree species that support saturated soils.

Figure 4. Region of study (acquired September 5, 2016)1


In Figure 5, the ROS is shown in a Landsat-8 image.

1 Credit: Google Earth

PCI Geomatics Page 13


Region of study, objective, data Performing object-based image analysis

Figure 5. Landsat-8 (p16r28 and p16r29) image of ROS (acquired August 26,
2016 (R: Band 6 | G: Band 5 | B: Band 4)

Objective
The objective of this tutorial is to perform a supervised object-based classification
to identify the following land-cover classes:
1. Agricultural areas
2. Urban areas
3. Forested Land
4. Water
5. Wetlands
However, these high-level land-cover classes do contain some heterogeneity and
discriminating them is not a trivial task. This tutorial will demonstrate various
strategies to achieve suitable results:
1. Use remote-sensing imagery acquired during various seasons to account
for the dynamic nature of agricultural land and ease discrimination
between coniferous and broad-leaf tree species.
2. Segmentation; that is, information generalization by regrouping pixels into
meaningful objects.
3. Use a robust nonlinear classifier, such as Support Vector-Machine (SVM).

Page 14 PCI Geomatics


Performing object-based image analysis Region of study, objective, data

4. Separate some land-cover classes into subclasses to merge them later.


The urban land cover is divided into two classes: urban dense and urban
with vegetation.
5. Post-classification improvements.

Note In this tutorial, clouds and their shadows will be ignored.

In the following table, four Landsat-8 OLI images of the Ottawa region have been
downloaded from the USGS Glovis website2.

No. Scene Path Row Acquisition date


1 LC80160282016127LGN00 16 28 May 6, 2016
2 LC80160292016127LGN00 16 29 May 6, 2016
3 LC80160282016239LGN00 16 28 August 26, 2016
4 LC80160292016239LGN00 16 29 August 26, 2016
Two mosaics, one for each acquisition date, were produced in
Geomatica OrthoEngine. Because this was done only to reassemble an image
previously split in rows for archiving, no color balancing was applied.

Band Name (wavelength) - spatial resolution Used for Used for


segmentation feature
extraction
B1 Coastal/Aerosol (0.435-0.451 μm)-30m
B2 Blue (0.452-0.512 μm)-30m √
B3 Green (0.533-0.590 μm)-30 √
B4 Red (0.636-0.673 μm)-30m √ √
B5 Near Infrared (0.851-0.879 μm)-30m √ √
B6 Short-wave Infrared-1 (1.556-1.651 μm)-30m √ √
B7 Short-wave Infrared-2 (2.107-2.294 μm)-30m √
B8 Panchromatic (0.503-0.676 μm)-15m
B9 Cirrus (1.363-1.384 μm) 30m
B10 Thermal Infrared -1(10.60-11.19 μm) -100m
B11 Thermal Infrared-2 (11.50-12.51 μm) -100m
Each mosaic was reprojected to UTM-18T (WGS84) and subsetted with the
following bounds:
 Upper left: 372 285E; 5 078 025.000N
 Lower Right: 479 565E; 4 979 475.000N
The final step was to merge the two subsetted mosaics into a single PCIDSK file for
a total of 14 spectral channels. This file, L8_Ottawa_20160506_20160826.pix, is
provided with this tutorial.

2 http://glovis.usgs.gov/

PCI Geomatics Page 15


Segmentation and feature
extraction

Segmentation is key
The success of an object-based supervised classification starts with a good
segmentation. Unfortunately, there are no objective rules to follow or absolute
criteria to tell if a segmentation is good or not. As a guideline, a trade-off is often
necessary between the mean size of objects (generalization) and their
homogeneity. That is, most objects should, in general, correspond to only one land-
cover class and their shapes should align with the boundaries (edges) observed in
the imagery.
Segmentation also depends on the selected layers (in this case, the spectral bands)
and it is not mandatory to use all available layers.
Shape, scale, and compactness parameters are also assigned to the objects.
Choosing a good combination increases the success of the supervised classification
and requires some experimentation.
The following series of figures shows the results of various combinations of scale
(SC), shape (SP) and compactness (CP) values from the segmentation of the B6,
B5, and B4 bands (followed by the total number of objects) for May 6 and
August 26, 2016.

SC:25, SP:0.10, CP:0.5 SC:50, SP:0.10, CP:0.5 SC:100, SP:0.10, CP:0.5


(3 356 129) (589 186) (136 928)

PCI Geomatics Page 17


Segmentation and feature extraction Performing object-based image analysis

SC:25, SP:0.25, CP:0.5 SC:50, SP:0.25, CP:0.5 SC:100, SP:0.25, CP:0.5


(2 608 795) (493 238) (139 528)

SC:25, SP:0.50, CP:0.5 SC:50, SP:0.50, CP:0.5 SC:100, SP:0.50, CP:0.5


(1 003 221) (338 648) (97 889)

SC:25, SP:0.75, CP:0.5 SC:50, SP:0.75, CP:0.5 SC:100, SP:0.75, CP:0.5


(662 681) (182 387) (57 007)

SC:25, SP:0.80, CP:0.5 SC:50, SP:0.80, CP:0.5 SC:100, SP:0.80, CP:0.5


(531 987) (150 372) (44 572)

Page 18 PCI Geomatics


Performing object-based image analysis Segmentation and feature extraction

SC:25, SP:0.90, CP:0.5 SC:50, SP:0.80, CP:0.5 SC:100, SP:0.80, CP:0.5


(212 739) (83 488) (24 599)

Performing segmentation
In this step, you will perform segmentation on a Landsat image.

Figure 6. Operation list with Segmentation selected

To perform segmentation
1. In Focus, open the Landsat image provided with this tutorial
(L8_Ottawa_20160506_20160826.pix).
2. On the Analysis menu, Object Analyst.
The Object Analyst window appears.
3. In the Operation list, select Segmentation.
4. Under Source Image Layers, click Select.
The Layer Selection window appears

PCI Geomatics Page 19


Segmentation and feature extraction Performing object-based image analysis

5. In the File list, select L8_Ottawa_20160506_20160826.pix, and then


select the spectral bands, as shown.
That is, because the objective of this tutorial is to classify the high-level
land cover classes based on imagery acquired at two different seasons
(spring and late summer), the spectral bands that emphasize the
vegetation changes for these two seasons will be used.
6. After you select the bands, click OK.
7. In the Object Analyst window, under Parameters, enter values as
follows:
 Scale: 50
 Shape: 0.8
 Compactness: 0.5
8. Under Output, click Browse, and then enter the path and file name to
which to write the segmentation result.
That is, enter the path and file name as follows:
 ~\OBIA_Tutorial_Ottawa\L8_Ottawa_SEG_B6B5B4_50_0.8_0.5.pix

9. Click Add and Run .


The operation is added under Process Canvas and the segmentation
process begins.

Page 20 PCI Geomatics


Performing object-based image analysis Segmentation and feature extraction

Figure 7. Object Analyst window with Segmentation set up to run


After the process is complete, the segmentation layer will appear in Focus displayed
over the Landat-8 image, as shown in Figure 8.

Figure 8. Segmentation layer in Focus


The segmentation layer contains the following four fields:
 ShapeID - unique value for every object
 Area (sq m)

PCI Geomatics Page 21


Segmentation and feature extraction Performing object-based image analysis

 Perimeter (m)
 PixelValue

Viewing the segmentation layer in Attribute Manager


You can view information about the segmentation layer in Attribute Manager.

To view the segmentation layer in Attribute Manager


1. On the Files tab in Focus, expand the
L8_Ottawa_SEG_B6B5B4_50_0.8_0.5.pix file.
2. Right-click the vector layer ([VEC]), and then click Attribute Manager.

Creating a Geomatica project file


Create a Geomatica project file that will contain the Landsat-8 image, the
segmentation layer, and, later, the classification result.

Page 22 PCI Geomatics


Performing object-based image analysis Segmentation and feature extraction

To create and save a Geomatica project file


1. On the File menu, click Save Project.
2. Enter the path and file name as follows:
~\OBIA_Tutorial_Ottawa\Ottawa_OBIA.gpr

Feature extraction
In this step, you will perform feature extraction.

Figure 9. Operation list with Feature Extraction selected


The term feature, in object-based image analysis (OBIA), corresponds to an
attribute representing some information about the image objects. In Object
Analyst, the same concept is used. Different characteristics of image objects are
referred to as features, or attributes, of a segment.
You can compute two types of features:
 Statistical
 Geometrical
Statistical features are computed based on the image pixels inside an object.
Features are computed for each of the selected image bands and added to the
attribute table of the vector segment layer as new fields (attributes). The minimum,
maximum, the mean, and the standard deviation are available.
Geometrical features that represent geometric characteristics of an object (polygon
segment) make object-based image analysis (OBIA) advantageous over pixel-based
analysis. In Object Analyst, the geometric features are computed by analyzing the
polygon boundary created during segmentation, so raster information is not
required. Object Analyst computes many shape descriptors used commonly, such
as compactness, elongation, circularity, and rectangularity.
In this tutorial, the mean of all spectral bands will be calculated for every object.
This will be sufficient for a general land-cover/land-use classification.

To perform feature extraction


1. In the Object Analyst window, under Operation, select Feature
Extraction.
2. Under Source Channels, click Select.
The Layer Selection window appears.

PCI Geomatics Page 23


Segmentation and feature extraction Performing object-based image analysis

3. Select L8_Ottawa_20160506_20160826.pix as the input file, and


then select the bands to use.
If necessary, in the Band Alias column, you can modify the alias by
clicking the corresponding box, and then entering a new alias. The new
band alias will appear as the corresponding fields in the attribute table. In
the following example, new band alias has been specified to include
information about the acquisition date.

4. After you specify any new band aliases, click OK.


5. Under Segmented Vector Layer, click Select, and then specify
L8_Ottawa_SEG_B6B5B4_50_0.8_0.5.pix as the input segmentation
file.

6. Click OK.
7. Under Feature Attributes, select the Mean check box, but leave the
other check boxes clear.

8. Click Add and Run .


The operation is added under Process Canvas and the feature-extraction
process begins.

Page 24 PCI Geomatics


Performing object-based image analysis Segmentation and feature extraction

Figure 10. Object Analyst window with Feature Extraction set up to run
After the process is complete, you can view the selected statistics for image
L8_Ottawa_SEG_B6B5B4_50_0.8_0.5.pix in Attribute Manager.

Figure 11. Attribute Manager showing selected statistics for image


L8_Ottawa_SEG_B6B5B4_50_0.8_0.5.pix

PCI Geomatics Page 25


Collecting and editing training
sites

Training sites are key


The next operation is to collect and edit training sites. With a supervised
classification, this is perhaps the most crucial operation and can be labor intensive.
You can use the following series of figures as a guide to help you to collect training
and verification classes for each land-cover class.

Class Class
May 6, 2016 August 26, 2016
No. /description
Wetlands -
Marsh

Wetland -
Peatlands

PCI Geomatics Page 27


Collecting and editing training sites Performing object-based image analysis

Class Class
May 6, 2016 August 26, 2016
No. /description
Forest -
coniferous

Forest -
deciduous

Water

Page 28 PCI Geomatics


Performing object-based image analysis Collecting and editing training sites

Class Class
May 6, 2016 August 26, 2016
No. /description
Urban - dense

Urban –with
vegetation

Agriculture –
bare (in May)

PCI Geomatics Page 29


Collecting and editing training sites Performing object-based image analysis

Class Class
May 6, 2016 August 26, 2016
No. /description
Agriculture –
vegetation (in
May)

Selecting a training vector layer and training field

Figure 12. Operation list with Training Sites Editing selected

To select a training vector layer


1. In the Object Analyst window, under Operation, select Training Sites
Editing.
2. Under Training Vector Layer, select a segmentation file.
In this case, select L8_Ottawa_SEG_B6B5B4_50_0.8_0.5.pix.
3. Under Training Sites, click Edit.
The Training Sites Editing window appears.
4. Beside Training field, click Create, and then in the Training Field
window, type T_A_SVM1b as the name of the field in the Field Name
box.
The new field is added to L8_Ottawa_SEG_B6B5B4_50_0.8_0.5.pix.

To create a new class and select training or accuracy objects


1. In the Training Sites Editing window, click Add Class.
2. In the Class Name column of the table, enter a class name, and then in
the Color column, select a color.
The color will be used for the classification, but you can change it later in
the process.

Page 30 PCI Geomatics


Performing object-based image analysis Collecting and editing training sites

3. Beside Sample type, click Training.


4. In Focus, pan, zoom, or both, as necessary to find an area representative
of wetlands.

5. Click Individual Select , click an object in the image, and then in the
Training Sites Editing window, click Assign.
You can select multiple objects to assign by holding down the Shift key
and clicking each object you want. You can also drag a selection square or
rectangle over the objects you want.
6. In the Training Sites Editing window, beside Sample type, click Accuracy
assessment, and repeat step 5 to select objects for accuracy
assessment.
Note: You cannot use the same object simultaneously for training and as
a verification object. If an object is already assigned to a class, and you
select it again, it will be updated with the new state. The same rule
applies to a class selected previously.

PCI Geomatics Page 31


Collecting and editing training sites Performing object-based image analysis

7. Repeat steps 1 to 6 for each class.

Tip Save your project regularly.

In Attribute Manager, the Training field of


L8_Ottawa_SEG_B6B5B4_50_0.8_0.5.pix is now updated for all objects that have
been selected for training (Class Name_T) of accuracy assessment (Class Name
_A).

Figure 13. Training field updated in Attribute Manager

Page 32 PCI Geomatics


Performing object-based image analysis Collecting and editing training sites

Figure 14. Training site with classes defined

Color R-G-B Class


255-102-0 Wetlands
0-153-0 Forest - coniferous
0-250-0 Forest - deciduous
0-0-255 Water
0-0-0 Urban - dense
74-74-74 Urban - vegetation
255-204-255 Agriculture - bare
204-51-204 Agriculture -vegetation

PCI Geomatics Page 33


Collecting and editing training sites Performing object-based image analysis

Figure 15. Position of training and verification objects used in this tutorial

Page 34 PCI Geomatics


Classification

Calculating features
The next operation is to classify the data using some calculated features, statistical
or geometrical, in combination with a field containing training (Class Name_T) and
accuracy-assessment (Class Name_A) objects.

Note You can use the L8_Ottawa_SEG_B6B5B4_50_0.8_0.5.pix


image provided with the tutorial.

Selecting the segmentation file and fields

Figure 16. Operation list with Classification selected

To run classification
1. In the Operation list, select Classification.
2. Under Vector Layer and Fields, click Select, and then in the Vector
Layer and Field Selector window, do the following:
 Select L8_Ottawa_SEG_B6B5B4_50_0.8_0.5.pix as the
segmentation file.
 Select the extracted feature fields to use for the classification.
 Click OK.
3. Under Type, click Supervised.
4. Under Training Field, select the field of the segmented layer with the
training and accuracy objects (Training).
5. Under Output Class Field, type SVM_T1 as the name of the field to
which to write the classification result.
The field will be added to the segmentation file in Attribute Manager.
6. Under Classifier, click SVM.

PCI Geomatics Page 35


Classification Performing object-based image analysis

7. Click Add and Run .


The operation is added under Process Canvas and the classification
process begins.

8. After the classification process is complete, save your project file


(Ottawa_OBIA.gpr).
In Attribute Manager, you can view the three new fields that have been added for
L8_Ottawa_SEG_B6B5B4_50_0.8_0.5.pix:
 Label: Unique integer label assigned automatically to each class by OBIA.
 SVM_T1: Result of the classification.
 SVM_Voting_Prob: SVM voting probability. This field can be used to assess
the robustness of the classification.

Figure 17. Attribute Manager showing the three new fields added

Page 36 PCI Geomatics


Performing object-based image analysis Classification

Viewing a classification
After the classification process is complete, a legend appears on the Maps tab in
Focus. The color of each class corresponds to those specified during selection of the
training and verification objects. The opacity is set at 25 percent for quick
interpretation of the results.

To modify the styles of your classification


1. Double-click Agriculture_bare.
The Style Selector window appears.
Each class is composed of two parts, the object interior color (Polygon –
Fill) and its contour (Line – Solid). Switch between Advanced and
Simple modes to view all the available options to modify the class style.
Note: You may need to first click More.
2. Click Advanced, and then set the class opacity to 100.
3. To preview the change, click Apply, and then to accept the change, click
OK.
Changes to styles are saved automatically.
4. Repeat steps 1 to 3 for each class by setting the opacity at 100.

PCI Geomatics Page 37


Classification Performing object-based image analysis

You can also remove the outline of a classified object by, in Advanced mode,
selecting 2 in the Part list, and then clicking Remove .

Figure 18. Sample supervised classification

Page 38 PCI Geomatics


Performing object-based image analysis Classification

The following series of images show the progression of the image through object-
based image analysis (OBIA).
Landsat-8
May 6, 2016.

R: Band 6
G: Band 5
B: Band 4

Landsat-8
August 26, 2016.

R: Band 6
G: Band 5
B: Band 4

Supervised classification
result (detail)

With object contour

PCI Geomatics Page 39


Classification Performing object-based image analysis

Supervised classification
result (detail)

Without object contour

Page 40 PCI Geomatics


Accuracy Assessment

Evaluating classification accuracy


You can evaluate the accuracy of a classification by switching between the
classification and the source imagery. You can also, if necessary, create an
accuracy report.

Figure 19. Operation list with Accuracy Assessment selected

To create an accuracy report


1. Under Operation, select Accuracy Assessment.
2. Under Classified Vector Layer, select the segmentation file that contains
a classification result from a supervised classification; that is, select
L8_Ottawa_SEG_B6B5B4_50_0.8_0.5.pix.
3. Under Classification field, select the field that contains the classification
result; that is, select SVM_TI.
4. Under Reference field, select the field that contains the training and
accuracy objects used to generate the selected classification field; that is,
select Training.

PCI Geomatics Page 41


Accuracy Assessment Performing object-based image analysis

5. Click Generate Report.


The Accuracy Assessment Report window appears.

The Accuracy Assessment Report window has three tabs:


 Sample Listing: Shows all assessed samples, with georeferenced position,
image coordinates, classified value/name, and reference value/name.
 Error (Confusion) Matrix: Shows a matrix of all classes between reference
data and classified data.
 Accuracy Statistics: Shows various accuracy statistics, such as overall
accuracy, kappa coefficient, and confidence intervals.

Page 42 PCI Geomatics


Performing object-based image analysis Accuracy Assessment

After you create an accuracy-assessment report, you can export it as either a


Microsoft Excel spreadsheet (.xls) or as a text file (.txt).
To export an accuracy-assessment report

1. In the Accuracy Assessment Report window, on the Sample Listing, Error


(Confusion) Matrix, or Accuracy Statistics tab, as applicable, click Export
Report.
The File Selector window appears.

2. In the File Selector window, select a folder, enter a file name for the report,
and then click Save.

Figure 20. Sample accuracy-assessment report

PCI Geomatics Page 43


Editing and improving a
classification

No classification is perfect
Even if a high accuracy has been achieved, it is unlikely that the classification is
perfectly suited to the project.
Typically, before exporting a classification refinement of some land-cover classes or
some manual editing might be necessary.
While Object Analyst offers several options for refining a classification, this section
will focus on two:
 Rule-based classification
 Merging and reshaping objects

Rule-based classification
You can use rule-based classification to split a class into subclasses.
In addition to supervised and unsupervised classification algorithms, with Object
Analyst you can also create a custom rule to assign class membership to segments.
By creating a custom rule, you can as an analyst select the criteria that determines
membership of a sample in a class based on your understanding of the domain,
data, or both.
You can use various tools or assessments to better understand the data and
processes, but the decision on membership of a class is human-made. You can then
create a classification rule by using the available features and based on your
understanding of the data and the application domain. The knowledge to construct
a classification rule comes from existing understanding, which is translated simply
in the form of an equation. This process is highly user-dependent and involves data
exploration and onscreen interpretation of both the image and the segments.
Object Analyst can define and apply a classification rule that you have created on
segments classified already or on unclassified segments. The prerequisite is the
feature extraction of each segment. After algorithmic classification, you can either
remove a class for some or for all segments, or change the membership of certain
segments in a class to improve the overall accuracy of the classification.
A close inspection of the classification created in Classification has revealed that the
wetland class is too general; it would be preferable to split this class into two
subclasses:

PCI Geomatics Page 45


Editing and improving a classification Performing object-based image analysis

 Wooded wetland, mostly coniferous (dense to sparse tree cover)


 Open wetland (no trees)
To perform this task, you will use the interactive Pick Range feature of the Rule-
based Classification operation.

To perform class reassignment by using Pick Range


1. Under Operation, select Rule-based Classification.
2. Under Class Edit, click Assign.
3. Under Vector Layer, select the segmentation file with the classification
field to modify; that is, select
L8_Ottawa_SEG_B6B5B4_50_0.8_0.5.pix.
4. Under Parameters, do the following:
 In the Class field list, select the field with the classification to modify;
that is, select SVM_T1.
 In the Class filter list, select the land-cover class to modify; that is,
select Wetlands.
 In the New class list, select the class to which to write the objects.
This can be an existing class or a new class; however, you will create a
new class by typing Wetland_open.

5. To perform the interactive class reassignment, select the Specify


condition check box, and then click Pick Range.
The Feature Visualization window appears.

Page 46 PCI Geomatics


Performing object-based image analysis Editing and improving a classification

Fortunately, the near infrared band is sufficient to allow a good discrimination


between the wooded and open wetlands.
To guide your range selection, in Focus, open the wetland vector map from Natural
Resources Canada, which is provided in this tutorial.

To open the wetland vector map


1. In Focus, on the Filemenu,click Open, and then select
Wetlands_Canvec_50K.pix.
2. In the Feature Visualization window, drag the Minimum value and
Maximum value sliders to compare the values.
Notice that the selected objects appear in a different color in Focus.
3. Optionally, you can deselect the other classes to help you to find the best
range because only the wetland class will be modified.

The following series of images show the variations of the minimum and maximum
values.
In Figure 21, the selected objects are highlighted in pale orange. These are the
candidates of the new open wetland class. Notice that the wetland reference data is
now displayed with a thicker white outline on the polygon so they are more easily
differentiated from the objects classified as wetlands.

PCI Geomatics Page 47


Editing and improving a classification Performing object-based image analysis

Figure 21. Sample new wetland class


In Figure 22, the selected objects are highlighted in pale orange. These are the
candidates of the new open wetland class; however, too many objects are selected.

Figure 22. Sample new wetland class (too many objects selected)
In Figure 23, the selected objects are highlighted in pale orange. This is a good
range.

Page 48 PCI Geomatics


Performing object-based image analysis Editing and improving a classification

Figure 23. Sample new wetland class (good range)


After you find a suitable range, in the Feature Visualization window, click OK.
You can now apply your changes to the classification:

 In the Object Analyst window, click Add and Run .

Figure 24. Object Analyst window with Pick Range


In Attribute Manager, the SVM_T1 field is updated with the new Wetland_open
class.

PCI Geomatics Page 49


Editing and improving a classification Performing object-based image analysis

Figure 25. Attribute Manager showing updated SVM_T1 field


The new class has also been added to the legend.

Figure 26. Class added to legend

Page 50 PCI Geomatics


Performing object-based image analysis Editing and improving a classification

Merging and reshaping objects


With Reform Shape, you can improve the aesthetic of your classification.

Figure 27. Operation list with Reform Shape selected


You can choose from two options:
 Automatic dissolve: Merges two adjacent polygons based on class
membership
 Interactive edits: Merge or split polygons you select

Caution Only reform shapes after classification and after you have
made a backup of your project. Reforming shapes
modifies object shapes and the total number of objects,
which renders the extracted features (statistical and
geometrical) invalid.

Merging polygons
The selected layer must have one or more polygons with class information

To merge adjacent polygons


1. Under Operation, select Reform Shapes.
2. Under Type, click Interactive edits.
3. Under Vector Layer, select the segmentation file with the classification
field you want to modify; that is, select
L8_Ottawa_SEG_B6B5B4_50_0.8_0.5.pix.

PCI Geomatics Page 51


Editing and improving a classification Performing object-based image analysis

4. Under Editing Tools, click Individual Select ( ), and then in Focus,


click the first polygon you want to merge.

5. Click Merge Polygon ( ), and then in Focus, click one or more


polygons to merge.
To undo a merge, on the File menu, click Undo. You can also press
Ctrl+Z.

The following image shows merging before and after.

6. After you have merged the polygons you want, on the Maps tab, right-
click the map layer, and then click Save.

Page 52 PCI Geomatics


Attaching a representation file to
a classification

Modifying and saving the representation file


The styles you apply to a classification are saved in the Geomatica project file
(*.grp). If the segmentation file that contains the classification field is opened
standalone in Focus or in another project the styles will be unavailable.
To retain your styles for future use, create a representation file (*.rst). You can do
so at any stage of your project.

To modify and save the representation file


1. In Focus, on the Maps tab, right-click the vector layer with the
classification result you want, and then click Representation Editor.
The Representation Editor window appears.

2. To modify the style of a class, in the Style column of the table, double-
click the class.
The Style Selector window appears.
3. Select a style, and then click Apply.
4. Repeat steps 2 and 3 for each class you want to modify, and then click
OK.

PCI Geomatics Page 53


Attaching a representation file to a classification Performing object-based image analysis

5. To save the representation file, on the toolbar, click Save ( ).


The Save As window appears.

6. In the File box, you can type or select the name you want; that is, select
SVM_T1.
7. In the Description box, type a brief description to help identify the
relevance of the file.

Importing a representation file


With a project in which you want to use the representation you created in Modifying
and saving the representation file, you can import the file. That is, when you open
a classification without its associated Geomatica project file (*.gpr), you can import
the representation file you created previously.

To import a representation file


1. In Focus, open the classification.
2. On the Maps tab, right click the classification, and then click
Representation Editor.
3. In the Attribute list, select the field with the supervised class labels; that
is, select SVM_T1.

4. On the toolbar, click Link ( ).


The RST Link window appears.

5. In the File list, select the file you created previously; that is, select
Classif_SVM_T1.rst, and then click OK.
6. In the Representation Editor window, click Apply, and then click OK.
The styles are now associated with the classification you selected.

Page 54 PCI Geomatics


Exporting the classification

Converting the classification to a raster


While Geomatica features various methods by which you can export a classification
to another format, this tutorial describes using the POLY2RAS algorithm to convert
the classification to a raster file using a class label field. You then create a
pseudocolor table (PCT) and assign the various colors to each class.

To convert the classification to a raster layer


1. In Focus, on the Tools menu, click Algorithm Librarian.
The Algorithm Librarian window appears.
2. Open the POLY2RAS algorithm.
The POLY2RAS Module Control Panel window appears.
3. Under Input Ports, click Browse, and then select
L8_Ottawa_SEG_B6B5B4_50_0.8_0.5.pix as the input polygon layer
and bounding area.

4. Under Output Ports, type a path and SVM1_classif.pix as the file name
for the output file.

PCI Geomatics Page 55


Exporting the classification Performing object-based image analysis

5. Click the Input Params 1 tab, and then do the following:


 In the Output type list, select Raster.
 In the Field name box, type Label.

6. Click Run.
The classification you specified is converted to a single-channel, 8-bit file.

Page 56 PCI Geomatics


Performing object-based image analysis Exporting the classification

Creating a pseudocolor segment


The output of POLY2RAS is a gray-valued, 8U single channel. The numeric values
correspond to the values stored in the specified POLY2RAS field name.

Figure 28. Numeric values in Geomatica Focus

To create a pseudocolor segment


1. In Focus, on the Files tab, right-click the image channel you want, point
to View, and then click As Pseudocolor.
2. Click the Maps tab, and then expand the pseudocolor file ( ).
3. Double-click the square beside class 1 ( ), and then in the Change PCT
Entry Color window, click a new (RGB) color for the class, and then click
OK.
4. Repeat step 3 for classes 2 through 8, selecting the color you want for
each class.
5. Right-click the pseudocolor file, and then click Save As.
The Save As window appears.
6. Save the pseudocolor segment to the PCIDSK file that contains the
classification.

PCI Geomatics Page 57


Exporting the classification Performing object-based image analysis

Exporting the pseudocolor segment to geocoded RGB


A pseudocolor segment is now attached to the classification. When you open the
classification in Focus, it will display with the colors you selected.
You can now export the file to a geocoded RGB file by running the PCE algorithm.

To encode the single channel pseudocolor classification to an RGB file


1. In Focus, open the Algorithm Librarian, and then open the PCE
algorithm.
The PCE Module Control Panel window appears.
2. For Input: Layer to Encode, select the 8U channel containing the
classification.
3. For InputPCT: Pseuodocolor Layer Table, select the PCT you created
previously.
4. For the output file, enter the path and SVM1_Classif_RGB.pix as the file
name.

Page 58 PCI Geomatics


Performing object-based image analysis Exporting the classification

5. Click Run.

Creating a GeoTIFF file


After you create the new RGB file, you can export it to a GEOTIFF file by using the
Translate tool in Focus.

To create a geoTIFF file


1. In Focus, click the File menu, point to Utility, and then click Translate.
The Translate (Export) File window appears.
2. For Source file, select the RGB file you created previously.
3. For Destination file, select a path and SVM1_Classif_RGB.tif as the file
name.
4. Under Output format, select TIF: TIFF 6.0.
5. Under Source Layers, select all three 8U raster channels, and then add
them to the Destination Layers list by clicking > Add >.
6. Click Translate.

PCI Geomatics Page 59


Notes

PCI Geomatics Page 61


pcigeomatics.com
info@pcigeomatics.com

You might also like