You are on page 1of 15

Practical material developed by Dr Kasper Johansen and Muhammad Kamal for the GEOM3001/7001 ADVANCED REMOTE

SENSING OF ENVIRONMENT School of Geography, Planning and Environmental Management, The University of
Queensland, Australia

PRACTICAL
OBJECT BASED IMAGE ANALYSIS CLASSIFICATION

1. OBJECTIVES:
To introduce basic classification and image export approaches through the use of rule sets
2. DATA REQUIREMENTS
Before you start, copy all required files below:
Mbay_etm_210302.img
Rule Set2.dcp

Multi-spectral Landsat-7 ETM+ image of southern part of Moreton Bay and the
Redland Bay area.
A rule set file showing the steps of processes used in this practical.

Please note that those parts of the tutorial that require you to do work in eCognition Developer 8 or 9 have been
marked with the following symbol:

3. PROCEDURES
PART 1: OPENING WORKSPACE, PROJECT AND REPETITION OF SEGMENTATION
In this section we will repeat the steps we learned in the last tutorial to obtain a segmented image we can classify. In the
last tutorial we used a supervised classification approach (Standard Nearest Neighbor) to classify the image into landcover classes. This time we will develop a rule set using a stepwise approach by classifying one land-cover class at a
time, which allows the use of context information.
1.

Create a New Project and load the image. Change the band combination to your choice using the Edit
Image Layer Mixing function

2.

Set the desktop view to Develop Rulesets layout

3.

Load the Rule Set2.dcp into the Process Tree window by right-click on the Process Tree panel and
select Load Rule Set.

4.

Expand the rule sets to comprehend the scenario and process steps of the land-cover classification. Click +
icon on the left side of the rules to do this. The complete rule set will be look similar to Figure 1.

Practical material developed by Dr Kasper Johansen and Muhammad Kamal for the GEOM3001/7001 ADVANCED REMOTE
SENSING OF ENVIRONMENT School of Geography, Planning and Environmental Management, The University of
Queensland, Australia

Segmentation process

Classification processes

Additional processes

Export processes

Figure 1. Rule set showing the steps required to classify the land-cover.

5. Execute the 10 [shape:0.1 compct.:0.5] creating 'SP10' rule to segment the image.
ADDITIONAL INFORMATION
If you want to learn how to create the rule set, please refer to the Appendix 1 at the end of this tutorial document.

PART 2: FEATURE VIEW AND PROCESSES


Land-cover Classes
Once the Rule Set2.dcp is loaded, the predefined land-cover classes will also listed in the Class Hierarchy panel.
There are four classes that will be used in this practical: Water bodies, Mainland, Islands, and Lakes on islands.
We will now use the rule set to classify these four land-cover classes, but first it is important to become familiar
with some common terms used.
Object Features
Object Features are obtained by evaluating Image Objects themselves as well as their embedding in the Image
Object hierarchy. Object Features, such as the spectral information for each object, are used for the classification
of land-cover classes. Within the Object Features category, there are a number of features to select (Figure 2).
Layer values relate to the pixel layer values of an image object. For example, Mean blue means the mean value of
all pixels from the blue band within an object. Other useful features include object shape and texture. You can also
customize your own features. We will do that later by creating an NDVI layer (see Appendix 2).

Practical material developed by Dr Kasper Johansen and Muhammad Kamal for the GEOM3001/7001 ADVANCED REMOTE
SENSING OF ENVIRONMENT School of Geography, Planning and Environmental Management, The University of
Queensland, Australia

Figure 2. Available features used for image classification (a), and image object information from the
selected segment (b).
Class-Related Features
Class-related features refer to the Classification of other Image Objects that are taken into account for the
Classification of the Image Object in question. Therefore, the classification of at least one land-cover class is
required before the class-related features can be used. For example, once a river has been classified, it is possible
to use class-related features to classify the riparian zone, e.g. based on distance to the river. We will explore some
of the object features and class-related features when developing the rule set for the classification.
To change between image views (View Layer, Classification view, Sample view, and Feature View) use the
following icons:

These view options are useful when comparing the original image, classified image, and feature views (see below)
Also, explore the Split, Split Horizontally, Split Vertically, Independent View, Side by Side View, and Swipe
View options under Window in the main menu. To get rid of the Split View, un-tick the Split Horizontally or Split
Vertically depending on which on is being used or select the Side by Side View.
Feature View
The most crucial part in Rule Set development is to find the optimal Features and values for classifying Image
Objects into land-cover classes. The Feature View is a useful tool for finding the optimal features and to help
determine threshold values for the land-cover mapping. Per default, the Feature View tool is open when working in

Practical material developed by Dr Kasper Johansen and Muhammad Kamal for the GEOM3001/7001 ADVANCED REMOTE
SENSING OF ENVIRONMENT School of Geography, Planning and Environmental Management, The University of
Queensland, Australia

the Develop Ruleset view (below the Class Hierarchy window). To expand and collapse the feature groups within
the Feature View, click on the + or (Figure 2a).
Exploring the Feature View
First, we will assess the mean NIR object values for classifying Water bodies. With the Feature View tool, the
values for all objects can be displayed in either grey scale values or a color range.
1.
2.
3.

Browse to Object Features\Layer Values\Mean\NIR within the Feature View. Double-click


on NIR.
Move your cursor over the objects in the viewer and the exact feature values for the objects will appear. All
objects appear in grey scale values, with low values in dark and high values in bright (Figure 3a).
To display actual thresholds in colour, right-click on NIR in the Feature View and select Update Range,
then check the box at the bottom of the Feature View window (Figure 3b). This will activate the display of
the feature range with the minimum value displayed in the left box and the maximum value displayed in the
right box. All Image Objects are coloured in a smooth transition from blue (low values) to green (high
values). With the arrows besides the value boxes you can increase or lower the end of the range. All objects
which are not within this range will be displayed in grey scale.

a
b

Figure 3. NIR feature view showing vegetation in bright tone and water in dark tone (a). Value range of
mean NIR of the segments (b).
4.

Put the NIR range value from 0 to 22 and examine which object was selected within this range. Sometimes
we need to combine different features and their threshold values to discriminate between objects belonging
to different land-cover classes. Once we have found the appropriate combination we can use these features
and thresholds in a process within the rule set.

Sometimes, you may want to use band ratios, indices or other equations, which are not available. For this you can
use the Arithmetic Feature found under Object features\Customized\Create new Arithmetic
Featurein the Feature View panel. At this practical we will use the NDVI as an arithmetic feature.
5.

6.

The NDVI feature has been embedded in the Rule Set2.dcp. To see the algorithm and settings, right
click on the Object features\Customized\NDVI in the Feature View panel, and select Edit.
You will then see the algorithm settings of NDVI (Figure 4a).
Now, use the Feature View tool again, and assess which interval of NDVI values would be suitable of
mapping Water bodies (see Figure 4b).

ADDITIONAL INFORMATION
4
If you want to learn how to create the arithmetic feature of NDVI, please refer to the Appendix 2 at the end of
this tutorial document.

Practical material developed by Dr Kasper Johansen and Muhammad Kamal for the GEOM3001/7001 ADVANCED REMOTE
SENSING OF ENVIRONMENT School of Geography, Planning and Environmental Management, The University of
Queensland, Australia

Figure 4. Customized Arithmetic Feature NDVI (a), and mapping water bodies using NDVI (b).

PART 3: CLASSIFICATION USING SPECTRAL INFORMATION


We are now ready to execute the rule set to classify Water bodies using NDVI and mean NIR. There are a number
of different classification processes to use. Those most commonly used are classification with more than two
conditions and assign class, where you only have one or two conditions. In this case, we have three conditions for
classifying Water bodies:
First condition: Mean NIR < 22;
Second condition: NDVI < -0.2; and
Third condition: Brightness < 39.

ADDITIONAL INFORMATION
If you want to learn how to modify class conditions, please refer to
the Appendix 3 at the end of this tutorial document.

As there are three conditions, we need to use the Class Description and then add only one process pointing to the
content of the Class Description. It is important to understand that whenever you want to classify land-cover classes
using the information contained in the Class Description, you have to use the algorithm called Classification.
Advantages of using Class Descriptions as a container for conditions include:
- that the conditions can be combined using different operators like and / or;

Practical material developed by Dr Kasper Johansen and Muhammad Kamal for the GEOM3001/7001 ADVANCED REMOTE
SENSING OF ENVIRONMENT School of Geography, Planning and Environmental Management, The University of
Queensland, Australia

that the conditions of the classes can be inherited to child classes, if they are arranged in the Inheritance
Hierarchy;
that you can use Me mbership Functions describing smooth transitions between classes in a fuzzy way
(also referred to as fuzzy classification).

In the Class Hierarchy, the conditions are all sorted under the operator. Per default the and (min) operator is
defined (Figure 5). The and (min) operator indicates that the minimum value of the conditions inserted wins. In
other words, if one of the conditions is not fulfilled, the respective object will not be classified.

Figure 5. Class Description for Water bodies, showing that three conditions have to be fulfilled before an
object can be classified as Water bodies.
1.
2.
3.
4.

To open the Class Description for Water bodies, double-click on Water bodies in the Class Hierarchy.
Examine the Class Description for Water bodies, check if the conditions are similar to Figure 5, and click
OK once you satisfied.
Double click on the at SP10: Water bodies to review the algorithm and setting for classifying Water
bodies (Figure 6).
Execute at SP10: Water bodies and you will notice that water bodies have now been classified.

Practical material developed by Dr Kasper Johansen and Muhammad Kamal for the GEOM3001/7001 ADVANCED REMOTE
SENSING OF ENVIRONMENT School of Geography, Planning and Environmental Management, The University of
Queensland, Australia

Figure 6. Edit Process window for classifying Water bodies using the Class Description.
In the next step, we will classify the Mainland. We only need one condition to classify land, so we will not use the
Class Description this time.
5.
6.
7.

Double click unclassified at SP10: Mainland to review the algorithm and setting for classifying Mainland
(Figure 7).
Then click Execute. This will assign all remaining unclassified objects not classified as water bodies to the
Mainland class (Figure 7).
Assess the classification result. You will notice that all islands have also been classified as Mainland. We
will now improve the classification to separate islands from the mainland.

Practical material developed by Dr Kasper Johansen and Muhammad Kamal for the GEOM3001/7001 ADVANCED REMOTE
SENSING OF ENVIRONMENT School of Geography, Planning and Environmental Management, The University of
Queensland, Australia

Figure 7. Edit Process window for classifying the Mainland class using the assign class condition.

PART 4: MERGING OBJECTS


The aim of object based image analysis is to find the outlines of the objects/land-cover classes of interest. Within a
more complex rule set, there are always several segmentation and classification steps before arriving at the final
classification. eCognition offers several algorithms to merge objects. These algorithms are all grouped in the
category Reshaping. The simplest Reshaping algorithm is the merge region. With this algorithm, Objects are
merged without any condition. Our first step towards separating the mainland from islands is to merge all objects
classified as Water bodies and then merge all objects classified as Mainland.
1.
2.
3.

Double click on the Water bodies at SP10: merge region to review the algorithm and setting for merging
Water bodies class (Figure 8).
Execute Water bodies at SP10: merge region to merge the Water bodies segments into larger segments.
Execute Mainland at SP10: merge region to merge the Mainland segments into larger segments.

Practical material developed by Dr Kasper Johansen and Muhammad Kamal for the GEOM3001/7001 ADVANCED REMOTE
SENSING OF ENVIRONMENT School of Geography, Planning and Environmental Management, The University of
Queensland, Australia

Figure 8. Edit Process window for merging the Water bodies class.
4.

Assess the result of merging objects within the two land-cover classes. Click on the two land-cover classes
in the classified image on the left hand side of your screen to see what happened to the objects.

PART 5: CLASSIFICATION USING CONTEXT INFORMATION


Find Enclosed by Class
In this section we will explore how context information can be used to classify (1) islands and (2) lakes on the
islands. First we will use the find enclosed by class algorithm. This algorithm finds objects that are completely
enclosed by image objects belonging to a certain land-cover class or to multiple specified land-cover classes.
1.
2.

Double click on the Mainland at SP10: enclosed by Water bodies: Islands + to review the algorithm and
setting for finding Islands class.
Then Execute Mainland at SP10: enclosed by Water bodies: Islands +.

Question: Assess the result of classifying islands and explain why some islands were not classified.

Image Object Information and Area


As you may have discovered, some of the islands were not completely surrounded by water, as they touch the edge
of the image. In the next step we will classify these remaining islands by using their areal size in relation to the
mainland objects. As all islands are smaller than the mainland objects, one single threshold can be used to
discriminate them from the mainland.

Practical material developed by Dr Kasper Johansen and Muhammad Kamal for the GEOM3001/7001 ADVANCED REMOTE
SENSING OF ENVIRONMENT School of Geography, Planning and Environmental Management, The University of
Queensland, Australia

To find the correct threshold, you can use the Feature View as explained above or you can use the Image Object
Information window.
3.
4.

5.

To display the Area of objects within the Image Object Feature window, right-click within the Image
Object Information window and select Select Features to Display.
In the Select displayed Features, browse to Object features\Geometry\Extent\Area and
double-click on Area to add it to the right hand side box named Selected (Figure 9). The right hand side
box shows all features that will be displayed in the Image Object Information window, whereas the left
hand side box shows all available features that can be added to be displayed (Figure 9).
Click on the largest island you can find within the image and the areal size will appear in the Image Object
Information window. Use this to set the threshold for discriminating Islands and Mainland. We will use
threshold area of less than 31000 pixels to classify the Islands.

Figure 9. Features to display in the Image Object Information window.


6.
7.

Double click on the Mainland with Area < 31000 Pxl at SP10: Islands to review the algorithm and setting
for finding other Islands class.
Execute Mainland with Area < 31000 Pxl at SP10: Islands and assess the result of classifying the
remaining islands

Relative Border to
In this section we will use the Relative Border to function. The Relative Border refers to the length of the shared
border of neighbouring image objects. The feature describes the ratio of (1) the shared border length of an image
object with a neighbouring image object assigned to a defined class and (2) the total border length. If the relative
border of an image object to neighbouring image objects of a certain class is 1, the image object is completely
surrounded by these image objects. If the relative border is 0.5, the image object is surrounded along half of its
border. We will use this feature to classify lakes on islands.

10

Practical material developed by Dr Kasper Johansen and Muhammad Kamal for the GEOM3001/7001 ADVANCED REMOTE
SENSING OF ENVIRONMENT School of Geography, Planning and Environmental Management, The University of
Queensland, Australia

8.
9.

Double click on the Water bodies with Rel. border to Islands = 1 at SP10: Lakes on islands to review the
algorithm and setting for finding Lakes on Islands class.
Execute Water bodies with Rel. border to Islands = 1 at SP10: Lakes on islands and assess the final
result of land-cover classification, which should look similar to the map in Figure 10.

Figure 10. Final land-cover map.

Extra tasks:
1.

2.

3.

Classify lakes on the mainland as a separate land-cover class using either the find enclosed by class or
Relative border to algorithm. (for all tasks make sure the image object domain is set to image object
level)
Classify shallow water surrounding the islands. Suggested steps: chessboard segmentation of islands with
an object size of 1; then multiresolution segmentation of islands; then reclassify parts of islands with
NDVI < -0.1 as shallow water; then merge region for islands; then merge region for shallow water; and
then reclassify shallow water objects surrounded by islands, as islands. (for all tasks make sure the image
object domain is set to image object level)
If you have time, reclassify the mainland into agricultural fields, remnant vegetation and residential areas.
You will first have to perform a chessboard segmentation, then a multiresolution segmentation and
possibly a spectral difference segmentation if deemed useful. Make sure you only focus on the mainland
land-cover class for the segmentation and make sure the image object domain is set to image object level.
The brightness feature may be useful to explore to discriminate remnant vegetation and agricultural fields.

11

Practical material developed by Dr Kasper Johansen and Muhammad Kamal for the GEOM3001/7001 ADVANCED REMOTE
SENSING OF ENVIRONMENT School of Geography, Planning and Environmental Management, The University of
Queensland, Australia

Brightness and NDVI used together may be useful for discriminating residential areas from remnant
vegetation and agricultural fields.
PART 6: EXPORTING AN IMAGE CLASSIFICATION
There are a large number of export options in eCognition. We will explore how to create a process to export your
classified image so that you can open and work with it in other software packages such as ENVI and ArcMAP.
1.
2.
3.
4.

Double click on the at SP10: export classification to Export_raster to review the algorithm and setting for
exporting the classification result to raster.
Execute at SP10: export classification to Export_raster.
Do the same for the at SP10: export object shapes to Export_vector
You can now open the saved classified image in other software packages.

There are a large number of algorithms to choose from in eCognition. The Reference book under the Help function
in the main menu provides an explanation of algorithms and related algorithm parameters.

12

Practical material developed by Dr Kasper Johansen and Muhammad Kamal for the GEOM3001/7001 ADVANCED REMOTE
SENSING OF ENVIRONMENT School of Geography, Planning and Environmental Management, The University of
Queensland, Australia

APPENDIX 1: Creating rule set


Creating segmentation rule set:
1. In the Process Tree right-click and select Append New. In the Edit Process window change the name to
Rule Set2 and click OK.
2. Right-click on Rule Set within the Process Tree window and select Insert Child. Change the name to
Segmentation within the Edit Process window and click OK.
3. Right-click on Segmentation within the Process Tree window and select Insert Child. In the Edit
Process window select:
Algorithm = multiresolution segmentation
Image Object Domain = pixel level, Map = From Parent, Threshold condition = --Level name = SP10
Image Layer Weights = 1 for all bands
Scale Parameter = 10
Shape = 0.1
Compactness = 0.5
Creating classification rule set:
4. Create a folder in the Process Tree for the classification processes by right-clicking on Segmentation and
select Append New. Change name to Classification within the Edit Process window and click OK.
5.

[Water bodies rule] Right-click on Classification (the parent process) within the Process Tree, and
select Insert Child. In the Edit Process window select the following parameters (Figure 6):
Name: Leave as is
Algorithm: Classification (may need to scroll down to more and add it to the list)
Image Object Domain:Level = SP10, Class filter = none, Map = From Parent, Region = From
Parent, Max. number of image objects = all.Algorithm parameters: Active classes = Water bodies,
Erase old classification = No, Use class description = Yes

6.

[Mainland rule] Right-click on at SP10: Water bodies within the Process Tree and select Append New.
In the Edit Process window select the following parameters (Figure 7):
Name: Leave as is
Algorithm: Assign class
Image Object Domain: Level = SP10, Class filter = unclassified, Map = From Parent, Region =
From Parent, Max. number of image objects = all.
Algorithm parameters: Use class = Mainland

7.

[Merging Water bodies class rule] To merge neighbouring objects within the same class, first append a
New Process and in the Edit Process window (right-click on unclassified at SP10: Mainland in the
Process Tree and select Append New) and select the following parameters:
Name: Leave as is
Algorithm: merge region
Image Object Domain: Level = SP10, Class filter = Water bodies, Map = From Parent, Region =
From Parent, Max. number of image objects = all.
Algorithm parameters: Fusion super objects = No, Use Thematic Layers = No

8.

[Merging Mainland class rule] Repeat the process for Mainland by appending a New Process and in the
Edit Process window select the following parameters:
Name: Leave as is
Algorithm: merge region

13

Practical material developed by Dr Kasper Johansen and Muhammad Kamal for the GEOM3001/7001 ADVANCED REMOTE
SENSING OF ENVIRONMENT School of Geography, Planning and Environmental Management, The University of
Queensland, Australia

Image Object Domain: Level = SP10, Class filter = Mainland, Map = From Parent, Region = From
Parent, Max. number of image objects = all.
Algorithm parameters: Fusion super objects = No, Use Thematic Layers = No
9.

[Classifying islands] Appe nd a New Process and in the Edit Process window and select the following
parameters:
Name: Leave as is
Algorithm: find enclosed by class
Image Object Domain: Level = SP10, Class filter = none, Map = From Parent, Region = From
Parent, Max. number of image objects = all.
Search Settings: Enclosing classes = Water bodies (those objects enclosing the objects you want to
classify), compatibility mode = None
Classification Settings: Active classes = Islands (those objects you want to classify)
Erase fold classification. = No, Use class description = No

10. [Refining unclassified Islands] Append a New Process and in the Edit Process window and select the
following parameters:
Name: Leave as is
Algorithm: assign class
Image Object Domain: Level = SP10, Class filter = Mainland, Threshold condition = Area <
31000 pixels, Map = From Parent, Region = From Parent, Max. number of image objects = all.
Algorithm parameters: Use class = Islands
11. [Lakes on islands rule] Append a New Process and in the Edit Process window select the following
parameters:
Name: Leave as is
Algorithm: assign class
Image Object Domain: Level = SP10, Class filter = Water bodies, Threshold condition = Relative
border to Islands = 1
Find Rel. border to by left-clicking on --- within the Threshold condition field and in the
Select Single Feature window browse to Class-Related features\Relations to
neighbor objects\Rel. border to\Create new Rel. border to, then
double-click on Create new Rel. border to and the Create Rel. border to window will open.
Select Islands within the Value field by clicking on unclassified and go to the drop-down
menu. Finish off by clicking ok. In the Select Single Feature, double-click on the just created
feature, i.e. Rel. border to Islands. In the Edit threshold condition window select = and 1 as
Threshold settings and click OK.
Algorithm parameter: Use class = Lakes on islands.
Creating export rule set:
12. [Creating Export process container] Right-click on Classification within the Process Tree window and
select Append New. Within the Edit Process window, change the name to Export results and click OK.
Create also Export to raster and Export to vector containers under the Export results
13. [Export result to raster] Right-click on Export to raster within the Process Tree window, and select Insert
Child. In the Edit Process window use the following parameters:
Name: Leave as is
Algorithm: export thematic raster files

14

Practical material developed by Dr Kasper Johansen and Muhammad Kamal for the GEOM3001/7001 ADVANCED REMOTE
SENSING OF ENVIRONMENT School of Geography, Planning and Environmental Management, The University of
Queensland, Australia

Image Object Domain: Level = SP10, Class filter = none, Map = From Parent, Region = From
Parent, Max. number of image objects = all.
Algorithm parameters: Select an export item name of your choice, set the Export Type to
Classification, set the Default File Format to Erdas Imagine Images (*.img), select the Desktop
Export Folder of your choice for saving the exported land-cover map, and leave everything else as
is.
14. [Export result to vector] Right-click on Export to vector within the Process Tree window, and select Insert
Child. In the Edit Process window use the following parameters:
Name: Leave as is
Algorithm: export vector layers
Image Object Domain: Level = SP10, Class filter = none, Map = From Parent, Region = From
Parent, Max. number of image objects = all.
Algorithm parameters: Select an export item name of your choice, set the Attribute Table: Area
(m2) and Class_name (Class-related features > Relation to classes >
class name distance: 0,0), Shape Type: Polygon, Export Type: Raster, Export Format:
Shapefile (*.shp), Desktop Export Folder of your choice, and leave everything else as is.
APPENDIX 2: Creating NDVI feature
1.
2.
3.

4.

To create an NDVI index, double-click on Create new Arithmetic Feature.


Change the Feature name from Arithmetic Feature to NDVI.
Insert in the Feature calculator the NDVI function using the Mean Red and Mean NIR values (left doubleclick) and the required symbols such as brackets, minus, division, etc. (left-click) (Refer to Figure 4 for
NDVI function).
Then click Apply and OK. The NDVI feature you have now created will appear under Object
features\Customized\NDVI.

APPENDIX 3: Creating class description for Water bodies


1.
2.
3.
4.
5.
6.
7.

Double click the Water bodies class.


In the Class Description window, double-click on the and (min) operator or right-click and select Insert
new Expression.
In the Insert Expression window, browse to Object features\Layer Values\Mean\NIR
Right-click on NIR and select Insert Threshold. The Edit threshold condition window will open.
In the Edit threshold condition window, select the operator to < and the threshold value to 22, and click
OK. The first condition is now inserted in the Class Description.
Now, repeat the same process to set NDVI < -0.2. (in the Insert Expression window you will find NDVI
under Object features\Customized) and Brightness < 39.
Then, close the Insert Expression window and click ok in the Class Description window.

15

You might also like