Thursday, December 15, 2016

Processing UAV Data

Introduction
This lab is an introduction to using PIX4D to process unmanned areal vehicles (UAV) date. In the lab a few of the functions that Pix4D provides are used to help create a better understanding of the power of Pix4D. This lab will also be treated as a manual that can be referenced in the future on how to create projects, process UAV data, created orthomosaics and digital surface models (DSM). The data for this lab was collected at the Litchfield Mine by Professor Hupy prior to the lab. Before the lab started a couple of question were asked by Dr. Hupy. The questions and the answers are below.

Look at Step 1 (before starting a project). What is the overlap needed for Pix4D to process imagery?
- The proper amount of overlap depends on the terrain type, for the general cases that do not have forests, snow, lakes, agricultural fields, or any other difficult terrain to reconstruct a 75% frontal overlap and a 60% side overlap are recommended. 

What if the user is flying over sand/snow, or uniform fields?
- For rough terrains that contain forest or dense vegetation an 85% frontal overlap and a 70% side overlap are recommended. This also applies to land covered in snow or agricultural fields. Oceans are impossible to reconstruct, rivers and lakes can be reconstructed but require a landmass in every image. 

What is Rapid Check?
- Is a processing method with in Pix4D that focuses on speed over quality. The resolution of the images is reduced which in turn lowers the accuracy and may lead to incomplete results. This method is recommended for in field processing to get a quick check of the data set that was collected.  

Can Pix4D process multiple flights? What does the pilot need to maintain if so?
- Yes Pix4D can process multiple flights. The pilot needs to maintain height for both flights in order for the images to be processed properly.  

Can Pix4D process oblique images? What type of data do you need if so?
- Oblique images are taken with the camera not pointing at nadir. Nadir is the term used when the camera lens is point directly at the ground or object. This means that the camera is perpendicular to the ground. Oblique images are used to reconstruct 3D objects. An orthomosaic is not possible to be constructed because it uses a flat X,Y plane. To use oblique images a orthoplane must be created, which again are used to create 3D images. 

Are GCPs necessary for Pix4D? When are they highly recommended?
- Ground Control Points (GCPs) are optional, however GCPs improve the global accuracy of the project. GCPs are HIGHLY RECOMMENDED when processing images that lack geolocations. If GCPs are not used a few issues will occur;
The final results will not be scaled, oriented or georeferenced. This means that no measurements can be taken, overlays can't be added, and results can't be compared to previous results. 
It possible that the results will produce an inverted 3D model in the rayCloud.
The 3D model will be shifted, this problem can be fixed using Manuel Tie Points.  

What is the quality report?
- A quality report is a summary of how the data will be processed and to what extent it will be processed. It informs the reader how many of the images were calibrated, the difference between initial and optimized internal camera parameters, the median matches per calibrated image, and the georeferencing used. The quality report also provide a preview of what the data will look like when complete. The report gives all the information that is needed to determine whether or not you want to proceed to the actual processing step. This step can take many hours to complete so it is very important to read the report and verify that the quality of the data is acceptable.

Methods
The first step taken in processing UAV data is to start a new project. The steps to do this are listed below.

-Start new porject under the project tap
-Name Project
-Choose Workspace
-Choose data that needs to be processed
-Verify that the correct images were uploaded with the proper coordinate system
-Choose a coordinate system for the final project to be processed in
-Choose the type of project that is being worked on

Once the parameters of the project are set up start the initial processing. This will take a bit of time, especially if it is a large amount of data. When the initial processing is done a quality report will appear. For more information of quality reports refer to the introduction. Figure 1 shows a screen shot of the summary from the quality report for this project. The gives the name of the project, the date and time that it was completed, the camera model, the average ground sampling distance, the area covered, and the time it took for the initial process to run.

Figure 1

(Figure 1 the summary of the quality report for the Litchfield Mine data)


Figure 2 shows the quality check, this is another feature in the quality report. The key things to notice in this section of the report is the green circles on the right side of figure 2. The green circles means that it met the requirements for further processing, the red and yellow triangles are warnings that these areas may not meet the requirements and may have a negative effect on the final product if not fixed. Normally the Camera Optimization should be below 5% however, Dr. Hupy gave the okay to process this data without it meeting the requirements. Due to the fact that this was a demo and quality of data was not the driving fact no ground control points were used. It is also important to note that all 68 of the images were calibrated properly, which will greatly improve the accuracy and quality of the data set. 
Figure 2
(Figure 2: image of the quality check summary form the quality report)

Figure 3 shows the amount of overlap that occurred during the process. The areas in green have very high overlap while the yellow, orange, and red have progressively worse overlap. The lack of overlap on the edges will distort those parts of the image. This is why it is good practice when collecting data with a UAV to collect data around the edges outside of the study area. This will preserve the quality of the actual study area. 

Figure 3
(Figure 3: the amount of overlaping images of the study area.)

Figure 4, which is the final image from the quality report, shows the methods used to create the DSM and Orthomosaic. In this case the Inverse Distance Weighting (IDW) method was used. It also gives the times that it will take for these datasets to be produced, the DSM will take 2 minutes and 24 seconds, while the Orthomosaic will take3 minutes and 34 seconds.

Figure 4
(Figure 4: Summary of the DSM and Orthomosaic)


 The next step is to run the Point Cloud and Mesh and the the DSM, Orthomosaic and Index processes. These processes can take very long depending on the amount of data that is being processed. These will provide the final product that can be used to measure volumetrics, distances, and a million other things. Figure 5 shows the orthomosaic of the Litchfield mine.

Figure 5
(Figure 5: Orthomosaic of the Litchfield Mine)

The detail of this image is so incredible that it is possible to clearly see the trucks that were parked at the site. 

Results
From figure 5 it is easy to measure the volume of objects. In figure 6 is a zoomed in image of a sand pile that was digitized and had the volume collected for it. To find the volume of this sand pile it is necessary to digitized around the object that needs to be measured. The better the digitizing the more accurate the results will be. The little green dots represent each digitized point used. Figure 7 shows the results of the volume measurements. 

Figure 6
(Figure 6: The digitized sand pile that was measured by volume.)

Figure 7
(Figure 7: the results of the volume measurement.)

The area that was measure was 624.68 meters squared with a total volume of 1253.03. The margin of error was 18.29 meters squared. Adding GCPs will greatly help to lower this margin of error in the measurements. 

The polyline feature was used to measure the distance of the front of a truck to the front of another truck. Figure 8 shows the two aforementioned trucks and the line that represents the distance that was measured. 
Figure 8
(Figure 8: Show two trucks and a line that measured the distance from the front of one truck to the front of the other.)


The distance of the line was 5.15 meters. The results table is shown in figure 9
Figure 9
(Figure 9: Measurement results form the polyline function)


One of the more powerful features of the Pix4D is its ability to format in the datasets so they can be used in other processing software. The DSM was transferred to ArcMaps and ArcScene. Here it can manipulated using every function in either of those Esri Programs. Two maps were created of the DSM, the first one is a the DSM that was displayed using Bilinear Interpolation with an inverted Red -Green Dark color scheme. ArcScene is nice because it really allows for the 3D to be noticeable. Figure 10 show the ArcScene 3D image of the DSM. The areas in red represent high elevation and green low elevation. 


Figure 10
(Figure 10: ArcScene 3D model of the Litchfield mine.)

Figure 11 represents the same DSM that was run through the hillshade tool in ArcMaps. The same techniques of Bilinear Interpolation were used in the displaying of this image. Also the same color ramp was used as well in Figure 11 as in Figure 10.
Figure 11
(Figure 11: A hillshade of the DSM created from Pix4D)

The amount of detail on this image is easily visible. In the center of the image tire tracks are visible. It is also easy to see the elevation change that occurs on the sand piles. This elevation change could be used to calculate flow rates of water after it rains.

The final portion of this project was to create a fly-by video of the DSM. A fly-by video is a computer generated video that "flies" around the processed imagery through a path that the user creates. The video created for this lab can be found below in video 1.

Video 1
  

Conclusion
Overall Pix4D is a very user friendly software that makes processing UAV data easy. The tools and functions that were used in this lab are straight forward and easy to comprehend. However, this lab hardly scratched the surface of the capabilities of that Pix4D has. It would be nice to have more time to work with UAV data and get a better understanding of the full capabilities available for this software. 

























Thursday, December 1, 2016

Surveying of Point Features Using Dual Frequency GPS

Introduction
     This lab used survey grade GPS to take elevation points of a small knoll in low campus of the University of Wisconsin - Eau Claire. Survey grade GPS is one of the best ways to gather location data in the field because of the incredible accuracy. Depending on the signal that the GPS unit receives it can be accurate up to the centimeter. The down side to survey grade is the expense of the units. The University only has access to one unit, so the entire class had to take turns using the unit gathering one point at a time. Figure 1 below shows the location of knoll that was surveyed. The area

(Figure 1: A map of lower campus of the University of  Wisconsin - Eau Claire. The small area in red represents the study area that this lab took place and is located in the middle of the campus mall.)

 in the northern part of the study area is flat and the land progressively rises in elevation the further south it goes. There are four benches that stretch west to east through the middle of the study area. For the most part it is a very open area with only a few small trees. This vegetation would not have effected to signal to the GPS unit. Below in figure 1.1 is an photo of the study area. It is easy to see in the photo the drastic change in elevation from a lower elevation in the left (north) side of the photo the right (south) side of the photo.

(Figure 1.1: A photo of the study area take the day after the data was collected. The photo was taken by the author of this blog. The photo is a real world representation of the elevation change that can be used to compare with the interpolation maps that are found later in this blog.)
Methods
     As mentioned briefly above the entire class ventured out to campus mall to gather elevation data points of the study area. Do to technical issues only 20 points were possible to gather the day that the class had access to the survey GPS unit. The random sample method was used to gather the data points. Each student picked a spot of their choosing and after the data point was gathered, they passed if off to the next student. When the data was collected it uploaded in a text format to a desktop computer. The text was converted to an excel file using the Get Data From Text function in excel. The headings were changed to match the respective data and the table was transferred to ArcMaps. The Display as XY data function was to display the data points. The coordinate system that was used was NAD 1983 UTM Zone 15N. The data was then exported to a geodatabase so that it could be edited and interpolated. The same interpolation methods from the Sandbox Survey lab were used in this lab, those being Spline, Inverse Distance Weight (IDW), Kriging, Natural Neighbor, and TIN. The interpolations were cut down to fit the study area by using the raster to mask tool. The data was displayed using the stretched symbology and set to Bilinear Interpolation to help improve the smoothness of the elevation maps.

Results
     The first map that was created was the Spline interpolation. This interpolation uses a mathematical function to estimate the surface by minimizing surface curvature in the hopes of creating a smoother finished product. Figure 2 below shows a depiction of the spline interpolation of the study area. The areas that are red represent areas of higher elevation while the areas in green represent areas of lower elevation. Unfortunately the map is not a very good representation of the actual landscape the areas in the northern part of the study areas should be rather flat with a rather drastic rise in the middle, followed by a drastic decrease in the southern portion of the study area. This pattern holds true for all of the interpolations. The spline interpolation does an excellent job of creating a smooth transition from one elevation to another. This smoothness is most noticeable in the middle of the study area where the patch of high elevation dips down to a lower elevation before rising again to an island of higher elevation. The other interpolation methods, which focus on different aspects of interpolating, lack this smoothness.
(Figure 2: The Spline Interpolation of the study area)

     The second interpolation method is the Inverse Distance Weighted (IDW) Method. The IDW uses a method of interpolation where it takes a sample of values surrounding a cell and gives a higher weight to those values that are closer to that cell in the sample. This done for every cell in the finished raster. The IDW interpolation gave the best results for the study area due to the fact that the highest point isn't to the southern portion of the study area. The highest point is in the center of the map which best reflects the actual landscape. It even gives shows a slightly higher elevation if the middle eastern portion of the map which would represent the knoll. Figure 3 below shows a map of the IDW interpolation.

(Figure 3: The IDW interpolation of the study area)

     The third interpolation is the Kriging which uses the z-scores of the data points to create a surface model. While the Kriging looks very nice and really amplifies the hill shade effect. It did a rather poor job of recreating the study areas landscape. The Kriging method was unable to detect the knoll in the center of the study area. It also amplifies the mistakes that were made in the random sampling of the surface area. Figure 4 below shows a representation of the Kriging interpolation.

(Figure 4: The Kriging Interpolation of the Study Area)

     The fourth interpolation is the Natural Neighbor method. The Natural Neighbor method uses a subset of data points surrounding an area and weights them based on the proportion of surrounding areas. This method is by far the most difficult method to understand. It is unclear why the Natural Neighbor method did not completely fill the study area like the previous three methods. It potentially have been due to lack a sufficient amount of data points to properly interpolate the rest of the study area or an error could have occurred during the interpolation process. However, when examining the area that was interpolated it is easy to see that this method was not a successful as the IDW and Spline methods. It does show a fair representation of the western portion of the knoll but was completely unable to detect the eastern portion of the knoll. It also does a decent job of showing that the southern most portion of the study area has a slightly higher elevation than the northern most portion. Figure 5 below shows a representation of the Natural Neighbor interpolation method.

(Figure 5: The Natural Neighbor Interpolation of the Study Area)

     The final interpolation method is the Triangular Irregular Network, more commonly known as TIN. TINs can be created from feature classes that contain elevation data or from a raster that contains elevation data. The TIN ran into the same problem as the Natural Neighbor method where it was unable to fulling interpolate the study area. The same possibilities for why it failed to completely interpolate that were mentioned for the Natural Neighbor method apply for the TIN as well. The TIN provided a poor representation of the study area. It was completely unable to detect any raised elevation in the eastern portion of the study area. Figure 6 below shows a representation of the TIN interpolation.

(Figure 6: The TIN Interpolation of the Study Area)

Conclusion
     Overall none of the interpolations did a great job of representing the study area. This is mostly contributed to the lack of data points collected in the eastern middle portion of the study area. A few contributing factors to the lack of sufficient data points is first the that due to licencing issues that were outside of the classes control their was a limit to the amount of data that could be collected. This factor could have easily been worked around by choosing a different method other than random sampling. The class was rather unorganized in the collecting of the data points and no one noticed that there were no data points collected on the eastern middle edge of the map. This was area was a very important part of the landscape because it is where the eastern half of the knoll is located.

Sources
     For more information on the different methods of interpolation check out the two links below;
- For Spline, IDW, Kriging, and Natural Neighbor click here.
- For Triangular Irregular Network (TIN) click here.