Menu

opencv_3 Log in to Edit

Anonymous Volker Wichmann
Attachments
Figure1.png (200716 bytes)
Figure2.png (188383 bytes)
Figure3.png (23715 bytes)
Figure4.png (26781 bytes)
Figure5.png (53068 bytes)
Figure6.png (206304 bytes)

OpenCV Neural Networks Module Library

This article will show you how to make use of the OpenCV ANN module, which is available in revision 1856. The data used to demonstrate the new module can be found here. Simply open SAGA and load the project ‘forest_of_goettingen.sprj’.

demo project
Figure 1 - The 'Forest of Goettingen' SAGA demo project

Now open the module, which can be found under ‘Modules -> Imagery -> OpenCV -> OpenCV Neural Networks’.

menu path
Figure 2 - Menu path to the OpenCV Neural Network module

The first decision to be made is if table or raster data will be used for the classification. Therefore you can change the 'Data type' option using the drop down box. Depending on your decision the 'Data Objects' section is changed to be able to receive the corresponding type of parameters. In this tutorial we will use raster data. Therefore the 'Data type' option is changed from 'Table' to 'Grid' (see fig. 3).

change data type
_Figure 3 - Change data type to 'Grid' _

Now set the grid system option to '28.5;….' and select all Landsat grids (see fig. 4).

landsat grids
Figure 4 - Select all Landsat grids

Then make sure to set all other options like in fig. 5. Alternatively you can download a prepared SAGA paramters file here, but ensure to correct the selection of the 'Train INPUT' parameter, which depends on your local file system. Some of the main parameters are described below:

  • OUTPUT classes: <create>
    This will create the output grid containing the winner classes.
  • OUTPUT certainty: <create>
    This will create the grid containing the certainty for the winner classes.
  • Select training areas: 01. Training Areas
    The shapes used to train the network.
  • Data type: Grid
    In this example raster data is classified.
  • Number of layers: 1
    The number of hidden layers of the network.
  • Number of neurons: 14
    The number of neurons in the hidden layer. In this case we have 14 classes. Therefore this topology will produce a quite good result.

All other options correspond to the parameters that are used by the OpenCV ANN implementation. A detailed description of each parameter can be found here.

modules settings
Figure 5 - Params for the OpenCV NNet module

Now click on the 'OK'-button and wait until the module excution is finished. You should see the 'Module execution succeeded' message in the message window. In the data section you will find the 'OUTPUT classes' element like in fig. 6.

output
Figure 6 - Output figure

The class labels are not assigned at the moment, but will have the same order as the classes in the training areas. Since the module is new, there are still some open tasks:

  • The 'Indices' parameter is yet not used by the implementation. In future it will allow an easier separation of training and evaluation data.
  • TO BE CONTINUED...

Related

Wiki: opencv

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.