Tutorial 02 - Georegistration

Lab 2: Georegistration of UAV Imagery

The purpose of this lab is to have an interactive experience with the image stitching process using Pix4Dmapper software. Google Earth will also be used to visualize the imagery in the context in which it was originally acquired. This lab will encourage the student to be critical of the properties and quality of the resulting imagery, and to relate them to the concepts discussed in lecture.

1. Get Familiar with Lab Material

a. Prior to coming to lab, please download the datafiles for this lab onto a USB memory stick. They will require about 90 MB of storage space.

b. Once in class, log onto the local system as directed. For this lab, you will log in with a temporary account not your regular account because the software locks its license to a specific user-machine combination. Change to the E: drive, if available, otherwise work on the C: drive.

c. Extract the files from the memory stick to the local hard drive -- do not copy the zip file as storage space will be limited for this lab. You should find kml files showing the flight plan (FlightPlan 2014-04-17 15.21.32) and actual flight track (FlightTrack 2014-04-17 15.21.32), along with a png file 140418_pt-cld-subset-scrnshot_ah_s06 that conveys the locations where all of the images from the flight were originally acquired. In the png image, the yellow circle indicates the 23 image subset that we will be processing in this lab. A CSV file called 140418_geotags-vis-1_ah_s06 contains a record of the GPS positions for each image in this subset. This CSV file will also be required for processing.

d. Start Google Earth, and open both of the kml files to visualize the location of the UAV survey.

What might have caused the differences between the actual flight and the flight plan?

{width="3.09in" height="1.48in"}{width="3.09in" height="1.4773742344706913in"}

Flight Plan (left) Flight Track (right)

e. Check that you have all of the files in the image subset directory.

  • Open the img_subset folder containing the image subset in Windows Explorer.

  • Open the CSV file 140418_geotags-vis-1_ah_s06.csv in either Excel or Notepad.

  • Cross check that all files named in the CSV file are in the images folder.

2. Create a New Project in Pix4Dmapper

a. Start Pix4Dmapper.

b. On the top left menu, click on Project > New Project... 

new_project_h.png{width="2.2007874015748032in" height="1.874015748031496in"}

c. The New Project wizard window opens.

  • Type \<username>_abe495_lab2 (where you replace \<username> with your Purdue career ID, e.g. cherkaue_abe495_lab2).

  • On Create in, click on Browse, and on the Select Project Location pop up window, navigate to select the folder where the project and results will be stored and click on Select Folder. (Note: within the selected folder, a folder with the project name typed on the Name field will be created when completing the wizard and will store all the results.) (be sure to save this in a shallow directory because Pix4Dmapper output filenames can be long)

  • Make sure the new project circle is selected.

  • Click on Next.

{width="4.0in" height="3.6265879265091865in"}

d. On the Select images window:

  • Click on the button Add images. Browse to the img_subset folder and select all of the images within that folder and click Open. All of these images should now be listed in the Select images dialogue box.

  • Click on Next.

{width="4.0in" height="3.6265879265091865in"}

e. The New Project wizard displays the Image Properties window which contains three sections:

  • Image Geolocation

    • Image Coordinate System: section to select the coordinate system on which image geolocation is based

    • Geolocation and Orientation: section to import the coordinates of the images

  • Camera Model: section to select the camera model of the images

  • Images table: table than displays the selected images, as well as for each image its label, position and orientation and if it is enabled or not (an enabled image will be taken into account for processing)

The Coordinate System, camera model, and image tables are automatically populated from the source files.

For the Geolocation and Orientation section, click From file..., the Select geolocation file dialog pops up.

  • Make sure that the File Format: is set to Latitude, Longitude, Altitude

  • For File: Browse to the CSV file 140418_geotags-vis-1_ah_s06

  • Finally click OK.

  • Position and altitude information should be automatically updated in the image table at the bottom of the New Project window.

{width="4.020833333333333in" height="1.625in"}

  • Click Next > to move to the next screen.

The next screen will ask you to Select Output Coordinate System. For this, the default should be set to match the input data (WGS 84 / UTM zone 16N). As long as the output coordinate system matches that, you can move to the next screen by clicking on Next >.

{width="4.0in" height="3.6761909448818897in"}

Now you will be asked to select a Processing Option. For this lab, select "3D Maps", which is for mapping applications where the images were collected in a grid sampling structure with images looking primarily down from the aircraft. Complete the project setup by clicking on Finish.

{width="4.0in" height="3.6761909448818897in"}

  1. Stitch Images in Pix4Dmapper

  2. Wait for the Google Earth image background to display.

  3. Check in the lower right corner that the output coordinate system is set to WGS84 / UTM Zone 16. Map coordinates are displayed in this part of the screen as you move the mouse.

  4. You should see the Processing tab at the bottom of the page, along with progress indicators that highlight you have not yet started.

{width="4.52321741032371in" height="3.4772233158355204in"}

  • For this part of the assignment ensure that 1. Initial project processing is activated, and that 2. Point Cloud and Mesh and 3. DSM, Orthomosaic and Index are deactivated:

{width="5.495823490813648in" height="1.1684273840769903in"}

  • Click on Processing Options.

<!-- -->
- Under the 1. Initial Processing tab, make sure that "Full (Default)" is selected under "Keypoints Image Scale".

{width="4.0in" height="3.3408727034120735in"}

  • Under the 3. DSM, Orthomosaic and Index tab, under the DSM and Orthomosaic section, make sure the settings are as below and then click OK to cl ose the Options window.

{width="4.1093307086614175in" height="3.716334208223972in"}

  • Click on Start. This stage of processing should take about 2-3 minutes.

  • With Step 1. Initial Processing complete, the Quality Report is automatically displayed. A copy of a PDF of this report (along with other files) has automatically been saved in a folder called 1_initial in your project folder.

  • Take a look at the Quality Report.

<!-- -->
- In the Summary section, note the "Average Ground Sampling Distance (GSD)" and the area covered.

  • In the Calibration Details section, in the overlap subsection, look at Figure 4, which shows a diagram of image overlap. How many overlapping images does Pix4Dmapper consider to be of best quality?

  • In the Preview section near the beginning of the report, look at the mosaic and digital elevation model (DEM) previews. Do these look accurate to you? Does mosaic/DEM accuracy change at different locations within the mosaic/DEM?

Close the Quality Report pop up window and return to the Pix4Dmapper user interface. If you are still in the Map View, then click the rayCloud Editor tab to the left of the page to view the point cloud. You will now be viewing the sparse 3D point cloud model of the terrain and camera positions shown in the figure below.

{width="4.21875656167979in" height="3.2431692913385826in"}

To complete the Point Cloud Densification step:

  • Within the Processing menu, ensure that 2. Point Cloud and Mesh is activated, and that 1. Initial Processing and 3. DSM, Orthomosaic and Index are deactivated.

{width="3.029410542432196in" height="0.8282556867891514in"}

  • Click the Processing Options... button, and under the Point Cloud and Mesh tab, make sure that all "Export" boxes are unchecked (these outputs are not necessary, so unchecking these boxes will speed up processing). Leave all other settings unchanged, then click OK to close the window.

  • Click on Start. This process will take \~5 mins.

While Pix4Dmapper is doing point cloud densification, use the time to explore the rayCloud more thoroughly:

  • Use the zoom button to zoom in on the sparse 3D point cloud. Click the black background in the point cloud view using your left and/or right mouse buttons to scroll and pan to get a good look at the point cloud, the camera positions, and the original images. Note that the blue dots are the original camera positions, and the green dots are the optimized camera positions (more details about camera positions are provided in the quality report).

  • Click a point within the point cloud and observe the "rays" from the camera positions passing through the images and intersecting at the single point in the 3D model. This is a good visualization of the collinearity equation, which is an essential part of the photogrammetric calculations involved in this image stitching and geo-registration process.

  • In the selection box, Pix4D will indicate the number of images in which the point was identified as a tie point (common feature in multiple images). These are illustrated in the rayCloud image using red lines, and appear below the selection window as cropped images with red and green indicators.

  • Other images that correspond to the location but were not identified directly as tie points are marked with green lines and green targets only.

{width="4.5in" height="3.459374453193351in"}

Once Point Cloud Densification is complete, the Quality Report will reopen focused on the addendum with point Cloud Densification details added to the end of the previous report. Review the report before moving to the next step.

From the Layers menu to the left of the Pix4D screen, open the list under "Point Clouds" by clicking on the arrow, then check the box titled Densified Point Cloud. This will cause a new window to open asking if you really want to load the layer. Click OK to agree to load the image.

This will replace the original sparse point cloud image with an image based on the denser surface of points than was originally displayed. You will even start to be able to make out the surface image from the newly placed points. Where is the image cloud densest and the image clearest? Why?

{width="4.5in" height="3.4593755468066494in"}

Note that not every point in the denser point cloud layer will actually have tie points identified. Pix4d has now started to fill in the image between locations where it was automatically able to identify as the same between raw images.

To complete the Pix4Dmapper processing, return to the Processing menu and ensure that 3. DSM, Orthomosaic and Index is activated, and that 1. Initial Processing and 2. Point Cloud and Mesh are deactivated.

  • Click on Start.

  • This process will take 5-10 mins.

  • The DSM, Orthomosaic and Index Details will be appended to the end of the Quality Report and opened automatically when this processing step is completed. Review the Quality Report again before moving to the next step.

Click the Mosaic Editor tab {width="0.285in" height="0.285in"}to the left of the page to view the newly generated image Mosaic and Digital Surface Model (DSM). A DSM is similar to a Digital Elevation Model (DEM) with which you may already be familiar, except that DEMs are processed to identify the land surface elevation and a DSM represents the elevation of what is on the surface. Therefore, building, tree and crop heights are captured in a DSM, while they are processed out of a DEM.

It should take a couple of minutes for it to load the DSM and image Mosaic. Once finished loading, you should be viewing the image Mosaic (which is the stitched photo).

{width="4.197987751531058in" height="3.227202537182852in"}

Look at the DSM by locating the pull down menu above the words "Edit Mosaic" and selecting "DSM" from the drop down list.

Note that both the complete Mosaic and DEM have been automatically saved to a folder called 3_dsm_ortho in your project folder. The orthomosaic should be called \<username>_abe495_lab2_transparent_mosaic_group1 and it will be a TIFF file. The DEM should be called \<username>_abe495_lab2_dsm and it will also be a TIFF file. In the folder containing the mosaic, there should also be a folder called google_tiles and inside that folder you should find a KML file called \<username>_abe495_lab2_mosaic. Open the KML file in Google Earth to see your mosaic overlaid on the map.

{width="4.5in" height="2.9961143919510063in"}

[Submit a word document with answers to all the following questions and submit the final mosaic image (TIFF format) to Blackboard]{.underline}.

1) What is the 3D geographic coordinate system (the datum) being used? What is the map projection being used?

2) Pick any single spot on the mosaic. In this image set there are multiple photos that captured this same spot on the ground (and each photo assigned it some slightly different pixel brightness value). What determines what pixel brightness value actually ends up being inserted on that spot in the mosaic? How would you make this decision? Provide at least 1 well-defined, reasonable decision rule you could follow (you've got multiple pixel values for that spot to choose from, right?)

3) When viewing the mosaic in google earth, you should notice that it is shifted compared to the google earth map (assuming the google earth map is highly geo-accurate, although it is not). If you use the google earth map as the base map for evaluating the georegistration accuracy, then what type of accuracy assessment is it, relative or absolute accuracy assessment? How would you do an absolute accuracy assessment if you had the precise GPS position of the center of the targets in the mosaic?

4) Complete the following analysis by opening the final mosaic image in ArcMap.

{width="6.0in" height="3.120138888888889in"}

Zoom in to the black and white target in the middle of the mosaic (in the red rectangle) so you can clearly see the pixels at the edge between the black and white color.

{width="6.0in" height="3.120138888888889in"}

Below is the picture of the target used in the field. The white spot in the middle of the target is a perfect square shape.

{width="3.59375in" height="3.2716688538932632in"}

Why doesn't the target look like a square in the mosaic anymore?