February 14, 2019

Processing Pix4D imagery with GCPs

Introduction: An Overview of GCPs

What are ground control points, how are they used and, what do they accomplish?
            Ground Control Points (GCPs) are features on the ground that are easily distinguishable and have known coordinates. The GCP coordinates, at least in UAS, are usually collected by GPS units. These GPS units record the location of targets placed on the ground, so that when the data is processed, the data set may be adjusted according to the GCPs to become more globally accurate.
Ground control point markers can be marked in a variety of ways however, two of the most common ways of marking them are chevrons and targets. Chevrons are usually spray painted onto the ground with high visibility paint while targets are usually high contrasting black and white tiles that are placed on the ground and anchored in place. Figure 1  shows the two main ground control markings as discussed above.
Figure 1: Chevron and Checkered B&W Markings

How many ground control points should be distributed and how should they be arranged?
            When using ground control points, spread them out over the entire area being captured with an even distribution, with 5 to 10 near the perimeter of the area, and one near the center of the area. Be sure when placing GCPs that they are not so close to the edge of the target area that only a few images can reference them. Each GCP should be able to be visible in at least 5 images to minimize measurement inaccuracies. Figure 2 shows an ideal distribution of GCPs within a given area of interest.
Figure 2: Ideal Distribution of GCPs
(Image used is from Pix4D support page and is linked here.)

            Once the GCPs are laid out, it is very important to take a picture of where the GCP is located relative to its surrounding environment, so that later in post processing, the correct representation of the GCP in Pix4D can be correctly matched to the marking on the ground.

What are some things that affect the quality of GCP data?
            The quality of the GCPs points collected mainly depends on the accuracy and precision of the GPS recording unit and, environmental factors. The difference between the accuracy and precision provided by a phone in a GPS and a survey grade GPS unit is massive, and only the grade GPS surveying unit should be used. In terms of environmental factors that can affect the readings, the main one is due to the atmosphere doppler shifting the frequencies sent out by the satellite that the GPS receiver receives. To minimize this error, it is best to take a measurement as long as possible. This reduces the error, by allowing the survey unit to gather a bunch of readings, and average them to gain a more accurate overall reading of a GCP’s location. In the real world, standing at the location of a GCP for longer than two minutes is impractical, and this is usually sufficient. If one wants the GCP data to be especially accurate, one can invest in a smart GCP tile such as AeroPoints ™ made by a company called Propellor. Products such as this can be set down before the beginning of a flight, can gather accurate location information about its location while the UAV operates and, can be collected and probed for its location information after the flight.

What is the difference between checkpoints and ground control points?
            The difference between checkpoints and ground control points is that checkpoints are not used for processing data, but rather are used to measure error by measuring the difference between the known location of the checkpoint and the location shown in the data.


Methods: A Run Through of Adding GCPs

            The process of adding GCPs is rather simple once mastered. It requires that the user follow the steps in the previous post up through step 10 before following the below steps.

Step 10.1:
            Once steps 1 through 10 have been followed, click on the Project tab at the top of the screen and click on GCP/MTP Manager (see figure 3).
Figure 3: GCP/MTP Manager

Step 10.2:
            Check the GCP Coordinate System area to ensure that the listed coordinates match the coordinate system that the GCP readings were taken in. This information should be located in a metadata file as discussed in the methods section of my ‘Building Maps with UAS Data’ post. If the coordinate systems do not match, click Edit, check the Advanced Coordinate Options and, click on From List to select the correct ones. Figure 4 shows how to edit the GCP coordinate systems, and figure 5 illustrates the Pix4D and metadata file coordinate systems matching.
Figure 4: Editing GCP Coordinate Systems
Figure 5: Coordinate Systems Match

Step 10.3:
            Next, click on Import GCP, then click on Browse, and locate the comma delineated file with the GCPs in it, and click OK (see figure 6.)
Figure 6: Importing GCPs

            *Note: If a warning message pops up alerting that one or more GCPs lie far outside the area covered by the images, click OK, then click on Remove Points, and remove all the GCPs. Next, re-add the file, and change the Coordinates Order using the dropdown list, then click OK. Finally, at the bottom of the GCP/MTP Manager page, click OK then Start the initial processing. Figure 7 shows the error message and figure 8 the order of the coordinates being changed.
Figure 7: Error Message
Figure 8: Changing the Coordinate Order

Step 10.4:
            Once initial processing is complete, rotate the initial results around, and notice how in figure 9, the GCPs appear to be floating over the layer. This may occur, and occurs in DJI products due to the fact that the geoid used is different than the GCPs. In order to confirm which one should be used, compare the GCP heights and layer heights to a known source for cross referencing.
Figure 9: GCP and Layer Mismatch

            In addition to the vertical misalignment, there is a horizontal misalignment between where Pix4D thinks the GCPs are, and where they are on the ground. In order to fix this, click on the first GCP underneath Display Properties within the Layers area.
Find where the marking is on the ground in the image, and click on it. A new window should appear with images that each have a circle with a small cross in the middle (see figure 10).
                 Figure 10: Selecting the First GCP in Display Properties       

            Move the Image Size slider bar to increase the size of the image, and use the mouse scroll wheel to zoom in to where the GCP is marked on the ground, then click on it. Note that since the GCPs shown here are chevron shaped, it is important to know which side the GCP measurement was taken from. In this case it was the inside of the chevron.
***Also note that it is highly recommended to have pictures of the locations of the GCPs so that they can be easily referenced, if for example, multiple ground markings are in one image. This avoids mismatching the Pix4D listed GCP with the wrong GCP marking on the ground. Figure 11 below shows the process of zooming in and matching the supposed location to the actual one on the ground.
Figure 11: GCP Matching Process

            Repeat this step twice to two images per GCP then click Apply, and the other images within this GCP window should be marked by Pix4D. Figure 12 shows the Apply button to add the changes to the other images within the window.
Figure 12: Applying the Corrections

Step 10.5:
            Repeat Step 10.4 with all of the GCPs, then click on the Process tab at the top of the screen, and click on Reoptimize, then click OK when the dialog box appears. Figure 13 below shows the location of the Reoptimize tool.
Figure 13: Reoptimize Tool

Step 10.6:
            Uncheck 1. Initial Processing, check 2. Point Cloud and Mesh and 3. DSM, Orthomosaic and Index, then click Start to finish processing the data. Figure 14 shows 1. Initial Processing unchecked and, 2. Point Cloud and Mesh and 3. DSM, Orthomosaic and Index checked and Start highlighted.
Figure 14: Final Processing


Discussion: GCP Quality Report 

            Once the data processing was complete, the quality report was analyzed. For the sake of this assignment, the main sections focused on were the Georeferencing row of the Quality Check table, and the Ground Control Points table of the Geolocation Details section.

            The Quality Check table is located at the beginning of the quality report. It lists if GCPs were used, the number that were used and, the average root-mean-square (RMS) error in meters for all the GCPs. RMS error is a measure of the difference between the predicted location and the actual location of the GCPs. Figure 15 is an image of the Georeferencing row discussed above.
Figure 15: Georeferencing Row of Quality Check Table




            Notice the yellow triangle with the exclamation point within it? This warning message could be due to two possibilities. The first possibility is that GCPs used and the GCP RMS error is less than the average GCP, but the GCPs might have been marked imprecisely. The second possibility is that no GCPs were used either because none were imported in the first place or, the GCPs were discarded due to errors with them. These errors could be because of a wrong coordinate system, their XYZ versus YXZ order could have been incorrect or, they were not marked correctly on the images. In our case, the error was probably due to imprecisions in the markings.

            *Side Note: There are three main levels of symbols: a green circle with check mark, a yellow triangle with an exclamation point in the center and, a red triangle with exclamation point in it’s center. The green symbol indicates that all the GCPs were used and the RMS error was less than the average GSD, the yellow symbol can indicate the two things as discussed above and, the red symbol indicates GCPs are used but the RMS error is more than 2 times the average GSD, either due to an issue with the data or, the wrong GCP was marked when marking or specifying the GCPs.

            If one scrolls down to the Geolocation Details section, there are several tables and  figures related to the specifics of individual GCPs. These tables include Ground Control Points, Absolute Location Variance and, Relative Geolocation Variance. While the tables listed above can be important depending on the application, the main one that will be touched on is the Ground Control Points table as the other tables provide supplemental statistics.

            The Ground Control Points table, figure 16, lists each GCP’s name/ID, XYZ accuracy, XYZ error, projection error and, whether it was verified/marked. The XYZ accuracy column shows the localization accuracy of each GCP. The X,Y, and Z error columns show the mean error of the GCP in each direction. The verified/marked column is the number manually marked images versus automatically marked ones.
Figure 16: Ground Control Points Table


Results: Creating Maps from the GCP Corrected Pix4D Outputs

            Once the quality report was analyzed, ArcGIS Pro was used to create two maps of the area using the output data from Pix4D. The maps created were one orthomosaic and one DSM of Wolfpaving shown in figures 17 and 18 respectively.
Figure 17: Wolfpaving Orthomosaic Map

Figure 18: Wolfpaving DSM Map

            These Maps turned out very well as the data set was very clean to begin with. There were almost no trees in the image collection to add confusion when creating the DSM, and as a result, the DSM is relatively clean. Using GCPs manipulated the point cloud so that when the color ramp was applied, the minimum and maximum values were brought closer together, as compared to the same area with no GCPs as shown in the assignment called, 'Building Maps with UAS Data'.

            The orthomosaic also turned out pretty well. The only issue spotted was along the right half of the image, where darker areas appeared purple. This is mainly a display issue and may be able to be fixed by manipulating how the blue band is displayed. 


Conclusion: Summary of Assignment
            The assignment above explored adding GCPs to a dataset in Pix4D, why they should be used, how to get the best results when using them and, how to assess the quality of the GCPs using the quality report.
            The using GCPs is important because they increase the dataset’s global accuracy allowing differences in the datasets over time to be analyzed. If no GCPs are used, each dataset will be slightly shifted from the next making comparing the datasets very difficult.

https://youtu.be/ds8VIg52MmE