Unsupervised classification (Tutorial)

From AWF-Wiki
(Difference between revisions)
Jump to: navigation, search
(Unsupervised K-Means classification)
Line 1: Line 1:
 
==Unsupervised K-Means classification==
 
==Unsupervised K-Means classification==
# Add the raster layer ''188_pca_indices.tif'' into a [[QGIS]] project.
+
 
## Open the k-means classification algorithm provided by the Orfeo toolbox. It can be found in the processing toolbar under {{mitem|text=Toolbox --> Orfeo Toolbox --> Learning --> Unsupervised KMeans image classification}} (see figure '''A''').
+
* Type into the search box of the Windows taskbar: {{typed|text=mapla.bat}}. Click on mapla.bat to open the Monteverdi Application Launcher.
##* Set the ''188_pca_indices'' layer as {{button|text=Input image}}.
+
* In the search engine of the Processing Toolbox, type {{typed|text=kmeans}} and double click '''KMeansClassification'''.
##* Training set size: 100000
+
* Specify a multispectral image as Input Image.
##* Set the {{button|text=Number of classes}} to 20 and the {{button|text=Number of iterations}} to 1000.
+
* Specify directory and name for the Output image. Select the output data type {{button|text=uint 8}} from the pull-down list.
##* The {{button|text=Convergence threshold}} should be set at 0.0001.
+
* Set the {{button|text=Number of classes}} to {{typed|text=20}}
##* Leave all other configurations as they are and click {{button|text=Run}}. The resulting image has 20 classes, labeled from 0 to 19.
+
* Check the {{button|text=Training set size}} to {{typed|text=10000}}
 +
* Click on {{button|text=Execute}}.
 +
* Load the resulting image into QGIS. It is single band file with 20 grey levels labeled from 0 to 19.
 +
* {{mitem|text=Layer Properties --> Symbology --> Render type}}. Switch to {{button|text=Singleband pseudocolor}} and select a '''Color ramp''' (e.g. Spectral). Select the Mode {{button|text=Equal interval}} and set the number of classes to {{typed|text=20}}
 +
[[File:qgis_otb_kmeans.png|400px]]
  
 
[[Category:QGIS Tutorial]]
 
[[Category:QGIS Tutorial]]

Revision as of 16:37, 23 November 2018

Unsupervised K-Means classification

  • Type into the search box of the Windows taskbar: mapla.bat. Click on mapla.bat to open the Monteverdi Application Launcher.
  • In the search engine of the Processing Toolbox, type kmeans and double click KMeansClassification.
  • Specify a multispectral image as Input Image.
  • Specify directory and name for the Output image. Select the output data type uint 8 from the pull-down list.
  • Set the Number of classes to 20
  • Check the Training set size to 10000
  • Click on Execute.
  • Load the resulting image into QGIS. It is single band file with 20 grey levels labeled from 0 to 19.
  • Layer Properties --> Symbology --> Render type. Switch to Singleband pseudocolor and select a Color ramp (e.g. Spectral). Select the Mode Equal interval and set the number of classes to 20

Qgis otb kmeans.png

Personal tools
Namespaces

Variants
Actions
Navigation
Development
Toolbox
Print/export