Georeferencing of UAV photos

From AWF-Wiki
(Difference between revisions)
Jump to: navigation, search
(Transformation and Resampling)
(Registration of ground control points (GCP))
 
(92 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 
== Preparation ==  
 
== Preparation ==  
 
# Open Qgis with a new project.
 
# Open Qgis with a new project.
# Install the ''Openlayers'' plugin (if not yet done) {{mitem|text=Plugins --> Manage and Install Plugins --> Install}}.
+
# Prepare main Qgis map viewer:
# Activate the ''Georeferencer GDAL'' plugin (if not yet activated): {{mitem|text=Plugins --> Manage and Install Plugins --> Installl}}. Check the box beside the ''Georeferencer GDAL'' plugin.
+
* Load a vector file with Ground Control Points (GCPs) that were signalized on ground and measured by a high precision differential GNSS receiver : {{typed|text=geodata\uas\gcp_points.shp}}.
# Prepare main Qgis map viewer
+
Note, the Project Coordinate system switches automatically to '''EPSG:32632 (WGS84 / UTM zone 32N)''' which may be checked on the lower right of the QGIS Map Canvas.
* Right click on the upper part of the main Qgis menu. In the {{tool|text=Panel}} check the box beside the {{tool|text=Bowser panel}}. Drag the {{tool|text=Bowser panel}} window on top of the {{tool|text=Layer panel}}. Browse to your ''geodata'' folder where the tutorial data were stored and extracted. Mark ''geodata'' and right click {{button|text=Add as a favourite}}. [[File:browser_panel.png|300px]].
+
* Add an aerial ortho photo map as background layer. Open the Datasource manager [[Image:QGIS_3.0_datasource.png|30px]] and establish a connection to a map server: {{mitem|text=Browser --> XYZ Tiles --> Google Satellite}}.  
* In {{tool|text=Bowser panel}} double click on ''geodata\Goe\thematic\topo_utm32_WGS84.tif'' to load a topographic map 1:25.000. Load Google maps as background layer. {{mitem|text=Web --> OpenLayers Plugin --> Google Maps --> Google Satellite}}. The Project Coordinate system switches automatically to ''EPSG:3857, WGS 84 / Pseudo Mercator'' where {{button|text=Enable 'on the fly' CRS transformation}} is checked. \\ In the {{tool|text=Layer panel}} drag ''topo_utm32_WGS84'' on top of ''Google Satellite''. Double click on ''topo_utm32_WGS84'' to open {{mitem|text=Layer Properties --> Transparency}} and change ''Global transparency'' to about 70% by moving the slider. {{tool|text=Apply}}.
+
* Make sure that the GCP vector file is on top of ''Google Satellite'' in the {{tool|text=Layers panel}} by dragging and dropping the file.
* Load a raw UAV photo. In {{tool|text=Bowser panel}} double click on ''geodata\Goe\thematic\DJI00857.JPG''. The {{tool|text=Coordinate Reference System Selector}} opens. The UAV photo is a raw image file in JPEG fornmat which does not contain information on a spatial reference system. Just press {{button|text=ESC}} to load the image. {{mitem|text=Project Project --> Properties}} and check {{button|text=Enable 'on the fly' CRS transformation}} off. Mark ''DJI00857'' in the Layer panel and right click {{button|text=Zoom to Layer}}. In {{tool|text=Layer panel}} double click on ''DJI00857'' to change the band assignement in {{mitem|text=Layer properties --> Style}} to Red band = Band1, Green Band = Band2 and Blue Band = Band3. The raw UAV image is now shown as a true color composite. Striking are the distortions caused by the ultra-wide (fisheye) lens of the UAV camera. [[File:browser_panel.png]
+
* Right click on the vector layer name in the {{tool|text=Layers panel}} and {{mitem|text= Zoom to layer}}.
* Load ''geodata\Goe\thematic\DJI00857_entzerrt.tif'' in the map viewer where lens distortions were removed using calibration coefficients of a camera model. Open ''DJI00857_entzerrt.tif'' in a general image viewer (e.g. MS Windows photo viewer) and rotate the image such that it is correctly oriented to the north direction which facilitates the selection of ground control points. {{mitem|text=Open Project --> Project Properties}} , choose ''EPSG:3857, WGS 84 / Pseudo Mercator'' and check {{button|text=Enable 'on the fly' CRS transformation}} on. Mark ''topo_utm32_WGS84'' in the {{tool|text=Layer panel}}, right click {{button|text=Zoom to Layer}}.
+
* Change the color of the point markers: Right click on Layer name in the {{tool|text=Layers panel}} {{mitem|text= Layer Properties--> Symbology}}
 +
* Show labels of the GCP layer: {{mitem|text= Layer Properties--> Label}}. Switch to {{button|text=Single lable}}. Open the '''Value''' dropdown list and select the attribute "Comment". In sub menu '''Text''' you may change font color and font size.
 +
 
 +
[[File:Qgis_geo_prepare.png|600px]]
  
 
== Registration of ground control points (GCP) ==  
 
== Registration of ground control points (GCP) ==  
* Open the Georeferencer {{mitem|text=Raster –-> Georeferencer -–> Georeferencer}}. Open the rotated UAV photo
+
* Open {{mitem|text=Raster –-> Georeferencer}}.  
''geodata\Goe\thematic\DJI00857_entzerrt.tif''. Define spatial reference system ''(none)'' by pressing {{button|text=ESC}}.
+
* [[Image:QGIS_2.0_addrast.png|20px]] Open a UAV photo that has no spatial reference system (raw image coordinates): {{typed|text=geodata\uas\mavic_ortho_rgb.tif}}.  
* Change the band assignment to RGB = 1,2,3. {{mitem|text=Settings --> Raster Properties --> Style}}. {{button|text=OK}}.
+
* In the Georeferencer window open {{mitem|text=Settings --> Configure Georeferencer}}. Check the box beside '''Show IDs'''. Choose Residual Units: '''Use map units if possible'''.  
* {{mitem|text=Georeferencer --> Settings --> Configure Georeferencer}}. Check the box beside 'Show IDS' of the ground control points.
+
* Add ground control points: First, navigate to a ground control point in the UAV image (e.g. cross signal). Zoom in with the magnifying glass or use the mouse roller.
* Add ground control pointsFirst, navigate to a ground control point in the UAV image (e.g. drain cover). Zoom in with the magnifying glass or use the mouse roller.
+
* Zoom in to a point which you can recognize on both the UAV photo and on Google maps in the main Qgis viewer.
* Zoom in to a point which you can recognize on both the UAV photo and on Google maps in the main Qgis viewer. In the {{tool|text=Layer panel}} switch ''topo_utm32_WGS84'' on and off. Attention: if the zoom factor is too large Google maps is not displayed in the correct position of the main viewer.
+
 
* Click on Add point on toolbar.     
 
* Click on Add point on toolbar.     
 
[[File:georef_menu.png]].
 
[[File:georef_menu.png]].
 
+
A cross shows up. Move the cursor to the first ground control point (cross signal).
A cross shows up. Move the cursor to the first ground control point (e.g. a drain cover or corner of a building). Zoom in and mark the GCP with the cursor and register the position in the image by a left click. A new window ''Enter map coordinates'' opens. Click {{button|text=From map canvas}}. The Georeferencer window will now minimize automatically.
+
{{info|message=Panning without leaving the activated gcp registration | text= Just press the spacebar!}}
* Click on the same point in Google maps in the main viewer. The coordinates of the main viewer are now transferred directly to the "Enter map cordinates" window. {{button|text=OK}}.
+
Zoom in using the mouse roller, mark the cross center with the cursor, register the position in the image by a left click. A new window ''Enter map coordinates'' opens. Click {{button|text=From map canvas}}. The Georeferencer window will now minimize automatically.
Zoom to the next control point, activate add point and continue until at least 10 GCPs are registered.  
+
* Pan and zoom to the same point in Google maps in the main viewer. Left click on the point: the coordinates in the Coordinate Reference System of the main viewer are now transferred directly to the "Enter map coordinates" window. {{button|text=OK}}.
* For changing the position of a point that is already defined activate {{button|text=Move GCP point}}. [[File:move_gcp.png]]. Move the point by clicking on it in the Georeferencer viewer.
+
[[File:Qgis_geo_addp.png|1000px]]
* For deleting a GCP activate {{button|text=Move GCP point}} [[File:delete_gcp.png]] and click on it. Alternatively click on a point in the ''GCP table'', right click {{button|text=delete}}.
+
* Zoom to the next control point, activate {{button|text=Add point}} and continue until 5 GCPs (S01, S02, S03, S04, S06) are registered.  
 +
* For changing the position of a point that is already defined activate {{button|text=Move point}}. [[File:move_gcp.png]]. Move the point by a permanent left click.
 +
* For deleting a GCP activate {{button|text=Delete point}} [[File:delete_gcp.png]] and click on the point. Alternatively click on a point in the ''GCP table'', right click {{button|text=Remove}}.
 
* Save the registered GCP points. {{mitem|text=File --> Save GCP points as ...}}. {{button|text=Save}}.
 
* Save the registered GCP points. {{mitem|text=File --> Save GCP points as ...}}. {{button|text=Save}}.
  
 
== Transformation and Resampling ==
 
== Transformation and Resampling ==
* Define the transformation settings. Click on [[File:transform_settings_button.png]]
+
* Define the transformation settings. Click on [[File:transform_settings_button.png]] and determine the following settings:  
and determine the following settings.
+
[[File:transform_settings.png]]
+
  
The Target SRS should be the same as the GCP coordinates registered from Google maps: ''EPSG: 3857, WGS84/ Pseudo Mercator''. First, try the transformation type ''Linear''. The horizontal ''Residuals'' are now displayed in the last column of the GCP table. In the first column of the table individual points can be switch on or off. Check if the mean error (root mean square error) shown in the grey bar at the bottom of the window can be improved.
+
[[File:Qgis_geo_transform.png|800px]]
* SChange the transformation type to ''Thin Plate Spline''. Click on {{button|text=Play}} [[File:play.png]] to create the final georeferenced image file that is loaded into the main Qgis viewer. Compare the results of the two tranformation types.
+
 
* The SRS ''EPSG: 3857, WGS84/ Pseudo Mercator'' does not allow to calculate correct metric distances and areas. Therefore, the georeferenced image needs to be transformed to UTM. 
+
The Target SRS should be the same as the GCP coordinates and the project CRS: '''EPSG: 32632, WGS84/ UTM Zone 32N'''. First, try the transformation type ''Linear''. The horizontal ''Residuals'' are now displayed in the last column of the GCP table. In the first column of the table individual points can be switch on or off. Check if the mean error (root mean square error) shown in the grey bar at the bottom of the window can be improved. Change the transformation type to ''Helmert''.
{{mitem|test=Raster --> Projections --> Warp (Reproject)}}. Determine the following settings: [[File:warp_settings.png]].
+
* Click on {{button|text=Play}} [[File:play.png]] to create the final georeferenced image file that is loaded into the main Qgis viewer. Compare the results of different transformation types (e.g. Helmert and Thin Plate Spline)
  
 
== Quality Check ==
 
== Quality Check ==
 
+
* Double click on the reprojected layer to open {{mitem|text=Layer Properties --> Transparency}} and change ''Global Opacity'' to about 60% by moving the slider {{button|text=Apply}}. Install the ''Map Swipe tool'' Plugin. This is a tool to make a layer or a group as a curtain above all layers of the map view. It helps checking the geometric quality. 
 
+
* Compare the geometry of the reprojected layer with Google maps.
 +
* Compare the results of two transformation types ''Helmert'' and ''Thin Plate Spline''.
  
  
  
 
[[Category:QGIS Tutorial]]
 
[[Category:QGIS Tutorial]]

Latest revision as of 22:23, 6 November 2021

Contents

[edit] Preparation

  1. Open Qgis with a new project.
  2. Prepare main Qgis map viewer:
  • Load a vector file with Ground Control Points (GCPs) that were signalized on ground and measured by a high precision differential GNSS receiver : geodata\uas\gcp_points.shp.

Note, the Project Coordinate system switches automatically to EPSG:32632 (WGS84 / UTM zone 32N) which may be checked on the lower right of the QGIS Map Canvas.

  • Add an aerial ortho photo map as background layer. Open the Datasource manager QGIS 3.0 datasource.png and establish a connection to a map server: Browser --> XYZ Tiles --> Google Satellite.
  • Make sure that the GCP vector file is on top of Google Satellite in the Layers panel by dragging and dropping the file.
  • Right click on the vector layer name in the Layers panel and Zoom to layer.
  • Change the color of the point markers: Right click on Layer name in the Layers panel Layer Properties--> Symbology
  • Show labels of the GCP layer: Layer Properties--> Label. Switch to Single lable. Open the Value dropdown list and select the attribute "Comment". In sub menu Text you may change font color and font size.

Qgis geo prepare.png

[edit] Registration of ground control points (GCP)

  • Open Raster –-> Georeferencer.
  • QGIS 2.0 addrast.png Open a UAV photo that has no spatial reference system (raw image coordinates): geodata\uas\mavic_ortho_rgb.tif.
  • In the Georeferencer window open Settings --> Configure Georeferencer. Check the box beside Show IDs. Choose Residual Units: Use map units if possible.
  • Add ground control points: First, navigate to a ground control point in the UAV image (e.g. cross signal). Zoom in with the magnifying glass or use the mouse roller.
  • Zoom in to a point which you can recognize on both the UAV photo and on Google maps in the main Qgis viewer.
  • Click on Add point on toolbar.

Georef menu.png. A cross shows up. Move the cursor to the first ground control point (cross signal).

info.png Panning without leaving the activated gcp registration
Just press the spacebar!

Zoom in using the mouse roller, mark the cross center with the cursor, register the position in the image by a left click. A new window Enter map coordinates opens. Click From map canvas. The Georeferencer window will now minimize automatically.

  • Pan and zoom to the same point in Google maps in the main viewer. Left click on the point: the coordinates in the Coordinate Reference System of the main viewer are now transferred directly to the "Enter map coordinates" window. OK.

Qgis geo addp.png

  • Zoom to the next control point, activate Add point and continue until 5 GCPs (S01, S02, S03, S04, S06) are registered.
  • For changing the position of a point that is already defined activate Move point. Move gcp.png. Move the point by a permanent left click.
  • For deleting a GCP activate Delete point Delete gcp.png and click on the point. Alternatively click on a point in the GCP table, right click Remove.
  • Save the registered GCP points. File --> Save GCP points as .... Save.

[edit] Transformation and Resampling

  • Define the transformation settings. Click on Transform settings button.png and determine the following settings:

Qgis geo transform.png

The Target SRS should be the same as the GCP coordinates and the project CRS: EPSG: 32632, WGS84/ UTM Zone 32N. First, try the transformation type Linear. The horizontal Residuals are now displayed in the last column of the GCP table. In the first column of the table individual points can be switch on or off. Check if the mean error (root mean square error) shown in the grey bar at the bottom of the window can be improved. Change the transformation type to Helmert.

  • Click on Play Play.png to create the final georeferenced image file that is loaded into the main Qgis viewer. Compare the results of different transformation types (e.g. Helmert and Thin Plate Spline)

[edit] Quality Check

  • Double click on the reprojected layer to open Layer Properties --> Transparency and change Global Opacity to about 60% by moving the slider Apply. Install the Map Swipe tool Plugin. This is a tool to make a layer or a group as a curtain above all layers of the map view. It helps checking the geometric quality.
  • Compare the geometry of the reprojected layer with Google maps.
  • Compare the results of two transformation types Helmert and Thin Plate Spline.
Personal tools
Namespaces

Variants
Actions
Navigation
Development
Toolbox
Print/export