How to submit a standout Adobe Champion Application
Orfeo ToolBox workshop at FOSS4G Europe 2015
1. Introduction
About the data and software
Preparing the data
Image Classification
Getting back to OpenStreetMap
Conclusion
Land cover mapping with high resolution satellite images using
Orfeo Toolbox, QGIS and OSM
Workshop - W04
Julien Michel (CNES), Jordi Inglada (CNES/CESBIO), Manuel Grizonnet (CNES)
July 14th 2015 - FOSS4GE, Como, Italy
2. Introduction
About the data and software
Preparing the data
Image Classification
Getting back to OpenStreetMap
Conclusion
Disclaimer
We come from the remote sensing world, not the GIS one,
What we propose in this workshop works, we tested it!
But ... It may look over-complicated to the GIS ninjas in the audience
There are for sure many smarter ways for the GIS processing we will do
Not to mention better GIS data sources or more adapted tools!
Keep in mind: The workshop focuses on the concept, not the tools (except for
Orfeo ToolBox)
3. Introduction
About the data and software
Preparing the data
Image Classification
Getting back to OpenStreetMap
Conclusion
About land cover mapping and supervised classification
Land cover maps are produced using supervised classification
A supervised classifier is trained to assign class labels to input features
Reference data is used for training and validation
Data Preparation
Supervised Learning
Map Production
Reference Data
Sample Selection
sample ratio
Training Samples
Validation Samples
Input Images
Feature Extraction
Radiances, NDVI, NDWI
Training
SVM, RF
Classification
Model
Classification Land Cover Map Validation
OA, FScore
4. Introduction
About the data and software
Preparing the data
Image Classification
Getting back to OpenStreetMap
Conclusion
Can we use OpenStreetMap as reference data?
Reference data has to:
represent the land cover classes of interest
be spatially coherent with the input images
contain few errors
OSM pros:
available everywhere
rich nomenclature
good geometric quality
OSM cons:
may be out of date in many places
polygons of one class may contain objects of other classes
May have improper classes for land-cover mapping (e.g. land use)
5. Introduction
About the data and software
Preparing the data
Image Classification
Getting back to OpenStreetMap
Conclusion
Outline of the workshop
In this workshop we will do the following
1. Extract relevant data from OpenStreetMap to perform supervised image
classification
2. Experiment several classification set-ups and assess their performances
3. Use the final classification map to highlight OpenStreetMap shapes that may
need an update
Using the following software
Gdal for vectorial data manipulation
Orfeo ToolBox for image processing and classification
QGis for visualisation
And data
SPOT4 (Take5) time series over Ardeche, France as a proxy for future Sentinel-2
data,
Offline OpenStreetMap export from geofrabrick.de
6. Introduction
About the data and software
Preparing the data
Image Classification
Getting back to OpenStreetMap
Conclusion
Data
Software
Outline
About the data and software
Data
Software
Preparing the data
Image preprocessing
OpenStreetMap preprocessing
Image Classification
Estimation of image statistics
Training of the classification algorithm
Classifying the image
Noise cleaning
Getting back to OpenStreetMap
Accuracy assesment
Where do OSM and Land Cover differs
7. Introduction
About the data and software
Preparing the data
Image Classification
Getting back to OpenStreetMap
Conclusion
Data
Software
SPOT4 (Take5) data and upcoming Sentinel-2 data
Sentinel-2
2 satellites ESA mission, first
launch june 2015
Will observe all continental lands
every 5 days
13 spectral bands and spatial
resolution of 10 to 60 meters
Application friendly licence
SPOT4 (Take5)
CNES short term experiment for
SPOT4 end of life
Simulate temporal revisit of future
Sentinel-2 mission
on 42 sites of 60x60 squared km.
around the Earth
With a spatial resolution of 20
meters and 4 spectral bands
SPOT4 (Take5) data will be used in this workshop as a proxy of future Sentinel-2 data.
8. Introduction
About the data and software
Preparing the data
Image Classification
Getting back to OpenStreetMap
Conclusion
Data
Software
Images overview (SPOT4 (Take5) Ardeche site, France)
9. Introduction
About the data and software
Preparing the data
Image Classification
Getting back to OpenStreetMap
Conclusion
Data
Software
OpenStreetMap data (exports from geofabrick.de)
Land use, natural and waterways layers
10. Introduction
About the data and software
Preparing the data
Image Classification
Getting back to OpenStreetMap
Conclusion
Data
Software
The Orfeo ToolBox
What is the Orfeo ToolBox?
An image processing library dedicated to remote sensing,
An open-source software under the CeCILL-v2 licence (French equivalent to
GPL),
Funded by CNES in the frame of the Orfeo program (and beyond),
Written in C++ on top of ITK (free medical image processing library),
Based on many other image processing and remote sensing open-source software
such as Gdal, OSSIM or OpenCV
Designed to process large data volumes seamlessly thanks to piece-wise
processing and multi-threading
www.orfeo-toolbox.org
11. Introduction
About the data and software
Preparing the data
Image Classification
Getting back to OpenStreetMap
Conclusion
Data
Software
How to use the Orfeo ToolBox
Write your own code
Flexible, full API available, requires C++ knowledge
Use OTB applications
High level functions (e.g. segmentation), command-line, graphical interface, or Python
writing availabe. Can be extended (write your own app). Also available in Qgis
processing framework.
Use Monteverdi2
Data visualization and access to all applications in an integrated software
12. Introduction
About the data and software
Preparing the data
Image Classification
Getting back to OpenStreetMap
Conclusion
Data
Software
Other software used in this workshop
Do we really need to introduce them ?!?
We will be using the OSgeoLive 8.5 (Orfeo ToolBox 4.2.1, Gdal 1.11.0, Qgis 2.4.0)
USB stick provided by FOSS4GE organization. . . Time to insert it into your computer!
13. Introduction
About the data and software
Preparing the data
Image Classification
Getting back to OpenStreetMap
Conclusion
Image preprocessing
OpenStreetMap preprocessing
Outline
About the data and software
Data
Software
Preparing the data
Image preprocessing
OpenStreetMap preprocessing
Image Classification
Estimation of image statistics
Training of the classification algorithm
Classifying the image
Noise cleaning
Getting back to OpenStreetMap
Accuracy assesment
Where do OSM and Land Cover differs
14. Introduction
About the data and software
Preparing the data
Image Classification
Getting back to OpenStreetMap
Conclusion
Image preprocessing
OpenStreetMap preprocessing
Objectives of this section
1. Pre-process image to get it ready for visualisation and classification
2. Learn some basics of command-line OTB processing
15. Introduction
About the data and software
Preparing the data
Image Classification
Getting back to OpenStreetMap
Conclusion
Image preprocessing
OpenStreetMap preprocessing
A first glimpse at the image
The image is located here :
Folder:
raw_data/spot4t5/SPOT4_HRVIR1_XS_20130607_N2A_CArdecheD0000B0000/
Image file:
SPOT4_HRVIR1_XS_20130607_N2A_ORTHO_SURF_CORR_PENTE_CArdecheD0000B0000.TIF
In the following slides, it will be refered to as im.tif.
1. Open the image in Qgis
2. In layer properties:
2.1 Set the no data value to -10 000 in the transparency tab,
2.2 In the style tab, change color composition to r=b3,g=b2,b=b1,
2.3 Reload statistics in the Style tab.
What do you see ?
16. Introduction
About the data and software
Preparing the data
Image Classification
Getting back to OpenStreetMap
Conclusion
Image preprocessing
OpenStreetMap preprocessing
Natural colors synthesis
SPOT4 images have the following spectral bands: Green (b1), Red (b2), Near
Infra-Red (b3), Short Wavelength Infra-Red (b4)
To get familiar with Orfeo ToolBox processing, and to ease data visualisation, we will
build a synthetic green and blue channel with the following formula:
b = 0.7 ∗ green + 0.24 ∗ red − 0.14 ∗ swir (1)
We are going to use the BandMath application, as well as the ConcatenateImages
application.
Caution: this synthetic image is only for visualisation, not for processing!
17. Introduction
About the data and software
Preparing the data
Image Classification
Getting back to OpenStreetMap
Conclusion
Image preprocessing
OpenStreetMap preprocessing
Natural colors synthetis (Solution)
Extract red band:
$ otbcli_BandMath -il im.tif -out red.tif int16 -exp "im1b2"
Extract green band:
$ otbcli_BandMath -il im.tif -out green.tif int16 -exp "im1b1"
Compute synthetic blue band:
$ otbcli_BandMath -il im.tif -out blue.tif int16 -exp "im1b1==-10000?-10000:0.7*im1b1+0.24*im1b2-0.14*im1b3"
Concatenate all bands:
$ otbcli_ConcatenateImages -il red.tif green.tif blue.tif -out rgb.tif int16
Open resulting image in qgis, and set the rendering option likewise.
18. Introduction
About the data and software
Preparing the data
Image Classification
Getting back to OpenStreetMap
Conclusion
Image preprocessing
OpenStreetMap preprocessing
Radiometric indices that help classification
We will compute two more things that will help the classification process:
A Normalize Difference Vegetation Index:
ndvi = (nir − red)/(nir + red) (2)
A Normalize Difference Water Index:
ndvi = (nir − swir)/(nir + swir) (3)
You can visualize the result in qgis, and concatenate these two bands with the
original image
Solution
$ otbcli_BandMath -il im.tif -out ndvi.tif int16 -exp "im1b1==-10000?-10000:(im1b3-im1b2)/(im1b3+im1b2)*1000"
$ otbcli_BandMath -il im.tif -out ndwi.tif int16 -exp "im1b1==-10000?-10000:(im1b3-im1b4)/(im1b3+im1b4)*1000"
$ otbcli_ConcatenateImages -il im.tif ndvi.tif ndwi.tif -out im4classif.tif
19. Introduction
About the data and software
Preparing the data
Image Classification
Getting back to OpenStreetMap
Conclusion
Image preprocessing
OpenStreetMap preprocessing
Objectives of this section
1. Turn OSM data into a vector layer suitable for classifier training:
1.1 Filter and join features to get a limited number of well-defined classes (in the sense of
classification)
1.2 Build a single layer with polygon feature bearing an integer class attribute
2. Learn how training polygons should be and which features of OSM are suitable
20. Introduction
About the data and software
Preparing the data
Image Classification
Getting back to OpenStreetMap
Conclusion
Image preprocessing
OpenStreetMap preprocessing
Pre-processing OpenStreetMap data
The data are located in the raw data/osm/ folder.
For each region, open the following files on top of the image in Qgis:
landuse.hsp
natural.hsp
waterways.hsp
To get OpenStreetMap data ready for classification, we will do the following:
1. Extract geometries that actually cover our image (area of interest)
2. Reproject all geometries in the image SRS
3. Filter OSM classes to build a set of 3 classes suitable for supervised classification
4. Process waterways to turn polylines into polygons with buffers
5. Separate our set of polygons between a training set and a validation set
21. Introduction
About the data and software
Preparing the data
Image Classification
Getting back to OpenStreetMap
Conclusion
Image preprocessing
OpenStreetMap preprocessing
Extracting geometries that cover our image
Extracting image footprint
1. Use the ImageEnvelope application
2. Output a shapefile or sqlite file
3. Control results in Qgis
4. For a more accurate result, draw the envelope by hand in Qgis
Clip OSM layers to ROI and reproject to image SRS
1. For each region and each layer
2. Use ogr2ogr
3. Use the -clipsrc option to filter by image footprint
4. Use the -t srs option to define the output SRS using the raw data/l93.wkt file
5. Use the -append option to merge both regions for each layer
22. Introduction
About the data and software
Preparing the data
Image Classification
Getting back to OpenStreetMap
Conclusion
Image preprocessing
OpenStreetMap preprocessing
Extracting geometries that cover our image (solution)
Extract image enveloppe:
$ otbcli_ImageEnvelope -in SPOT4_HRVIR1_XS_20130607_rgb.tif -proj "EPSG:32631" -out env.shp
Clipping, reprojecting and merging land use layers:
$ ogr2ogr -append -t_srs raw_data/l93.wkt -clipsrc env.shp landuse_l93.shp raw_data/osm/auvergne/landuse.shp
$ ogr2ogr -append -t_srs raw_data/l93.wkt -clipsrc env.shp landuse_l93.shp raw_data/osm/rhone-alpes/landuse.shp
Clipping, reprojecting and merging natural layers:
$ ogr2ogr -append -t_srs raw_data/l93.wkt -clipsrc env.shp natural_l93.shp raw_data/osm/auvergne/natural.shp
$ ogr2ogr -append -t_srs raw_data/l93.wkt -clipsrc env.shp natural_l93.shp raw_data/osm/rhone-alpes/natural.shp
Clipping, reprojecting and merging waterways layers:
$ ogr2ogr -append -t_srs raw_data/l93.wkt -clipsrc env.shp waterways_l93.shp raw_data/osm/auvergne/waterways.shp
$ ogr2ogr -append -t_srs raw_data/l93.wkt -clipsrc env.shp waterways_l93.shp raw_data/osm/rhone-alpes/waterways.shp
Open the three new layers in Qgis.
23. Introduction
About the data and software
Preparing the data
Image Classification
Getting back to OpenStreetMap
Conclusion
Image preprocessing
OpenStreetMap preprocessing
Build consistent classes for supervised classification
The idea
Select and join OSM features from landuse and natural layers
That form simple landcover classes (e.g. water or vegetation)
Which are big enough wrt. to image resolution (20m)
You can walk the layers and have a look at OSM spec here1
Our Proposal
Water:
basin, pond, reservoir, salt pond, water larger than 1000 squared meters from land use
layer
water larger than 1000 squared meters from natural layer
main rivers (Loire, Rhˆone) from waterways layer, buffered with 25 meters
Vegetation: forest from natural layer
Built-up: residential, commercial, cemetery, construction, industrial, recreational,
harbour, allotments, yard, brownfield, from land use layer
1
https://wiki.openstreetmap.org/wiki/Map_Features
24. Introduction
About the data and software
Preparing the data
Image Classification
Getting back to OpenStreetMap
Conclusion
Image preprocessing
OpenStreetMap preprocessing
Building the water class
1. Extract the two large rivers covering the image:
$ ogr2ogr -append -sql "select * from waterways_l93 where name in ("La Loire", "Le Rh^one")" large_rivers.shp waterway
2. In Qgis, use the vector/geoprocessing/buffer tool to build a 25m buffer around,
and save it to water.shp.
3. Append selected features from land use layer:
$ ogr2ogr -append -sql "select * from landuse_l93 where type in
("basin","pond","reservoir","salt_pond","water")
and OGR_GEOM_AREA > 10000" water.shp landuse_l93.shp
4. Append selected features from natural layer:
$ ogr2ogr -append -sql "select * from natural_l93 where type in
("water") and OGR_GEOM_AREA > 1000" water.shp natural_l93.shp
25. Introduction
About the data and software
Preparing the data
Image Classification
Getting back to OpenStreetMap
Conclusion
Image preprocessing
OpenStreetMap preprocessing
Building the vegetation and built-up classes
Vegetation class
Extract selected features from natural layer:
$ ogr2ogr -append -sql "select * from natural_l93 where type in
("forest")" forest.shp natural_l93.shp
Built-up class
Extract selected features from land use layer:
$ ogr2ogr -append -sql "select * from landuse_l93 where type in
("residential","commercial","cemetery","construction",
"industrial", "recreational","harbour",
"allotments","brownfield")" builtup.shp landuse_l93.shp
26. Introduction
About the data and software
Preparing the data
Image Classification
Getting back to OpenStreetMap
Conclusion
Image preprocessing
OpenStreetMap preprocessing
Final steps (1/2): add class label, exclude overlaps
Add class labels
Goal: create a new integer field with a unique id for each of the 3 classes
Can be done in Qgis attribute table manager
Or With the VectorDataSetField application in OTB
Exclude overlaps
Overlapping polygons of different classes confuses training and evaluation
We will therefore ignore those areas
To do so, we will use the Vector/Geoprocessing tools/Differentiate tool in Qgis
Twice for each layer, e.g. Builtup vs. water then vs. forest . . .
27. Introduction
About the data and software
Preparing the data
Image Classification
Getting back to OpenStreetMap
Conclusion
Image preprocessing
OpenStreetMap preprocessing
Final steps (2/2): build separate sets for training and validation, merge
Build separate sets for training (250 polygons of each class) and
validation (the remaining)
$ ogr2ogr -append -dialect SQLITE -sql "select * from forest order by osm_id limit 250" training.shp forest.shp
$ ogr2ogr -append -dialect SQLITE -sql "select * from water order by osm_id limit 250" training.shp water.shp
$ ogr2ogr -append -dialect SQLITE -sql "select * from builtup order by osm_id limit 250" training.shp builtup.shp
$ ogr2ogr -append -dialect SQLITE -sql "select * from forest order by osm_id limit 250,1000000" validation.shp forest.shp
$ ogr2ogr -append -dialect SQLITE -sql "select * from water order by osm_id limit 250,1000000" validation.shp water.shp
$ ogr2ogr -append -dialect SQLITE -sql "select * from builtup order by osm_id limit 250,100000" validation.shp builtup.shp
Also merge everything in a single layer
$ ogr2ogr -append all.shp water.shp
$ ogr2ogr -append all.shp forest.shp
$ ogr2ogr -append all.shp builtup.shp
28. Introduction
About the data and software
Preparing the data
Image Classification
Getting back to OpenStreetMap
Conclusion
Estimation of image statistics
Training of the classification algorithm
Classifying the image
Noise cleaning
Outline
About the data and software
Data
Software
Preparing the data
Image preprocessing
OpenStreetMap preprocessing
Image Classification
Estimation of image statistics
Training of the classification algorithm
Classifying the image
Noise cleaning
Getting back to OpenStreetMap
Accuracy assesment
Where do OSM and Land Cover differs
29. Introduction
About the data and software
Preparing the data
Image Classification
Getting back to OpenStreetMap
Conclusion
Estimation of image statistics
Training of the classification algorithm
Classifying the image
Noise cleaning
Objectives of this section
1. Learn the steps of supervised classification processing with Orfeo ToolBox
2. Perform the classification based on the OSM pre-processed data
30. Introduction
About the data and software
Preparing the data
Image Classification
Getting back to OpenStreetMap
Conclusion
Estimation of image statistics
Training of the classification algorithm
Classifying the image
Noise cleaning
Step 1: Estimation of image statistics
Some machine learning algorithm require the input features to have similar ranges
Also, the SVM algorithm will converge faster if this range is [−1, 1]
We will therefore center and reduce all image bands prior to classification
For this, we need to estimate the mean and variance of each band
Which is what this step is about
For this we will use the EstimateImagesStatistics application. Do not forget to set
the background value (-10 000)!
31. Introduction
About the data and software
Preparing the data
Image Classification
Getting back to OpenStreetMap
Conclusion
Estimation of image statistics
Training of the classification algorithm
Classifying the image
Noise cleaning
Step 1: Estimation of image statistics (solution)
$ otbcli_ComputeImagesStatistics -il im4classif.tif -out stats.xml -bv -10000
Look at the stats.xml file. Does it look correct?
32. Introduction
About the data and software
Preparing the data
Image Classification
Getting back to OpenStreetMap
Conclusion
Estimation of image statistics
Training of the classification algorithm
Classifying the image
Noise cleaning
Step 2: Training the classification algorithm
We will be using the TrainImagesClassifier application
The application should receive the image, the training layer and the xml stats file,
We will use the libsvm implementation, with a RBF kernel,
We will select at most 1000 random samples per class (2000 for validation),
You also need to set the name of the class field in the training layer.
33. Introduction
About the data and software
Preparing the data
Image Classification
Getting back to OpenStreetMap
Conclusion
Estimation of image statistics
Training of the classification algorithm
Classifying the image
Noise cleaning
Step 2: Training the classification algorithm (solution)
$ otbcli_TrainImagesClassifier -io.il im4classif.tif -io.vd training.shp -io.out model.svm
-classifier libsvm -classifier.libsvm.k rbf -sample.mt 1000 -sample.mv 2000
-sample.vfn "class" -io.imstat stats.xml
2015 Jun 15 13:56:21 : Application.logger (INFO) Confusion matrix (rows = reference labels, columns = produced labels):
[1] [2] [3]
[ 1] 1668 278 73
[ 2] 46 1773 146
[ 3] 52 208 1772
2015 Jun 15 13:56:21 : Application.logger (INFO) Precision of class [1] vs all: 0.944507
2015 Jun 15 13:56:21 : Application.logger (INFO) Recall of class [1] vs all: 0.826152
2015 Jun 15 13:56:21 : Application.logger (INFO) F-score of class [1] vs all: 0.881374
2015 Jun 15 13:56:21 : Application.logger (INFO) Precision of class [2] vs all: 0.784861
2015 Jun 15 13:56:21 : Application.logger (INFO) Recall of class [2] vs all: 0.90229
2015 Jun 15 13:56:21 : Application.logger (INFO) F-score of class [2] vs all: 0.839489
2015 Jun 15 13:56:21 : Application.logger (INFO) Precision of class [3] vs all: 0.890005
2015 Jun 15 13:56:21 : Application.logger (INFO) Recall of class [3] vs all: 0.872047
2015 Jun 15 13:56:21 : Application.logger (INFO) F-score of class [3] vs all: 0.880935
2015 Jun 15 13:56:21 : Application.logger (INFO) Global performance, Kappa index: 0.799899
34. Introduction
About the data and software
Preparing the data
Image Classification
Getting back to OpenStreetMap
Conclusion
Estimation of image statistics
Training of the classification algorithm
Classifying the image
Noise cleaning
Step 3: Classifying the image
Now that we trained a classifier with a satisfactory level of performance, lets
classify the image,
We will use the ImageClassifier application,
It should receive the input image, the model and the stats files,
We will also build a mask of no data pixels, so that they will be ignored during
classification (use the BandMath app for this)
35. Introduction
About the data and software
Preparing the data
Image Classification
Getting back to OpenStreetMap
Conclusion
Estimation of image statistics
Training of the classification algorithm
Classifying the image
Noise cleaning
Step 3: Classifying the image (solution)
$ otbcli_BandMath -il im4classif.tif -out mask.tif uint8 -exp "im1b1>-10000?255:0"
$ otbcli_ImageClassifier -in im4classif.tif -mask mask.tif -model model.svm -imstat stats.xml -out classif.tif uint8
Open the resulting land cover map in Qgis. Set the rendering to color each class with
a discriminative color. Does the classification map look correct?
36. Introduction
About the data and software
Preparing the data
Image Classification
Getting back to OpenStreetMap
Conclusion
Estimation of image statistics
Training of the classification algorithm
Classifying the image
Noise cleaning
Step 4: Classification noise cleaning
Classification maps often suffer from salt and pepper noise (isolated pixels with
class different from neighborhood)
We can filter that with the ClassificationMapRegularization application
It will perform a majority voting of classified pixels in a fixed neighborhood
(radius = 2 for instance)
37. Introduction
About the data and software
Preparing the data
Image Classification
Getting back to OpenStreetMap
Conclusion
Estimation of image statistics
Training of the classification algorithm
Classifying the image
Noise cleaning
Step 4: Classification noise cleaning
$ otbcli_ClassificationMapRegularization -io.in classif.tif -io.out classif_reg.tif -ip.radius 2
Load the cleaned map into QGis as well.
38. Introduction
About the data and software
Preparing the data
Image Classification
Getting back to OpenStreetMap
Conclusion
Accuracy assesment
Where do OSM and Land Cover differs
Outline
About the data and software
Data
Software
Preparing the data
Image preprocessing
OpenStreetMap preprocessing
Image Classification
Estimation of image statistics
Training of the classification algorithm
Classifying the image
Noise cleaning
Getting back to OpenStreetMap
Accuracy assesment
Where do OSM and Land Cover differs
39. Introduction
About the data and software
Preparing the data
Image Classification
Getting back to OpenStreetMap
Conclusion
Accuracy assesment
Where do OSM and Land Cover differs
Getting a better idea of our land cover accuracy
What is our final accuracy after regularization (e.g. denoising)?
What is our final accuracy wrt. our validation layer?
We will find out with the ComputeConfusionMatrix application
Which can cross-compare our land-cover map with our validation layer
40. Introduction
About the data and software
Preparing the data
Image Classification
Getting back to OpenStreetMap
Conclusion
Accuracy assesment
Where do OSM and Land Cover differs
Accuracy assesment (solution)
$ otbcli_ComputeConfusionMatrix -in classif_reg.tif -ref vector -ref.vector.in validation.shp
-ref.vector.field "class" -nodatalabel 0 -out conf.txt
2015 Jun 15 17:36:11 : Application.logger (INFO) Confusion matrix (rows = reference labels, columns = produced labels):
[ 1] [ 2] [ 3]
[ 1] 24532 4491 1258
[ 2] 8903 1761939 141961
[ 3] 2830 36018 573860
2015 Jun 15 17:36:11 : Application.logger (INFO) Precision of class [1] vs all: 0.676465
2015 Jun 15 17:36:11 : Application.logger (INFO) Recall of class [1] vs all: 0.810145
2015 Jun 15 17:36:11 : Application.logger (INFO) F-score of class [1] vs all: 0.737295
2015 Jun 15 17:36:11 : Application.logger (INFO) Precision of class [2] vs all: 0.977526
2015 Jun 15 17:36:11 : Application.logger (INFO) Recall of class [2] vs all: 0.921129
2015 Jun 15 17:36:11 : Application.logger (INFO) F-score of class [2] vs all: 0.94849
2015 Jun 15 17:36:11 : Application.logger (INFO) Precision of class [3] vs all: 0.800274
2015 Jun 15 17:36:11 : Application.logger (INFO) Recall of class [3] vs all: 0.936596
2015 Jun 15 17:36:11 : Application.logger (INFO) F-score of class [3] vs all: 0.863086
2015 Jun 15 17:36:11 : Application.logger (INFO) Precision of the different classes: [0.676465, 0.977526, 0.800274]
2015 Jun 15 17:36:11 : Application.logger (INFO) Recall of the different classes: [0.810145, 0.921129, 0.936596]
2015 Jun 15 17:36:11 : Application.logger (INFO) F-score of the different classes: [0.737295, 0.94849, 0.863086]
2015 Jun 15 17:36:11 : Application.logger (INFO) Kappa index: 0.811052
2015 Jun 15 17:36:11 : Application.logger (INFO) Overall accuracy index: 0.923522
41. Introduction
About the data and software
Preparing the data
Image Classification
Getting back to OpenStreetMap
Conclusion
Accuracy assesment
Where do OSM and Land Cover differs
Where do OSM and Land Cover differs?
Now that we have a rough idea of the level of agreement between our land cover map
and the OSM layer, it would be useful to see where the differences are.
We can use the Rasterization application to make a raster out of our layer
And then use the BandMath to make a raster of the disagreements between
landcover and OSM
Write the proper expression so that the raster is null or bears the land cover class
if it differs from OSM
42. Introduction
About the data and software
Preparing the data
Image Classification
Getting back to OpenStreetMap
Conclusion
Accuracy assesment
Where do OSM and Land Cover differs
Where do OSM and Land Cover differ? (Solution)
Rasterize our layer
$ otbcli_Rasterization -in all.shp -out all.tif -im im4classif.tif
-mode attribute -mode.attribute.field "class" -background 0
Compute the difference map
$ otbcli_BandMath -il classif_reg.tif all.tif -out errors.tif
-exp "im2b1>0?(im1b1!=im2b1?im1b1:0):0"
Display the difference map in Qgis, and superimpose the original OSM layers. Find
evidence of:
Forest areas that are endangered by urban growth,
Parks and other green areas in residential neighborhood that are not referenced in
OSM,
Water bodies that are not referenced as well.
43. Introduction
About the data and software
Preparing the data
Image Classification
Getting back to OpenStreetMap
Conclusion
Conclusion
Time for a talk
According to what you did in this workshop, do you think OpenStreetMap can be used
for S2 land-cover applications? And vice-versa?
To go further
How well does the trained model generalize to other dates / areas?
Can we add new classes for a more detailed map?
Can we set-up automatic alerts on some features (e.g. forest polygons that do
not seem to contain a lot of forest) ?
44. Introduction
About the data and software
Preparing the data
Image Classification
Getting back to OpenStreetMap
Conclusion
Thank you for attending this workshop! Any questions?