This is an old revision of the document!
Table of Contents
InterIMAGE Examples: Rule-Based Classification
This document explains how to start a single project in InterIMAGE and perform attribute extraction and object-based classification.
The example image will be the following:
The projects can be download here:
- Classification of Pools and Roofs:
Attributes Extraction and Visualization
Before you perform classification, its important to view the image in the attribute space.
To do so, create a new project, called, for instance “view_attributes”, with the images you are going to use in your project.
After, create a single structure to perform segmentation and attributes extraction, using yout favorite algorithm. In the following example, we created a node called “show_attributes” with Baatz segmentation.
To view some attributes, edit the top down rule of the node “show_attributes” by clicking in the button highlighted in blue.
Then insert your image and create the new attributes by inserting new expressions.
In this example, the new attribute “object_area” will represent the area of every object in the scene.
Then, start your project by clicking in the button highlighted in blue.
When the process finishes, the “Map Viewer” window will open. In this window, you can select “Attribute” in the “Fill” option and chose some of your created attributes to view in the image. Every object resultant from classification will be filled with the relative intensity of the choosen attribute, as the figure below.
Classification of Pools and Roofs - Creating Decision Rules
This example will show how to perform a single classification of pools and roofs in a small image. This project is called “pools_and_roofs” and uses the operator TerraAIDA_Baatz_Segmenter.
After creating the project, we inserted three nodes, namely pools, roofs and background. All nodes will have the top down operator TerraAIDA_Baatz_Segmenter, as showed in the figure below.
To classify, we can use the attribute ratio for band 1, as the following:
- pools
- ratio(band 1) < 0.3
- roofs
- ratio(band 1) > 0.4
- background
- ratio(band 1) >= 0.3 AND ratio(band 1) < = 0.4
The next figure shows the rule for node “roofs”.
After inserting the rules and starting the project, the resultant classification will show as the following:
Classification of Pools and Roofs - Using Supervised C4.5 Algorithm
InterIMAGE performs supervised classification through the C4.5 decision tree classifier. In order to perform such classification, the user must train the algorithm by providing samples of every class. In this way, the classification algorithm is able to create a decision tree and apply it into the whole set of objects, classifying them.
Here is an example of training file, in xml format:
File training_set.xml
<region class="roofs" ratio_b1="0.409163" /> <region class="roofs" ratio_b1="0.405262" /> <region class="pools" ratio_b1="0.293273" /> <region class="pools" ratio_b1="0.236392" /> <region class="background" ratio_b1="0.328659" /> <region class="background" ratio_b1="0.333080" />
Such file contains the information that two elements from class roofs have the attribute ratio_b1 with values “0.409163” and “0.405262”, respectively. The same happends for classes pools and background.
On the InterIMAGE interface, the user must create such classes, and set the property TopDown Multi-Class as true.
One of the nodes should perform segmentation and attributes extraction. This is done by the node pools, like the following figure.
After creating all classes present in the xml training file, setting all parameters, you can start your process, and visualize the results.
Further versions of InterIMAGE will have the interface for training. Download and try this example!