** Note that this tutorial is valid for Geomatica 2017. Object Analyst was changed in Geomatica 2018 and various steps were updated. For the Geomatica 2018 tutorial see https://support.pcigeomatics.com/hc/en-us/articles/360016137091-Object-Analyst-Classification-Geomatica-2018-
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.
In this tutorial, you will work with high resolution UltraCam-X imagery to perform feature extraction on vegetation and paved ground (e.g. roads) (See Below).
*Note: Feature extraction is different than object classification, as you are trying to extract a specific type of feature (e.g. roads) and not trying to perform a complete image classification.
Downloading Tutorial Data and Software
Download the tutorial data package from our cloud:
https://pcigeomatics.sharefile.com/d-sf0e0803c17446a6a
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 Layers
In this section we are going to simply load and review the different layers that will be used as inputs to segmentation and feature extraction.
- Navigate to C:\...\OA_FeatureExtractionTutorial and locate the inputs.pix file
- 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
- Click on the Files tab in the layer and files manager on the left side of Focus
- Expand the Rasters branch to view the individual rasters contained in the Inputs.pix file
- Right click on layer 4 (surface model) and select View > As Grayscale
A normalized surface model will render in grayscale. This surface model was extracted from the UltraCam imagery using Geomatica’s DEM Extraction module. It has been refined to remove the effects of terrain so that we are left with just the height of buildings, trees and other surface features. This layer will also be used for segmentation and feature extraction since it can help separate trees from grass, buildings from roads and more.
- Right click on layer 5 (greenness index) and select View > As Pseudocolor
A pseudocolor image representing the areas that are greener versus areas that are less green in color is displayed. The areas in red represent high amount of green color, whereas the areas in green represent low amount of green color. This index was used instead of an NDVI, because an NIR band does not exist, as is typical with many aerial images. It can still be used to help separate vegetation from non-vegetation.
- Click on the Maps tab in the layer and files manager on the left side of Focus
- Move the inputs.pix RGB layer to the top so that it is rendering in the viewer
Feature Extraction with Object Analyst
This main part of the tutorial will walk you through the Object Analyst workflow for the purpose of extracting specific features (i.e. vegetation and paved ground)
- In the Focus dropdown menu bar, click on Analysis > Object Analyst
- In the Object Analyst wizard, click on the Operation dropdown list and select Segmentation
- In the Source image layers section, click Select…
- In the File dropdown list, select the only file in the list (inputs.pix)
- Select the first 4 channels (not the 5th channel)
The layers selected in the panel below will be used for segmenting the image
- Click OK
- In the Parameters section, set the Scale to 25
- In the Output section, click Browse…
- In the File Selector window, set the file name to seg and click Save
- In the Layer dropdown list, select New Layer and then rename it to tutorial_seg
- Click on the Add and Run button
- After processing, your segmentation layer should be loaded into the Focus viewer
- 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 feature extraction workflow we are performing in this tutorial. 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
- In the Source Channels section, click on Select…
- Keep channels 1 - 4 checked, but this time also check channel 5
- Change the Band Alias names to the following:
B01 > Red, B02 > Green, B03 > Blue, B04 > Heights, B05 > Greenness
- Click OK
- In the Channel statistics section, make sure that Mean is checked
- Check all 4 Geometrical statistics (Compactness, Elongation, Circularity, Rectangularity)
- Click Add and Run
- In the Object Analyst wizard, click on the Operation dropdown list and select Rule-based Classification
- In the Parameters section, click on Create… next to the Class field parameter
- In the Field Name text box, type vegetation
- Click Create
- For Class filter, select NoData
- For New class, type in veg
- Click on the Specify condition checkbox
Your window should look like the following
- Click on Pick Range
- In the Feature Visualization window that opens, change the Range field to Mean_Greenness
The viewer will now highlight some of the objects (segments) in yellow. Toggle controls will also be activated, which allow you to set an upper and lower threshold for defining vegetation based on Mean_Greenness field
- First, move the Maximum value handle all the way to the right (approximately 142.39)
- Move the Minimum value handle to the right until you hit about 130.7 (you can also type it in directly)
The vegetation should now be mostly highlighted (maybe some shadow areas are not). The results should look similar to the following:
- Click OK on the Feature Visualization window
- Click Add and Run
The vegetation features are now extracted and the information is stored in the vector attributes field vegetation
- In the Object Analyst wizard, change the Operation to Reform Shapes
- In the Parameters section, change the Class filter to vegetation
- In the Output section, click Browse…
- Select your output folder and name the file vegetation
- Click Save
- Select New Layer from the Layer dropdown list
- Change the name to veg_merge
- Click Add and Run
- Once the process has completed, uncheck the seg.pix layer to view your merged results
- Expand the vegetation.pix branch and double click on the veg polygon style
- Click More >> in the Style Selector window
- Select the color dropdown next to Polygon – Fill #1
- Select a green color from the color palette
- Click OK
The merged vegetation features are now represented in a more appropriate style
To continue to extract a more advanced feature (roads) see appendix (below)
Appendix – Advanced Feature Extraction (Roads)
In order to perform a more advanced rule-based feature extraction (classification), it is recommended that you generate derivative statistics directly in the attributes table, which can then be used by the Object Analyst’s rule-based classifier.
For example if we wish to extract road features, the following heuristic can help isolate concrete features in an RGB image:
if (Mean_Red >= 85) then
Mean_Red / Mean_Blue (where concrete will have values close to 1.0)
endif
Since we also have a normalized surface model (e.g. building, tree heights), we can expand the above metric to eliminate features with heights above local terrain, which will remove buildings from being identified and limit our extraction to roads and parking lots. The following heuristic is used:
if ( Mean_Heights > 1.5 ) then (removes buildings... 1.5 is used to allow room for some error)
0
elseif (Mean_Red < 85 ) then (additional heuristic to eliminate shadow and other darker features)
0
else
Mean_Red / Mean_Blue )
endif
By running the above heuristic in the attributes manager to add a new field to the attributes table, you can then use the Feature Visualization tool on that field to isolate roads/parking lots.
Note: This appendix continues from the last step of the main tutorial (above)
- In the Maps tab, toggle off the vegetation.pix layer and toggle on the seg.pix layer
- Right click on the seg.pix layer and select Attribute Manager…
- In the Attribute Manager window, click on the Field dropdown and select Compute…
- In the Compute window, click on the View dropdown and select Advanced
- Copy and paste the following expression into the Expression input field
if ( Mean_Heights > 1.5 ) then
0
elseif (Mean_Red < 85 ) then
0
else
Mean_Red / Mean_Blue
endif
- Change the Field name to concrete_index
- Change the Field type to Double
- Click the run button
- Close the Compute window
Your attributes table should now have a new field called concrete_index (many records will be 0.000)
- In the Object Analyst wizard, change the Operation to Rule-based Classification
- In the Parameters section, click on Create… next to the Class field parameter
- In the Field name text box, type Roads
- Click Create
- For Class filter, select NoData
- For New class, type in Roads
- Click on the Specify condition checkbox
- Click on Pick Range
- In the Feature Visualization window that opens, change the Range field to concrete_index
- First, move the Maximum value handle to about 1.126 (or type it in)
- Move the Minimum value handle to about 0.933 (or type it in)
- Click OK on the Feature Visualization window
- Click Add and Run
The road (concrete) features are now extracted and the information is stored in the vector attributes field Roads
- Change the Operation to Reform Shapes
- Change the Class filter to Roads
- In the Output section, click Browse…
- Select your output folder and name the file roads
- Click Save
- Select New Layer from the Layer dropdown list
- Change the name to roads_merge
- Click Add and Run
- Once the process has completed, uncheck the two seg.pix (Roads and Vegetation) layers to view your merged results for roads
Comments