SlideShare une entreprise Scribd logo
1  sur  44
Télécharger pour lire hors ligne
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
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)
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
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)
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
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
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.
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)
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
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
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
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!
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
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
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 ?
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!
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.
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
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
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
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
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.
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
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
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
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 . . .
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
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
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
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)!
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?
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.
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
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)
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?
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)
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.
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
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
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
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
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.
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) ?
Introduction
About the data and software
Preparing the data
Image Classification
Getting back to OpenStreetMap
Conclusion
Thank you for attending this workshop! Any questions?

Contenu connexe

Tendances

Usages of OTB at SERTIT OTB Users meeting and hackfest 2015
Usages of OTB at SERTIT OTB Users meeting and hackfest 2015Usages of OTB at SERTIT OTB Users meeting and hackfest 2015
Usages of OTB at SERTIT OTB Users meeting and hackfest 2015otb
 
Teaching Remote Sensing with OTB Applications & Monterverdi (and a little of ...
Teaching Remote Sensing with OTB Applications & Monterverdi (and a little of ...Teaching Remote Sensing with OTB Applications & Monterverdi (and a little of ...
Teaching Remote Sensing with OTB Applications & Monterverdi (and a little of ...otb
 
Object detection with Tensorflow Api
Object detection with Tensorflow ApiObject detection with Tensorflow Api
Object detection with Tensorflow ApiArwinKhan1
 
Monteverdi - Remote sensing software from educational to operational context
Monteverdi - Remote sensing software from educational to operational context Monteverdi - Remote sensing software from educational to operational context
Monteverdi - Remote sensing software from educational to operational context otb
 
[DL輪読会]Pay Attention to MLPs (gMLP)
[DL輪読会]Pay Attention to MLPs	(gMLP)[DL輪読会]Pay Attention to MLPs	(gMLP)
[DL輪読会]Pay Attention to MLPs (gMLP)Deep Learning JP
 
【DL輪読会】Scaling Laws for Neural Language Models
【DL輪読会】Scaling Laws for Neural Language Models【DL輪読会】Scaling Laws for Neural Language Models
【DL輪読会】Scaling Laws for Neural Language ModelsDeep Learning JP
 

Tendances (7)

Usages of OTB at SERTIT OTB Users meeting and hackfest 2015
Usages of OTB at SERTIT OTB Users meeting and hackfest 2015Usages of OTB at SERTIT OTB Users meeting and hackfest 2015
Usages of OTB at SERTIT OTB Users meeting and hackfest 2015
 
Teaching Remote Sensing with OTB Applications & Monterverdi (and a little of ...
Teaching Remote Sensing with OTB Applications & Monterverdi (and a little of ...Teaching Remote Sensing with OTB Applications & Monterverdi (and a little of ...
Teaching Remote Sensing with OTB Applications & Monterverdi (and a little of ...
 
Object detection with Tensorflow Api
Object detection with Tensorflow ApiObject detection with Tensorflow Api
Object detection with Tensorflow Api
 
Monteverdi - Remote sensing software from educational to operational context
Monteverdi - Remote sensing software from educational to operational context Monteverdi - Remote sensing software from educational to operational context
Monteverdi - Remote sensing software from educational to operational context
 
TensorFlow Object Detection API
TensorFlow Object Detection APITensorFlow Object Detection API
TensorFlow Object Detection API
 
[DL輪読会]Pay Attention to MLPs (gMLP)
[DL輪読会]Pay Attention to MLPs	(gMLP)[DL輪読会]Pay Attention to MLPs	(gMLP)
[DL輪読会]Pay Attention to MLPs (gMLP)
 
【DL輪読会】Scaling Laws for Neural Language Models
【DL輪読会】Scaling Laws for Neural Language Models【DL輪読会】Scaling Laws for Neural Language Models
【DL輪読会】Scaling Laws for Neural Language Models
 

En vedette

Presentation of the Monteverdi application
Presentation of the Monteverdi applicationPresentation of the Monteverdi application
Presentation of the Monteverdi applicationotb
 
Développement des chaînes de traitement d'images GEOSUD
Développement des chaînes de traitement d'images GEOSUDDéveloppement des chaînes de traitement d'images GEOSUD
Développement des chaînes de traitement d'images GEOSUDotb
 
Madagascar2011 - 09 OTB Change detection framework
Madagascar2011 - 09 OTB Change detection frameworkMadagascar2011 - 09 OTB Change detection framework
Madagascar2011 - 09 OTB Change detection frameworkotb
 
Madagascar2011 - 02 - Présentation OTB
Madagascar2011 - 02 - Présentation OTBMadagascar2011 - 02 - Présentation OTB
Madagascar2011 - 02 - Présentation OTBotb
 
Build OTB with the SuperBuild
Build OTB with the SuperBuildBuild OTB with the SuperBuild
Build OTB with the SuperBuildotb
 
0 intro
0 intro0 intro
0 introotb
 
OTB modular architecture
OTB modular architectureOTB modular architecture
OTB modular architectureotb
 
Monitoring tropical forest cover Activities of ONFI in remote sensing
Monitoring tropical forest cover Activities of ONFI in remote sensingMonitoring tropical forest cover Activities of ONFI in remote sensing
Monitoring tropical forest cover Activities of ONFI in remote sensingotb
 
Pragmatic remote sensing handout
Pragmatic remote sensing handoutPragmatic remote sensing handout
Pragmatic remote sensing handoutotb
 
ORFEO ToolBox Project Steering committee
ORFEO ToolBox Project Steering committeeORFEO ToolBox Project Steering committee
ORFEO ToolBox Project Steering committeeotb
 
OTB: logiciel libre de traitement d'images satellites
OTB: logiciel libre de traitement d'images satellitesOTB: logiciel libre de traitement d'images satellites
OTB: logiciel libre de traitement d'images satellitesotb
 
Présentation générale de l'Orfeo ToolBox (12.2014)
Présentation générale de l'Orfeo ToolBox (12.2014)Présentation générale de l'Orfeo ToolBox (12.2014)
Présentation générale de l'Orfeo ToolBox (12.2014)otb
 

En vedette (12)

Presentation of the Monteverdi application
Presentation of the Monteverdi applicationPresentation of the Monteverdi application
Presentation of the Monteverdi application
 
Développement des chaînes de traitement d'images GEOSUD
Développement des chaînes de traitement d'images GEOSUDDéveloppement des chaînes de traitement d'images GEOSUD
Développement des chaînes de traitement d'images GEOSUD
 
Madagascar2011 - 09 OTB Change detection framework
Madagascar2011 - 09 OTB Change detection frameworkMadagascar2011 - 09 OTB Change detection framework
Madagascar2011 - 09 OTB Change detection framework
 
Madagascar2011 - 02 - Présentation OTB
Madagascar2011 - 02 - Présentation OTBMadagascar2011 - 02 - Présentation OTB
Madagascar2011 - 02 - Présentation OTB
 
Build OTB with the SuperBuild
Build OTB with the SuperBuildBuild OTB with the SuperBuild
Build OTB with the SuperBuild
 
0 intro
0 intro0 intro
0 intro
 
OTB modular architecture
OTB modular architectureOTB modular architecture
OTB modular architecture
 
Monitoring tropical forest cover Activities of ONFI in remote sensing
Monitoring tropical forest cover Activities of ONFI in remote sensingMonitoring tropical forest cover Activities of ONFI in remote sensing
Monitoring tropical forest cover Activities of ONFI in remote sensing
 
Pragmatic remote sensing handout
Pragmatic remote sensing handoutPragmatic remote sensing handout
Pragmatic remote sensing handout
 
ORFEO ToolBox Project Steering committee
ORFEO ToolBox Project Steering committeeORFEO ToolBox Project Steering committee
ORFEO ToolBox Project Steering committee
 
OTB: logiciel libre de traitement d'images satellites
OTB: logiciel libre de traitement d'images satellitesOTB: logiciel libre de traitement d'images satellites
OTB: logiciel libre de traitement d'images satellites
 
Présentation générale de l'Orfeo ToolBox (12.2014)
Présentation générale de l'Orfeo ToolBox (12.2014)Présentation générale de l'Orfeo ToolBox (12.2014)
Présentation générale de l'Orfeo ToolBox (12.2014)
 

Similaire à Orfeo ToolBox workshop at FOSS4G Europe 2015

#OSSPARIS19 - Computer Vision framework for GeoSpatial Imagery: RoboSat.pink ...
#OSSPARIS19 - Computer Vision framework for GeoSpatial Imagery: RoboSat.pink ...#OSSPARIS19 - Computer Vision framework for GeoSpatial Imagery: RoboSat.pink ...
#OSSPARIS19 - Computer Vision framework for GeoSpatial Imagery: RoboSat.pink ...Paris Open Source Summit
 
Ijsrdv1 i4049
Ijsrdv1 i4049Ijsrdv1 i4049
Ijsrdv1 i4049ijsrd.com
 
Eclipse Con Europe 2014 How to use DAWN Science Project
Eclipse Con Europe 2014 How to use DAWN Science ProjectEclipse Con Europe 2014 How to use DAWN Science Project
Eclipse Con Europe 2014 How to use DAWN Science ProjectMatthew Gerring
 
OTB-FOSS4G-2010
OTB-FOSS4G-2010OTB-FOSS4G-2010
OTB-FOSS4G-2010otb
 
OpenPOWER Webinar from University of Delaware - Title :OpenMP (offloading) o...
OpenPOWER Webinar from University of Delaware  - Title :OpenMP (offloading) o...OpenPOWER Webinar from University of Delaware  - Title :OpenMP (offloading) o...
OpenPOWER Webinar from University of Delaware - Title :OpenMP (offloading) o...Ganesan Narayanasamy
 
Toolchain for real-time simulations: GSN-MeteoIO-GEOtop
Toolchain for real-time simulations: GSN-MeteoIO-GEOtopToolchain for real-time simulations: GSN-MeteoIO-GEOtop
Toolchain for real-time simulations: GSN-MeteoIO-GEOtopRiccardo Rigon
 
Dynamic viz in the IPython Notebook
Dynamic viz in the IPython NotebookDynamic viz in the IPython Notebook
Dynamic viz in the IPython NotebookBrianna Laugher
 
5.3 Produits & Services en Observation de la Terre au service de la coopérati...
5.3 Produits & Services en Observation de la Terre au service de la coopérati...5.3 Produits & Services en Observation de la Terre au service de la coopérati...
5.3 Produits & Services en Observation de la Terre au service de la coopérati...grisicap
 
150810 ilts workshop_handson_presentation
150810 ilts workshop_handson_presentation150810 ilts workshop_handson_presentation
150810 ilts workshop_handson_presentationTakayuki Nuimura
 
On Implementation of Neuron Network(Back-propagation)
On Implementation of Neuron Network(Back-propagation)On Implementation of Neuron Network(Back-propagation)
On Implementation of Neuron Network(Back-propagation)Yu Liu
 
Scaling Deep Learning Algorithms on Extreme Scale Architectures
Scaling Deep Learning Algorithms on Extreme Scale ArchitecturesScaling Deep Learning Algorithms on Extreme Scale Architectures
Scaling Deep Learning Algorithms on Extreme Scale Architecturesinside-BigData.com
 
Project Matsu: Elastic Clouds for Disaster Relief
Project Matsu: Elastic Clouds for Disaster ReliefProject Matsu: Elastic Clouds for Disaster Relief
Project Matsu: Elastic Clouds for Disaster ReliefRobert Grossman
 
Map Styling Tools and Interactive maps on the web with OpenLayers - Addy Pope...
Map Styling Tools and Interactive maps on the web with OpenLayers - Addy Pope...Map Styling Tools and Interactive maps on the web with OpenLayers - Addy Pope...
Map Styling Tools and Interactive maps on the web with OpenLayers - Addy Pope...JISC GECO
 
Integration for Planet Satellite Imagery
Integration for Planet Satellite ImageryIntegration for Planet Satellite Imagery
Integration for Planet Satellite ImagerySafe Software
 
MapInfo Professional 12.5 and Discover3D 2014 - A brief overview
MapInfo Professional 12.5 and Discover3D 2014 - A brief overviewMapInfo Professional 12.5 and Discover3D 2014 - A brief overview
MapInfo Professional 12.5 and Discover3D 2014 - A brief overviewPrakher Hajela Saxena
 
SFScon21 - Alex Bojeri - Artificial Intelligence Algorithms for Automatic Seg...
SFScon21 - Alex Bojeri - Artificial Intelligence Algorithms for Automatic Seg...SFScon21 - Alex Bojeri - Artificial Intelligence Algorithms for Automatic Seg...
SFScon21 - Alex Bojeri - Artificial Intelligence Algorithms for Automatic Seg...South Tyrol Free Software Conference
 
Understanding OpenRelief
Understanding OpenReliefUnderstanding OpenRelief
Understanding OpenReliefShane Coughlan
 
Deep Learning Applications to Satellite Imagery
Deep Learning Applications to Satellite ImageryDeep Learning Applications to Satellite Imagery
Deep Learning Applications to Satellite Imageryrlewis48
 
Definition and Validation of Scientific Algorithms for the SEOSAT/Ingenio GPP
Definition and Validation of Scientific Algorithms for the SEOSAT/Ingenio GPPDefinition and Validation of Scientific Algorithms for the SEOSAT/Ingenio GPP
Definition and Validation of Scientific Algorithms for the SEOSAT/Ingenio GPPEsri
 
3D localization methods for intracranial electrodes
3D localization methods for intracranial electrodes3D localization methods for intracranial electrodes
3D localization methods for intracranial electrodesBrian Owens
 

Similaire à Orfeo ToolBox workshop at FOSS4G Europe 2015 (20)

#OSSPARIS19 - Computer Vision framework for GeoSpatial Imagery: RoboSat.pink ...
#OSSPARIS19 - Computer Vision framework for GeoSpatial Imagery: RoboSat.pink ...#OSSPARIS19 - Computer Vision framework for GeoSpatial Imagery: RoboSat.pink ...
#OSSPARIS19 - Computer Vision framework for GeoSpatial Imagery: RoboSat.pink ...
 
Ijsrdv1 i4049
Ijsrdv1 i4049Ijsrdv1 i4049
Ijsrdv1 i4049
 
Eclipse Con Europe 2014 How to use DAWN Science Project
Eclipse Con Europe 2014 How to use DAWN Science ProjectEclipse Con Europe 2014 How to use DAWN Science Project
Eclipse Con Europe 2014 How to use DAWN Science Project
 
OTB-FOSS4G-2010
OTB-FOSS4G-2010OTB-FOSS4G-2010
OTB-FOSS4G-2010
 
OpenPOWER Webinar from University of Delaware - Title :OpenMP (offloading) o...
OpenPOWER Webinar from University of Delaware  - Title :OpenMP (offloading) o...OpenPOWER Webinar from University of Delaware  - Title :OpenMP (offloading) o...
OpenPOWER Webinar from University of Delaware - Title :OpenMP (offloading) o...
 
Toolchain for real-time simulations: GSN-MeteoIO-GEOtop
Toolchain for real-time simulations: GSN-MeteoIO-GEOtopToolchain for real-time simulations: GSN-MeteoIO-GEOtop
Toolchain for real-time simulations: GSN-MeteoIO-GEOtop
 
Dynamic viz in the IPython Notebook
Dynamic viz in the IPython NotebookDynamic viz in the IPython Notebook
Dynamic viz in the IPython Notebook
 
5.3 Produits & Services en Observation de la Terre au service de la coopérati...
5.3 Produits & Services en Observation de la Terre au service de la coopérati...5.3 Produits & Services en Observation de la Terre au service de la coopérati...
5.3 Produits & Services en Observation de la Terre au service de la coopérati...
 
150810 ilts workshop_handson_presentation
150810 ilts workshop_handson_presentation150810 ilts workshop_handson_presentation
150810 ilts workshop_handson_presentation
 
On Implementation of Neuron Network(Back-propagation)
On Implementation of Neuron Network(Back-propagation)On Implementation of Neuron Network(Back-propagation)
On Implementation of Neuron Network(Back-propagation)
 
Scaling Deep Learning Algorithms on Extreme Scale Architectures
Scaling Deep Learning Algorithms on Extreme Scale ArchitecturesScaling Deep Learning Algorithms on Extreme Scale Architectures
Scaling Deep Learning Algorithms on Extreme Scale Architectures
 
Project Matsu: Elastic Clouds for Disaster Relief
Project Matsu: Elastic Clouds for Disaster ReliefProject Matsu: Elastic Clouds for Disaster Relief
Project Matsu: Elastic Clouds for Disaster Relief
 
Map Styling Tools and Interactive maps on the web with OpenLayers - Addy Pope...
Map Styling Tools and Interactive maps on the web with OpenLayers - Addy Pope...Map Styling Tools and Interactive maps on the web with OpenLayers - Addy Pope...
Map Styling Tools and Interactive maps on the web with OpenLayers - Addy Pope...
 
Integration for Planet Satellite Imagery
Integration for Planet Satellite ImageryIntegration for Planet Satellite Imagery
Integration for Planet Satellite Imagery
 
MapInfo Professional 12.5 and Discover3D 2014 - A brief overview
MapInfo Professional 12.5 and Discover3D 2014 - A brief overviewMapInfo Professional 12.5 and Discover3D 2014 - A brief overview
MapInfo Professional 12.5 and Discover3D 2014 - A brief overview
 
SFScon21 - Alex Bojeri - Artificial Intelligence Algorithms for Automatic Seg...
SFScon21 - Alex Bojeri - Artificial Intelligence Algorithms for Automatic Seg...SFScon21 - Alex Bojeri - Artificial Intelligence Algorithms for Automatic Seg...
SFScon21 - Alex Bojeri - Artificial Intelligence Algorithms for Automatic Seg...
 
Understanding OpenRelief
Understanding OpenReliefUnderstanding OpenRelief
Understanding OpenRelief
 
Deep Learning Applications to Satellite Imagery
Deep Learning Applications to Satellite ImageryDeep Learning Applications to Satellite Imagery
Deep Learning Applications to Satellite Imagery
 
Definition and Validation of Scientific Algorithms for the SEOSAT/Ingenio GPP
Definition and Validation of Scientific Algorithms for the SEOSAT/Ingenio GPPDefinition and Validation of Scientific Algorithms for the SEOSAT/Ingenio GPP
Definition and Validation of Scientific Algorithms for the SEOSAT/Ingenio GPP
 
3D localization methods for intracranial electrodes
3D localization methods for intracranial electrodes3D localization methods for intracranial electrodes
3D localization methods for intracranial electrodes
 

Plus de otb

Présentation de l'ORFEO ToolBox au FROG2013
Présentation de l'ORFEO ToolBox au FROG2013Présentation de l'ORFEO ToolBox au FROG2013
Présentation de l'ORFEO ToolBox au FROG2013otb
 
Madagascar2011 - 08 - OTB segmentation and classification
Madagascar2011 - 08 - OTB segmentation and classificationMadagascar2011 - 08 - OTB segmentation and classification
Madagascar2011 - 08 - OTB segmentation and classificationotb
 
Madagascar2011 - 07 - OTB radiometry processing
Madagascar2011 - 07 -  OTB radiometry processingMadagascar2011 - 07 -  OTB radiometry processing
Madagascar2011 - 07 - OTB radiometry processingotb
 
Madagascar2011 - 06 - OTB geometry processing
Madagascar2011 - 06 - OTB geometry processingMadagascar2011 - 06 - OTB geometry processing
Madagascar2011 - 06 - OTB geometry processingotb
 
Madagascar2011 - 05 - Monteverdi first steps
Madagascar2011 - 05 - Monteverdi first stepsMadagascar2011 - 05 - Monteverdi first steps
Madagascar2011 - 05 - Monteverdi first stepsotb
 
Madagascar2011 - 04 - Présentation configuration pratical work
Madagascar2011 - 04 - Présentation configuration pratical workMadagascar2011 - 04 - Présentation configuration pratical work
Madagascar2011 - 04 - Présentation configuration pratical workotb
 
Madagascar2011 - 03 - Présentation Monteverdi
Madagascar2011 - 03 - Présentation MonteverdiMadagascar2011 - 03 - Présentation Monteverdi
Madagascar2011 - 03 - Présentation Monteverdiotb
 
Madagascar2011 - 10 - OTB Object Based Image Analysis
Madagascar2011 - 10 -  OTB Object Based Image AnalysisMadagascar2011 - 10 -  OTB Object Based Image Analysis
Madagascar2011 - 10 - OTB Object Based Image Analysisotb
 
AUF 11 - 02 Geometrie
AUF 11 - 02 GeometrieAUF 11 - 02 Geometrie
AUF 11 - 02 Geometrieotb
 
AUF 11 - 03 Radiometrie
AUF 11 - 03 RadiometrieAUF 11 - 03 Radiometrie
AUF 11 - 03 Radiometrieotb
 
AUF 11 - 04 Primitives
AUF 11 - 04 PrimitivesAUF 11 - 04 Primitives
AUF 11 - 04 Primitivesotb
 

Plus de otb (11)

Présentation de l'ORFEO ToolBox au FROG2013
Présentation de l'ORFEO ToolBox au FROG2013Présentation de l'ORFEO ToolBox au FROG2013
Présentation de l'ORFEO ToolBox au FROG2013
 
Madagascar2011 - 08 - OTB segmentation and classification
Madagascar2011 - 08 - OTB segmentation and classificationMadagascar2011 - 08 - OTB segmentation and classification
Madagascar2011 - 08 - OTB segmentation and classification
 
Madagascar2011 - 07 - OTB radiometry processing
Madagascar2011 - 07 -  OTB radiometry processingMadagascar2011 - 07 -  OTB radiometry processing
Madagascar2011 - 07 - OTB radiometry processing
 
Madagascar2011 - 06 - OTB geometry processing
Madagascar2011 - 06 - OTB geometry processingMadagascar2011 - 06 - OTB geometry processing
Madagascar2011 - 06 - OTB geometry processing
 
Madagascar2011 - 05 - Monteverdi first steps
Madagascar2011 - 05 - Monteverdi first stepsMadagascar2011 - 05 - Monteverdi first steps
Madagascar2011 - 05 - Monteverdi first steps
 
Madagascar2011 - 04 - Présentation configuration pratical work
Madagascar2011 - 04 - Présentation configuration pratical workMadagascar2011 - 04 - Présentation configuration pratical work
Madagascar2011 - 04 - Présentation configuration pratical work
 
Madagascar2011 - 03 - Présentation Monteverdi
Madagascar2011 - 03 - Présentation MonteverdiMadagascar2011 - 03 - Présentation Monteverdi
Madagascar2011 - 03 - Présentation Monteverdi
 
Madagascar2011 - 10 - OTB Object Based Image Analysis
Madagascar2011 - 10 -  OTB Object Based Image AnalysisMadagascar2011 - 10 -  OTB Object Based Image Analysis
Madagascar2011 - 10 - OTB Object Based Image Analysis
 
AUF 11 - 02 Geometrie
AUF 11 - 02 GeometrieAUF 11 - 02 Geometrie
AUF 11 - 02 Geometrie
 
AUF 11 - 03 Radiometrie
AUF 11 - 03 RadiometrieAUF 11 - 03 Radiometrie
AUF 11 - 03 Radiometrie
 
AUF 11 - 04 Primitives
AUF 11 - 04 PrimitivesAUF 11 - 04 Primitives
AUF 11 - 04 Primitives
 

Dernier

Implementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureImplementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureDinusha Kumarasiri
 
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...Matt Ray
 
20240415 [Container Plumbing Days] Usernetes Gen2 - Kubernetes in Rootless Do...
20240415 [Container Plumbing Days] Usernetes Gen2 - Kubernetes in Rootless Do...20240415 [Container Plumbing Days] Usernetes Gen2 - Kubernetes in Rootless Do...
20240415 [Container Plumbing Days] Usernetes Gen2 - Kubernetes in Rootless Do...Akihiro Suda
 
Xen Safety Embedded OSS Summit April 2024 v4.pdf
Xen Safety Embedded OSS Summit April 2024 v4.pdfXen Safety Embedded OSS Summit April 2024 v4.pdf
Xen Safety Embedded OSS Summit April 2024 v4.pdfStefano Stabellini
 
Simplifying Microservices & Apps - The art of effortless development - Meetup...
Simplifying Microservices & Apps - The art of effortless development - Meetup...Simplifying Microservices & Apps - The art of effortless development - Meetup...
Simplifying Microservices & Apps - The art of effortless development - Meetup...Rob Geurden
 
Sending Calendar Invites on SES and Calendarsnack.pdf
Sending Calendar Invites on SES and Calendarsnack.pdfSending Calendar Invites on SES and Calendarsnack.pdf
Sending Calendar Invites on SES and Calendarsnack.pdf31events.com
 
VK Business Profile - provides IT solutions and Web Development
VK Business Profile - provides IT solutions and Web DevelopmentVK Business Profile - provides IT solutions and Web Development
VK Business Profile - provides IT solutions and Web Developmentvyaparkranti
 
React Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaReact Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaHanief Utama
 
Comparing Linux OS Image Update Models - EOSS 2024.pdf
Comparing Linux OS Image Update Models - EOSS 2024.pdfComparing Linux OS Image Update Models - EOSS 2024.pdf
Comparing Linux OS Image Update Models - EOSS 2024.pdfDrew Moseley
 
Post Quantum Cryptography – The Impact on Identity
Post Quantum Cryptography – The Impact on IdentityPost Quantum Cryptography – The Impact on Identity
Post Quantum Cryptography – The Impact on Identityteam-WIBU
 
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte GermanySuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte GermanyChristoph Pohl
 
Cloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEECloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEEVICTOR MAESTRE RAMIREZ
 
Machine Learning Software Engineering Patterns and Their Engineering
Machine Learning Software Engineering Patterns and Their EngineeringMachine Learning Software Engineering Patterns and Their Engineering
Machine Learning Software Engineering Patterns and Their EngineeringHironori Washizaki
 
A healthy diet for your Java application Devoxx France.pdf
A healthy diet for your Java application Devoxx France.pdfA healthy diet for your Java application Devoxx France.pdf
A healthy diet for your Java application Devoxx France.pdfMarharyta Nedzelska
 
Powering Real-Time Decisions with Continuous Data Streams
Powering Real-Time Decisions with Continuous Data StreamsPowering Real-Time Decisions with Continuous Data Streams
Powering Real-Time Decisions with Continuous Data StreamsSafe Software
 
Precise and Complete Requirements? An Elusive Goal
Precise and Complete Requirements? An Elusive GoalPrecise and Complete Requirements? An Elusive Goal
Precise and Complete Requirements? An Elusive GoalLionel Briand
 
SensoDat: Simulation-based Sensor Dataset of Self-driving Cars
SensoDat: Simulation-based Sensor Dataset of Self-driving CarsSensoDat: Simulation-based Sensor Dataset of Self-driving Cars
SensoDat: Simulation-based Sensor Dataset of Self-driving CarsChristian Birchler
 
How to submit a standout Adobe Champion Application
How to submit a standout Adobe Champion ApplicationHow to submit a standout Adobe Champion Application
How to submit a standout Adobe Champion ApplicationBradBedford3
 

Dernier (20)

Implementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureImplementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with Azure
 
Hot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort Service
Hot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort ServiceHot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort Service
Hot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort Service
 
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
 
20240415 [Container Plumbing Days] Usernetes Gen2 - Kubernetes in Rootless Do...
20240415 [Container Plumbing Days] Usernetes Gen2 - Kubernetes in Rootless Do...20240415 [Container Plumbing Days] Usernetes Gen2 - Kubernetes in Rootless Do...
20240415 [Container Plumbing Days] Usernetes Gen2 - Kubernetes in Rootless Do...
 
Xen Safety Embedded OSS Summit April 2024 v4.pdf
Xen Safety Embedded OSS Summit April 2024 v4.pdfXen Safety Embedded OSS Summit April 2024 v4.pdf
Xen Safety Embedded OSS Summit April 2024 v4.pdf
 
Simplifying Microservices & Apps - The art of effortless development - Meetup...
Simplifying Microservices & Apps - The art of effortless development - Meetup...Simplifying Microservices & Apps - The art of effortless development - Meetup...
Simplifying Microservices & Apps - The art of effortless development - Meetup...
 
Sending Calendar Invites on SES and Calendarsnack.pdf
Sending Calendar Invites on SES and Calendarsnack.pdfSending Calendar Invites on SES and Calendarsnack.pdf
Sending Calendar Invites on SES and Calendarsnack.pdf
 
VK Business Profile - provides IT solutions and Web Development
VK Business Profile - provides IT solutions and Web DevelopmentVK Business Profile - provides IT solutions and Web Development
VK Business Profile - provides IT solutions and Web Development
 
React Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaReact Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief Utama
 
Comparing Linux OS Image Update Models - EOSS 2024.pdf
Comparing Linux OS Image Update Models - EOSS 2024.pdfComparing Linux OS Image Update Models - EOSS 2024.pdf
Comparing Linux OS Image Update Models - EOSS 2024.pdf
 
Post Quantum Cryptography – The Impact on Identity
Post Quantum Cryptography – The Impact on IdentityPost Quantum Cryptography – The Impact on Identity
Post Quantum Cryptography – The Impact on Identity
 
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte GermanySuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
 
Cloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEECloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEE
 
Machine Learning Software Engineering Patterns and Their Engineering
Machine Learning Software Engineering Patterns and Their EngineeringMachine Learning Software Engineering Patterns and Their Engineering
Machine Learning Software Engineering Patterns and Their Engineering
 
A healthy diet for your Java application Devoxx France.pdf
A healthy diet for your Java application Devoxx France.pdfA healthy diet for your Java application Devoxx France.pdf
A healthy diet for your Java application Devoxx France.pdf
 
Powering Real-Time Decisions with Continuous Data Streams
Powering Real-Time Decisions with Continuous Data StreamsPowering Real-Time Decisions with Continuous Data Streams
Powering Real-Time Decisions with Continuous Data Streams
 
Precise and Complete Requirements? An Elusive Goal
Precise and Complete Requirements? An Elusive GoalPrecise and Complete Requirements? An Elusive Goal
Precise and Complete Requirements? An Elusive Goal
 
SensoDat: Simulation-based Sensor Dataset of Self-driving Cars
SensoDat: Simulation-based Sensor Dataset of Self-driving CarsSensoDat: Simulation-based Sensor Dataset of Self-driving Cars
SensoDat: Simulation-based Sensor Dataset of Self-driving Cars
 
2.pdf Ejercicios de programación competitiva
2.pdf Ejercicios de programación competitiva2.pdf Ejercicios de programación competitiva
2.pdf Ejercicios de programación competitiva
 
How to submit a standout Adobe Champion Application
How to submit a standout Adobe Champion ApplicationHow to submit a standout Adobe Champion Application
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?