Object-based classification (Tutorial)
From AWF-Wiki
(Difference between revisions)
(→Preparation of training data) |
(→Object-based classifier training) |
||
Line 27: | Line 27: | ||
== Object-based classifier training== | == Object-based classifier training== | ||
− | + | * In the search engine of mapla, type {{typed|text=Train}} and double click '''TrainVectroClassifier'''. | |
− | + | * ''Name of the input shapefile'' is {{button|text=training_input_OBIA.shp}}. | |
− | + | * ''Output model filename'' is {{button|text=SVM_OBIA.model}} | |
− | + | * In the list ''Field names for training featrues'' mark the columns {{button|text=meanB0, meanB1, meanB2, .. meanB9}} shift left+ click. | |
− | + | * The name of''Field containing the class id for supervision" is {{button|text=C_ID}}.{{button|text=Execute}}. | |
− | + | * Classifier to use for trainin: LibSVM Linear | |
− | + | * Parameters optimization is '''ON''. | |
− | + | [[File:qgis_otb_trainVectorClassifier|400px]] | |
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
[[Category:QGIS Tutorial]] | [[Category:QGIS Tutorial]] |
Revision as of 15:34, 10 December 2018
Mean-shift segmentation of large size images
- Type into the search box of the Windows taskbar: mapla.bat. Click on mapla.bat to open Monteverdi Application Launcher.
- In the search engine of mapla, type Meanshift and double click LargeScaleMeanshift.
- Select the input image: Subset_S2A_MSIL2A_20170619T_MUL.tif (datatype uint 16bits).
- The Range radius value can be set to 600. The optimal value depends on datatype dynamic range of the input image and requires experimental trials for the specific classifcation objectives.
- The value for Minimum Segment size (in pixels) can be set to 10. It depends on the size of the minimum mapping unit and the smallest object that can be destinguished.
- Leave all other configurations as they are and click Run. Have a look on the resulting filtered and spatial images.
- The Output GIS vector file is specified as a shapefile with the extension *.shp.
- Click Execute.
- Evaluate the segmentation results:
Load the output vector file into QGIS on top of the image Subset_S2A_MSIL2A_20170619T_Mul.tif Mark the vector layer in the Qgis Layers window. Layer --> Properties --> Symbology --> Simple Fill to No Brush and Stroke color to white.
Preparation of training data
- Create a dense regular point grid Vector --> Research tools --> Regular points... with the extent of the multispectral image and a point spacing of 200 meters.
- Install the Point sampling plugin.
- Extract the landcover class from an existing thematic classifcation map using the Point Sampling Tool.
- Select 50 points in each class stratified sampling with equal allocation: Vector --> Resarch tools --> Random section within subsets....
- Rename the class field name to C_ID and change the datatype to int using Processing --> Vector table --> Refactor field.
- Join the Land use/cover (LUC) class attribute of the selected regular points with the image segments. Vector --> Data Management Tools --> Join Attributes by Location ....
- Check the correctness of the C_ID classification field by means of visual interpretation of Google maps.
Object-based classifier training
- In the search engine of mapla, type Train and double click TrainVectroClassifier.
- Name of the input shapefile is training_input_OBIA.shp.
- Output model filename is SVM_OBIA.model
- In the list Field names for training featrues mark the columns meanB0, meanB1, meanB2, .. meanB9 shift left+ click.
- The name ofField containing the class id for supervision" is C_ID.Execute.
- Classifier to use for trainin: LibSVM Linear
- Parameters optimization is 'ON.