Take me to pcigeomatics.com

PCI Geomatics Help Center

How can we help you today?

Object Analyst - Feature Extraction

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.

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).

image003.png

image002.jpg

*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-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 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.

  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

  1. 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.

image009.png

  1. 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.

image011.png

  1. Click on the Maps tab in the layer and files manager on the left side of Focus
  2. Move the inputs.pix RGB layer to the top so that it is rendering in the viewer

image013.png

 

 

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)

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

image015.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

image017.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

image020.jpg

  1.  Click on the Add and Run button image031.jpg

image023.png

  1. After processing, your segmentation layer should be loaded into the Focus viewer

image025.png

  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 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

  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

image027.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)

image029.png

  1. Click Add and Runimage022.jpg
  2. In the Object Analyst wizard, click on the Operation dropdown list and select Rule-based Classification
  3. In the Parameters section, click on Create… next to the Class field parameter
  4. In the Field Name text box, type vegetation

image032.png

  1. Click Create
  2. For Class filter, select NoData
  3. For New class, type in veg
  4. Click on the Specify condition checkbox

Your window should look like the following

image034.png

  1. Click on Pick Range
  2. 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

image036.png

  1. First, move the Maximum value handle all the way to the right (approximately 142.39)
  2. 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:

image040.png

image038.png

  1. Click OK on the Feature Visualization window
  2. Click Add and Run

The vegetation features are now extracted and the information is stored in the vector attributes field vegetation

image042.png

  1. In the Object Analyst wizard, change the Operation to Reform Shapes
  2. In the Parameters section, change the Class filter to vegetation
  3. In the Output section, click Browse…
  4. Select your output folder and name the file vegetation
  5. Click Save
  6. Select New Layer from the Layer dropdown list
  7. Change the name to veg_merge

image044.png

  1. Click Add and Run
  2. Once the process has completed, uncheck the seg.pix layer to view your merged results

image046.png

 

  1. Expand the vegetation.pix branch and double click on the veg polygon style

image048.png

  1. Click More >> in the Style Selector window
  2. Select the color dropdown next to Polygon – Fill #1
  3. Select a green color from the color palette

image050.png

  1. Click OK

The merged vegetation features are now represented in a more appropriate style

image052.png

 

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)

  1. In the Maps tab, toggle off the vegetation.pix layer and toggle on the seg.pix layer

image054.png

  1. Right click on the seg.pix layer and select Attribute Manager…
  2. In the Attribute Manager window, click on the Field dropdown and select Compute…

image056.png

  1. In the Compute window, click on the View dropdown and select Advanced
  2. 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

  1. Change the Field name to concrete_index
  2. Change the Field type to Double

image058.png

  1. Click the run button image060.png
  2. Close the Compute window

Your attributes table should now have a new field called concrete_index (many records will be 0.000)

image063.jpg

  1. In the Object Analyst wizard, change the Operation to Rule-based Classification
  2. In the Parameters section, click on Create… next to the Class field parameter
  3. In the Field name text box, type Roads
  4. Click Create
  5. For Class filter, select NoData
  6. For New class, type in Roads
  7. Click on the Specify condition checkbox
  8. Click on Pick Range
  9. In the Feature Visualization window that opens, change the Range field to concrete_index
  10. First, move the Maximum value handle to about 1.126 (or type it in)
  11. Move the Minimum value handle to about 0.933 (or type it in)

image064.png

  1. Click OK on the Feature Visualization window
  2. Click Add and Run

The road (concrete) features are now extracted and the information is stored in the vector attributes field Roads

image067.jpg

  1. Change the Operation to Reform Shapes
  2. Change the Class filter to Roads
  3. In the Output section, click Browse…
  4. Select your output folder and name the file roads
  5. Click Save
  6. Select New Layer from the Layer dropdown list
  7. Change the name to roads_merge
  8. Click Add and Run
  9. Once the process has completed, uncheck the two seg.pix (Roads and Vegetation) layers to view your merged results for roads

image068.png

Have more questions? Submit a request

Comments

Powered by Zendesk