Talk:Change detection

From AWF-Wiki
(Difference between revisions)
Jump to: navigation, search
(Visualization of bi-temporal Sentinel-2 images (pre-event and post-event))
 
(4 intermediate revisions by one user not shown)
Line 1: Line 1:
 +
* Click {{mitem|text=Files --> Add example}} to load an examplary time series of Landsat and RapidEye images.
  
= Visualization of bi-temporal Sentinel-2 images (pre-event and post-event)=
+
The EO Time Series Viewer requires the following packages:
# Add a subset of a Sentinel-2 multispectral scenes of August 2017 ('''subset_SA2_2017-08-15_MUL.tif''') before the storm events, and May 2018 ('''subset_SA2_2018-05-07_MUL.tif''') after storm events into the QGIS TOC.
+
        pyqtgraph
# Create color composites RGB=9-7-3 [[Changing Raster Layer Style]] of a multiband file.
+
        pyopengl
# Select {{mitem|text=Web --> OpenLayers plugin --> Google Maps  --> Google Satellite}}. If the Plugin doesn't exist you'll first have to install the Openlayers plugin using {{mitem|text=Plugins --> Manage and install plugins}}. A new Layer ''Google Maps'' is loaded. The project CRS is automatically set to WGS84/Pseudo Mercator (EPSG:3857). Drag and drop the Layer to the bottom of the TOC.
+
* Install dependencies:
# Load the map ('''EMSR266_14BADGRUND_01DELINEATION_MAP_v1_300dpi.tif''') showing the storm situation near Bad Grund in the Harz mountains after the winter storm ''Friederike''. Change the Layer Style setting to RGB=1-2-3.
+
** Windows
The map was produced by the [http://emergency.copernicus.eu/mapping/ems/cite-copernicus-ems-mapping-portal European Copernicus EMS Rapid Mapping] activity with the aim to provide an overview of the forest damages based on visual interpretation of very high resolution Pleiades satellite images (pre- and post-event).
+
open the OSGeo4W Shell and type in the console:
# Load the shapefile EMSR266_14BADGRUND_DEL_v1_observed_event_a_EPSG32632.shp which contains delineated areas with loss of tree cover on top of the EMS map '''Bad Grund'''. 
+
        call py3_env.bat
 +
        python3 -m pip install pyqtgraph
 +
        python3 -m pip install pyopengl
 +
 
 +
In case pip is not available in the OSGeo4W Shell, enter
 +
        setup
 +
in the shell, which will start the OSGeo4W installer. Then navigate through
 +
    {{mitem|text=Advanced Installation --> Installation from Internet --> default OSGeo4W root directory --> local temp directory --> direct connection --> Select downloadsite --> http://download.osgeo.ogr
 +
 
 +
Now use the textbox to filter, select and finally install the following package: python-pip
 +
 
 +
 
 +
= Visualization of multi-temporal images =
 +
# Add subsets of 3 Landsat TM multispectral scenes of 1992 ('''SUB_LT4_1992-07-30_MUL.tif'''), 2006 ('''SUB_LT5_2006-06-11_MUL.tif''') and 2010 ('''SUB_LT5_2010-07-08_MUL.tif''') into the QGIS TOC.
 +
# Create color composites RGB=(B5 SWIR-1),(B4 NIR), (B3 Red) following [[Changing Raster Layer Style]] of a multiband file.
  
 
== Globe plugin ==
 
== Globe plugin ==
Line 31: Line 46:
 
This plugin is for interactive plotting of temporal or spectral information stored in multi-band rasters.
 
This plugin is for interactive plotting of temporal or spectral information stored in multi-band rasters.
 
After installation and activation the plugin can be accessed either from main menu {{mitem|text=Plugins --> Profile Tool --> Temporal/Spectral Profile) or from an icon  [[File:Qgis_profile_temp.png]] on the taskbar.
 
After installation and activation the plugin can be accessed either from main menu {{mitem|text=Plugins --> Profile Tool --> Temporal/Spectral Profile) or from an icon  [[File:Qgis_profile_temp.png]] on the taskbar.
* Load a stacked multiband file consisting out of three NDVI images of three different dates into the TOC.
+
* Load the stacked multiband file consisting out of two NDVI images of two different dates into the TOC.
 
* Mark the layer name in the TOC
 
* Mark the layer name in the TOC
 
* Click [[File:Qgis_profile_temp.png]] to open the Temporal/Spectral Profile Tool.
 
* Click [[File:Qgis_profile_temp.png]] to open the Temporal/Spectral Profile Tool.
 
* Click {{mitem|text=Settings}} and change the Plot library to {{button|text=Matplotlib}}
 
* Click {{mitem|text=Settings}} and change the Plot library to {{button|text=Matplotlib}}
 
* Select {{button|text=From string}} as X-axis steps.
 
* Select {{button|text=From string}} as X-axis steps.
* Type in the text field: {{typed|text=1992;2006;2010}}
+
* Type in the text field: {{typed|text=2017;2018}}
 
* Click {{mitem|text=Profile}}. Make sure that the stacked ndvi layer is loaded.
 
* Click {{mitem|text=Profile}}. Make sure that the stacked ndvi layer is loaded.
 
* Click on a location in the canvas.
 
* Click on a location in the canvas.
Line 113: Line 128:
 
# Stack three Landsat multispectral images from three different dates with {{mitem|text=Toolbox --> GDAL/OGR --> [GDAL] Miscellaneous --> Merge}}. See also [[Create stack]].
 
# Stack three Landsat multispectral images from three different dates with {{mitem|text=Toolbox --> GDAL/OGR --> [GDAL] Miscellaneous --> Merge}}. See also [[Create stack]].
 
Perform a [[Principal component analysis]] on the stacked 12 bands of the multitemporal Landsat images. Enter 5 as number of components and visualize them as color comoposite.
 
Perform a [[Principal component analysis]] on the stacked 12 bands of the multitemporal Landsat images. Enter 5 as number of components and visualize them as color comoposite.
[[category:QGIS Tutorial]]
+
 
  
 
=== Joint classification ===
 
=== Joint classification ===
 
The multi-temporal color composite and the principal components of the multitemporal stack can be used as input in to per pixel supervised classification. This approach requires the collection of training data of change and no-change areas.
 
The multi-temporal color composite and the principal components of the multitemporal stack can be used as input in to per pixel supervised classification. This approach requires the collection of training data of change and no-change areas.

Latest revision as of 10:56, 6 January 2020

  • Click Files --> Add example to load an examplary time series of Landsat and RapidEye images.

The EO Time Series Viewer requires the following packages:

       pyqtgraph
       pyopengl
  • Install dependencies:
    • Windows

open the OSGeo4W Shell and type in the console:

       call py3_env.bat
       python3 -m pip install pyqtgraph
       python3 -m pip install pyopengl

In case pip is not available in the OSGeo4W Shell, enter

       setup

in the shell, which will start the OSGeo4W installer. Then navigate through

   {{mitem|text=Advanced Installation --> Installation from Internet --> default OSGeo4W root directory --> local temp directory --> direct connection --> Select downloadsite --> http://download.osgeo.ogr

Now use the textbox to filter, select and finally install the following package: python-pip


Contents

[edit] Visualization of multi-temporal images

  1. Add subsets of 3 Landsat TM multispectral scenes of 1992 (SUB_LT4_1992-07-30_MUL.tif), 2006 (SUB_LT5_2006-06-11_MUL.tif) and 2010 (SUB_LT5_2010-07-08_MUL.tif) into the QGIS TOC.
  2. Create color composites RGB=(B5 SWIR-1),(B4 NIR), (B3 Red) following Changing Raster Layer Style of a multiband file.

[edit] Globe plugin

  • The Globe plugin needs to be installed via the QSGeo4W setup as shown below.

Qgis setup globe.png

  • If the Globe plugin is already installed it just needs to be activated.

Plugins --> Manage and Install Plugins --> Installed. Click the checkbox or doubleclick the name Globe to activate the plugin.

  • Plugins --> Globe --> Launch Globe. The Globe windows opens side by side to the map canvas.
  • In the Globe viewer click on Globe settings Qgis globe settings.png. Switch off the atmosphere rendering by unchecking the box Sky. OK.
  • Adjust the size of the Globe viewer to the same size as the map canvas.
  • In the map canvas zoom in to a region of interest. Adjust the local histogram stretch for all layers in the TOC clicking Qgis cum stretch.png (Raster Tools).
  • In the Globe Viewer click on Layerand check the layers that you would like to see on top of the Globe Viewer. Attention uncheck the layer Google Satellite in the Globe Viewer: otherwise QGIS crashes!
  • Click first on Reload layer Qgis globe reload.png and then Synchronize extent Qgis globe sync.png. The extents of the canvas and the Globe viewer are synchronized as shown below.

Qgis globe view.png

  • In the canvas pan to another location and click Qgis globe sync.png to update the synchronization.

[edit] MapSwipe Tool plugin

This plugin is a map tool for swipe active layer, for example, you can see the difference with other layers below. The active layer, or group, will appear above all others.

  • Select Plugins --> MapSwipe Tool or click Qgis mapswipe.png. If the Plugin doesn't exist you'll first have to install it. Check Plugins --> Mange and Install plugins.. --> Settings Show also experimental plugins.
  • Mark a layer below the top layer in the TOC and hold left click to blend to and compare two layers.
  • Do not mark Google Satellite as active layer, otherwise QGIS crashes!

[edit] Temporal/Spectral Profile plugin

This plugin is for interactive plotting of temporal or spectral information stored in multi-band rasters. After installation and activation the plugin can be accessed either from main menu {{mitem|text=Plugins --> Profile Tool --> Temporal/Spectral Profile) or from an icon Qgis profile temp.png on the taskbar.

  • Load the stacked multiband file consisting out of two NDVI images of two different dates into the TOC.
  • Mark the layer name in the TOC
  • Click Qgis profile temp.png to open the Temporal/Spectral Profile Tool.
  • Click Settings and change the Plot library to Matplotlib
  • Select From string as X-axis steps.
  • Type in the text field: 2017;2018
  • Click Profile. Make sure that the stacked ndvi layer is loaded.
  • Click on a location in the canvas.

Qgis profile tempo.png

[edit] Change detection techniques

[edit] Bitemporal

[edit] Post-classification Comparison

This is an indirect change detection method: First two co-registered satellite images are independently classified to yield thematic maps. Then, discrete class labels of two thematic raster layers are compared to determine changes using cross-tabulation in which all transitions are presented. Use the Semi Automatic Classification plugin: SCP --> Postprocessing --> Land cover change

Qgis scp change matrix.png

[edit] Raster algebra: Difference

  • In the search engine of the Processing Toolbox, type Radiometric and select Radiometric Indices under Feature Extraction of the Orfeo Toolbox.
  • Select the Landsat TM SUB_LT4_1992-07-30_MUL.tif file as input layer.
  • Assign the spectral bands to the right band number as shown below.
  • Choose ndvi from the Available Radiometric Indices drop-down list to calculate the Normalized Difference Vegetation Index (NDVI).
  • Enter name and path for an output file.
  • Click on Run.

Qgis radio ndvi.png

  • Calculate also the NDVI of the Landsat images SUB_LT5_2006-06-11_MUL.tif and SUB_LT5_2010-07-08_MUL.tif.
  • Calculate the difference between the NDVI 2010 and NDVI 2006 using the Raster Calculator.
  • Click Raster --> Raster calculator.
  • A difference NDVI is calaculated by the expression as shown below.
  • Define path and file name of the output layer. OK.

Qgis raster calc diff2.png

  1. Mark the difference NDVI image right click Properties --> Metadata QGIS 2.0 metadata info.png. In the "properties" window scroll down and report mean STATISTICS_MEAN and standdard deviation STATISTICS_STDDEV.
  • Find threshold values for forest change areas: Calculate threshold1 = mean - stddev and

threshold2 = mean + stdev.

  • Layer Properties --> Histogram to plot the difference histogram.
  • Layer Properties --> Style. Change Render type to Singleband Pseudocolor
  • Load min/max values: Activate the radio button Min / max.
  • Choose Accuracy: Actual(Slower) and click Load.
  • Choose Interpolation: Discrete.
  • Select a color table. Color: Spectral. Check Invert.
  • Mode: Equal area. Number of Classes: 3.
  • Type for Value <= :

first line: -0.13 (threshold1)

second line -0.13 (threshold3)

Qgis style diff.png

  • Layer Properties --> Transparency. Click Qgis add tranp.png to add a new line in the pixel transparency list. Type values From: -0.13 and To: -0.13. OK. The specified range of the difference raster is now transparent and can be overlaid on top of Google Satellite and the Landsat composites.

Qgis transp range.png

[edit] Raster algebra: Ratio

  1. Calculate the ratio of raster images 2010 and 2006 with the Raster --> Raster Calculator.
    • Choose ndvi_2010@1 from the Raster bands by double clicking on the raster name.
    • Choose the division operator from the Operators by clicking on /.
    • Choose ndvi_2006@1.tif from the Raster bands by double clicking on the raster name.
    • Save the Output layer as ndvi_ratio and press OK.

[edit] Bi-temporal color composite

  1. Stack three ndvi raster files from three different dates with Toolbox --> GDAL/OGR --> [GDAL] Miscellaneous --> Merge. See also Create stack.
  2. Layer Properties --> Style. Assign two ndvi images to RGB colors.

Qgis cd bitemporal.png Interpretation of colors:

  • Red, cyan: high value in one date and low in the others. Change from one date to the other.
  • Gray levels: indicate features are unchanged.

[edit] Multi-temporal

[edit] Multi-temporal color composite

  1. Stack three ndvi raster files from three different dates with Toolbox --> GDAL/OGR --> [GDAL] Miscellaneous --> Merge. See also Create stack.
  2. Layer Properties --> Style. Assign the three ndvi images to RGB colors.

Qgis cd mutitemporal.png Interpretation of colors:

  • Red, green, blue: high value in one date and low in the others. Change from one date to the other and invariant afterwards
  • Gray levels: indicate features are stable in all dates.
  • Yellow (R+G), cyan (G+B), or magenta (R+B): high values in two dates and low in the other. Change from two dates to the third one.
  1. Use the Spatial/Temporal plugin to plot time series and understand the colors in the multitemporal color composite.

[edit] Principal component analysis

  1. Stack three Landsat multispectral images from three different dates with Toolbox --> GDAL/OGR --> [GDAL] Miscellaneous --> Merge. See also Create stack.

Perform a Principal component analysis on the stacked 12 bands of the multitemporal Landsat images. Enter 5 as number of components and visualize them as color comoposite.


[edit] Joint classification

The multi-temporal color composite and the principal components of the multitemporal stack can be used as input in to per pixel supervised classification. This approach requires the collection of training data of change and no-change areas.

Personal tools
Namespaces

Variants
Actions
Navigation
Development
Toolbox
Print/export