Geoscience Reference
In-Depth Information
We provide another example on the NDVI, already introduced in Sect. 12.3 .Inthe
case study on multispectral land cover classification (Chap. 17 ) , a Spatialite vector
is created with an attribute “ndvi”. The vector has different layers with one of them
named “forest”. The following command calculates the mean and standard deviation
of the ndvi attribute for all features (polygons) in the forest layer.
pkstatogr -i training_ndvi.sqlite -ln forest -n ndvi -mean
-stdev -nodata 0
--lname forest --fname ndvi --mean 4828.5 --stdev 837.814
The histogram of the NDVI, shown in Fig. 12.5 , can be calculated in a similar way.
We calculate the histogram based on 50 bins and report the numbers in percentage
(relative histogram).
pkstatogr -i forest_ndvi.sqlite -ln forest -n ndvi -hist -nbin
50 -rel -nodata 0
With the additional option -kde 0 we can obtain the Kernel density estimate,
which smoothes the histogram as shown in Fig. 12.5 b.
12.5 pksvm
The utility pksvm implements a support vector machine (SVM) to solve a super-
vised classification problem. The implementation is based on the open source C++
library libSVM. 6 Both raster and vector files are supported as input. The output will
contain the classification result, either in raster or vector format, corresponding to
the format of the input. A training sample must be provided as an OGR vector dataset
that contains the class labels and the features for each training point. The point loca-
tions are not considered in the training step. You can use the same training sample
for classifying different images, provided the number of bands of the images are
identical. Use the utility pkextract (explained in Sect. 12.3 ) to create a suitable
training sample, based on a sample of points or polygons. For raster output maps you
can attach a color table using the option -ct .
Usage: pksvm -t training [-i input -o output] [-cv value]
Options: [-tln layer]* [-c name -r value]* [-of GDALformat|-f
OGRformat] [-co NAME=VALUE]* [-ct filename] [-label
attribute] [-prior value]* [-g gamma] [-cc cost] [-m
filename [-msknodata value]*] [-nodata value]
6 http://www.csie.ntu.edu.tw/~cjlin/libsvm
 
 
Search WWH ::




Custom Search