Monday, April 24, 2017

Assignment 9: Mission Planning with C3P

Introduction

The purpose of this assignment was to learn about proper mission planning when it pertains to flying a UAV. To do this, C3P Mission Planning Software was used which ensures a safe and effective UAV flight plan. Throughout this assignment, all of the proper steps to planning any UAV mission will be discussed as well as potential issues and solutions to using the C3P Mission Planning software.

Methods

Mission Planning Essentials

The first step in planning any UAV mission is to examine the study site. By looking at maps, 3D models, or, better yet, physically going to the site, the pilot can make note of any potential hazards such as power lines, radio towers, buildings, terrain, and crowds of people. It is also important to note whether there will be wireless data available or not. If not, then the pilot will need to cache the data obtained from the flight. Once observation has taken place and potential hazards/obstacles are noted, the pilot can now start to plan the mission. Using any geospatial data available and drawing out multiple potential mission plans (using C3P Mission Planner in this case) is best practice. Then, checking that the weather is suitable for flying a UAV and ensuring that all required equipment is fully charged and ready to go are the last steps required before the pilot is well prepared for the mission.

Once the pilot is ready to depart, a final weather and equipment check should be done. If the forecast appears suitable for a UAV flight and all of the necessary equipment is packed, the pilot is prepared to head out to the site.

At the site, before the pilot is ready takeoff a few final steps should be completed; the first being site weather. The pilot should document the wind speed and direction, temperature, and dew point of the study site. From there, the pilot should assess the field's vegetation; terrain; potential electromagnetic interference (EMI) from power lines, underground metals/cables, power stations, etc; and launch site elevation. Lastly, the units the team will be working in should be established and standard throughout the project thereafter, the mission/s should be reevaluated given any unforeseen characteristics of the site, the network connectivity should be confirmed, and all field observations should be documented in the pre-flight check and flight log.

Once all of these steps have been completed, the pilot is ready to fly.

Using the C3P Mission Planning Software

The first step to create a mission plan in C3P is to relocate the "home", "takeoff", "rally", and "land" locations to the study site on the map. Next, the user will draw a flight path using the draw tool. Depending on the individual site, the user can draw the path by point, line, or area. The tool also has a measurement option for precise flight path drawing. Once the user has drawn the flight path, the mission settings are adjusted. The mission settings include altitude, UAV speed, frontal and side overlap, ground sampling distance (GSD), overshoot, and camera type (figure 1).

Figure 1: Mission plan settings.
It is important to note that the recommended frontal overlap for any UAS flight capturing geographic imagery should be upwards of 70 percent and the recommended side overlap should be upwards of 60 percent. However the altitude (either relative or absolute), speed, GSD, overshoot, and camera type are all relative to the individual project. Relative altitude refers to the altitude above the surface and is recommended when flying sites that have large changes in surface elevation (ie. the Bramer Test Field or Mt. Simon). Absolute altitude refers to the altitude above the launch point. If absolute altitude is selected, the UAV will fly at the exact same height for the duration of the flight. Speed refers to the actual distance traveled over time by the UAV during the flight. The GSD refers to the image resolution and is automatically adjusted according to the other settings. The default GSD value is usually left alone. Overshoot refers to the turn around distance outside of the flight area. This setting is adjusted based on the type of UAV, the speed at which it's flying, the wind speed/direction, and to ensure proper amounts of overlap are being achieved in the flight area. Lastly, the user has the option to choose their type of camera that will be used in the actual flight. This also adjusts the GSD settings.
Figure 2: More about the mission settings from the C3P help bar. 
Potential Issues When Mission Planning

After the user has drawn their flight area and has adjusted the settings, it is important to look at the map view and the 3D View to ensure the most effective flight path orientation is being used and that there aren't any obstructions in the flight path.

Figures 3 and 4 show two different orientations of the same flight path. The orientation is relative to each flight, but these images help to show the orientation of any flight plan can be adjusted. To do so, the boarder with the desired direction of flight is selected (the yellow boarder in figures 3 and 4).
Figure 3: Vertical Orientation
Figure 4: Horizontal Orientation
Figures 5 and 6 show a potential issue associated with choosing the absolute altitude function in the mission settings. In Figure 5, the red-orange areas on the right side of the flight represent obstructions in the flight plan, in this case a mountain side. This issue is more visible in figure 6, which shows the 3D view of the flight. The red mask applied to the surface represents the flight area and the orange lines represent the UAV flight path. The obstruction area from figure 5 is the same as the red area on the mountain side in figure 6. The mountain side obstructs the flight path and would crash the UAV if flown with these settings. This is why it is important to check that there are no obstructions in the flight path before verifying it. 
Figure 5: Map view showing a problematic mission plan using absolute altitude.
Figure 6: 3D view of the same mission plan.

Figures 7 and 8 show a corrected version of the flight path in figures 5 and 6, by using relative altitude instead of absolute. Notice how there are no red-orange areas demonstrating obstructions to the flight path in figure 7.
Figure 7: Map view showing acceptable mission plan using relative altitude.
Figure 8: 3D view showing same mission plan.

 Another thing to look out for is altitude itself. When the user is ensuring that the flight is within FAA flight zone regulations and/or using absolute altitude, the flight height might require adjustments. In figures 9 and 10, the flights cover the same area. Notice in figure 9, the flight is obstructed by the hill in the far right corner and is set to and absolute altitude of 200 meters. In figure 10, however, the flight has no obstructions and was raised to an absolute altitude of 350 meters. 
Figure 9: 3D view of flight path set to 200 meters.
Figure 10: 3D view of flight path set to 350 meters.

Mission Planning Examples

Now that the user is comfortable with the software, two missions are created. One of which covers a road in Slovenia near the C3P default Baramor Test Field, and the other covers Mt. Simon and the Chippewa river in Eau Claire, Wisconsin. 

The first mission planned (figures 11 and 12) covers about 8 kilometers of a road in south west Slovenia. This path was drawn using the streets (line) draw tool and the home, takeoff, rally, and land points were all placed at the same end to ensure minimal travel distance from take off to landing. The relative altitude was set to 200 meters. 
Figure 11: Map view of road flight.
Figure 12: 3D View of road flight.

A second mission (figures 13, 14, 15, and 16) was created and covers roughly 581,000 square meters of the Chippewa river and surrounding bluffs in Eau Claire, WI. This path was drawn with the area draw tool and relative altitude was set to 300 meters. 
Figure 13: Mt. Simon mission settings.
Figure 14: Map view of mission plan.
Figure 15: 3D view of mission plan.
Figure 16: Close up of flight path obstruction in 3D view.

Although the mission altitude was set to be relative, there was an obstruction in the flight path (shown in figure 16) as well as no altitude variance throughout the mission plan (shown in figure 15). There are also no red-orange obstruction indicators in the map view. This is obviously problematic and could potentially mislead a user into thinking the mission plan would work when in actuality, it wouldn't. Again, it is important to verify the flight path in 3D viewer just in case an error like this occurs.

Discussion

Overall, the C3P Mission Planning software was extremely easy to use and can really help remote pilots in planning missions. I found that the user help guide was very easily navigable and helpful in understanding the software. The ability to set the wind speed and simulate the flight can provide the user a fairly accurate flight time and insight for path adjustments, assuming that other weather characteristics are suitable for flight. Also, having the software connect to ArcGIS Earth was very useful in validating the mission plan and seeing the flight path as you would in the field. I'm not sure, however, why the relative altitude setting was ignored by the software in flight two. It might have something to do with the spatial reference or system of measurement (imperial vs metric), but I really don't know. Another downside to this software is the flashing sensor calibration and upload way-points indicators. They are set up to stop the user from initializing the flight simulator before calibrating the sensor and uploading the waypoints. I found them to be a bit distracting when using the software and would prefer if there was a warning pop-up window, telling the user to ensure that the waypoints are uploaded and the sensor is calibrated.

Monday, April 17, 2017

Assignment 8: Oblique Imagery

Introduction

The objectives of this assignment were to take oblique imagery of 3-D objects, process the images, and engage in annotation which resulted in enhanced 3-D models of the objects. Oblique imagery is obtained by flying a UAV in a circle around the object being photographed usually at an angle so that the camera is pointed at the object. Annotation is manually correcting the images so that Pix4D knows which parts of each image are the 3-D object and which parts are background. Then, in theory, the 3-D model of the object can become a more accurate representation than before. For this assignment, oblique imagery of a shed, a bulldozer, and a pickup truck were processed and annotated.

Methods

The first step for engaging in annotation of oblique imagery was to process the images for each flight. Initial processing is all that is required to annotate the imagery, however one was processed fully to be used for comparison between 3-D models with annotation and without. Once initial processing was complete, the next step was to annotate the imagery. To do this, the rayCloud viewer was turned on and the drop down menus from Cameras>Calibrated Cameras were selected (figure 1).

Figure 1: Camera sidebar from rayCloud viewer window and annotated image of pickup truck.
For each of the objects, five images were annotated; one from each side and one from the highest point above the object in the dataset. The properties box on the right side of figure 1 was where the annotation took place. Figures 2 and 3 show a screen-grab of the properties window before and during annotation.

Figure 2: Before annotation.
Once the image was selected, the annotation icon (highlighted pen in figure 2) was clicked and Pix4D then segmented the image to prepare for it annotation.
Figure 3: During annotation.
In figure 3, masked areas are magenta and these are the areas that were already annotated. Annotation was done by clicking and dragging the mouse around the image until the object of interest was the only thing left  not masked. This was repeated four times at different angles and the second and third processing steps were completed, using the annotation to better enhance the 3-D model generated. 

Results


 The first video shows a "fly with me" animation of the annotated shed imagery.

The second video shows a "fly with me" animation of the annotated bulldozer imagery.


The third video shows a "fly with me" animation of the truck imagery without using annotation.


The fourth video shows a "fly with me" animation of the annotated truck imagery.

Discussion

After the processing and annotating was complete it was clear that annotation wasn't of much help in bettering the quality of the 3D models. This could be for many reasons, one of which being that, with the exception of the shed, the imagery was already about as good as it could be. There is the potential to take better quality imagery in the first place, but for what it's worth, the dataset produced some fairly high quality 3D models even before annotation was brought into the mix. Perhaps annotating more than four to five images per model would enhance the quality as well, for instance, the discolored blob on top of the track shed. When looking at the shed's images, more of them contained open sky than in the other datasets. This means that the dataset could require more annotation in order to ensure that the open sky is not a part of the model and eliminates confusion in Pix4D's 3D model builder. Another noticeable defect, not corrected by annotation, was seen in the truck and bulldozer models. Underneath the pickup truck would most likely be transparent in reality and the wheels of the bulldozer would most likely be opaque in actuality.

Sources:
https://support.pix4d.com/hc/en-us/articles/202560549-How-to-Annotate-Images-in-the-rayCloud#gsc.tab=0

Monday, April 10, 2017

Assignment 7: Calculating Volumes

Introduction

In this assignment, the objective was to learn about calculating volumetric data of stockpiles at the Litchfield mine with Pix4D and ArcMap. Now that processing imagery, using GCPs, and creating DSMs and Orthomosaics are familiar, this lab will expand on that knowledge to produce some extremely useful volumetric data. Calculating volumes of a given object could be extremely useful in mining operations or mineral/ gravel businesses for determining how much product they have in their stockpiles.

In order to perform the analysis, the following tools were used in ArcMap:

Extract by Mask - this tool works much like a clip tool in that the user puts in an input raster and a clip extent, known as the "mask" in this tool's name. The feature mask can be a raster or feature dataset.

Raster to TIN - a tool used to convert raster files to a triangulated irregular network (TIN) dataset. The tool works by taking the original raster file's z-values and creating a triangular representation of the (usually digital elevation model [DEM]) within a certain z-tolerance (allowable difference between z-values of raster and the generated TIN).

Add Surface Information - this tool adds information about a certain raster, TIN, or terrain surface's surface elevation properties (specified by the user) to the attribute table of the input feature class. This tool can add z values, z minimum values, z maximum values, z mean values, surface area, slope length, minimum slope, maximum slope, and average slope.

Surface Volume - a tool used for calculating the area and volume of an area between a surface plane (raster, TIN, or terrain surface) and the reference plane (layer's spatial reference). The user has the option to calculate volumes above or below the reference plane.

Polygon Volume - similar to the surface volume tool, this tool calculates the volume and surface area between a polygon feature class and a terrain or TIN surface. The volumes and surface area calculations extend as far as the dimensions of the polygon go. The user again has the option to calculate volumes above or below the reference plane.

Cut Fill - this tool is used to determine differences in surfaces over time. The tool works by comparing the surfaces of two separate surface datasets (raster, TIN, terrain surface) and then calculating the volumes of difference between the two datasets.

Methods

Once the tools in the previous list were familiar, the calculating volumes process could begin. The first step was to process the imagery of the mine flight. Since the mine imagery had already been processed (and with GCPs) in a previous assignment, that Pix4D file was used. First, the volumes tab for the orthomosaic was opened and the new volume button was chosen. The next step was to digitize around the stockpiles and calculate volumes. In figure 1, the calculated volumes are shown in the windows on the left-hand side of the image. The digitized stockpiles are shown on the right-hand side.
Figure 1: Digitized stockpiles and calculated volumes.
Once this step was completed, the volumes were exported as shapefiles to be used in ArcMap. The next step was to use the newly-created polygon shapefiles and the DSM created from processing in ArcMap. The extract by mask tool was used for each of the three stockpiles, placing the DSM as the input raster and the three stockpile polygons as the feature mask data (figure 2).
Figure 2: Extract by mask step.
 Three clipped stockpile rasters were made and the next step was to calculate the surface volume. This was done using the surface volume tool. An area outside of each stockpile was selected as the reference plane/ surface to compare the stockpile z-values to. Figure 3 shows the tool inputs box. The green dot shows the identity point clicked to get the surface area value (shown in the identity dialog box). This value was entered as the plane height in the surface volume tool.
Figure 3: Surface Volume tool.
This was done for all three of the piles and three respective tables were made, giving the volume of the piles above the height entered for each of the points. Figure 4 shows the output table from the surface volume tool for stockpile 1.
Figure 4: Surface Volume output table.
From there, the raster to tin tool was used for each of the stockpiles. In figure 5, the third stockpile clip was used as the input raster, the output TIN file name and locations was specified, and the rest of the defaults were kept. This tool produced the two colored stockpiles on the left side of the image.
Figure 5: Raster to TIN tool.
Lastly, the Add Surface Information tool was used; placing the newly-created TIN files as the input surface. The original stockpile polygons were used for the input feature classes and also were where the resulting surface information was stored. The Z_MIN and Z_MEAN output properties were selected, but the Z_MIN is the only necessary property for the purpose of this analysis.
Figure 6: Add Surface Information tool.
Results

Two maps were made from the information obtained throughout the analysis and a table containing the volumes of the three stockpiles from each of the methods used to calculate these volumes was created. The first map, figure 7, is one that shows the locations of each stockpile used with the DSM shown underneath.
Figure 7: A map showing the locations of each stockpile used in this analysis.
 The second map, figure 8, shows the TIN outputs of each stockpile. Notice the differences in class elevation values between the piles.
Figure 8: A map showing the TIN elevations of each stockpile used in this analysis.
Figure 9 is a table that compares the three methods used and they're respective volumes.
Figure 9: Volume methods table in meters squared.
Discussion

Looking at the methods, these calculations were fairly easy to execute and the tool interface was quite user-friendly, which means calculating this very useful information could be learned by many and is easily accessible. Having a variety of calculation methods is also useful for applications in which the user might only have access to certain software or extensions within the software (ie. the 3D Analyst extension was used to access the Surface Volume tool in ArcMap). This technology could be extremely useful for mining, shipping, and other similar operations for ensuring accurate stock management or land use. Ensuring that the entire pile, as well as some area outside of the pile, is digitized is crucial to accurate volumetric data. In figure 7, it is clear that some of the area around pile 2 was left out of the shapefile and therefore the calculation. When digitizing in Pix4D, I found it difficult to determine the piles' extents and felt it might have been more accurate if I digitized the piles using the DSM in ArcMap instead. Otherwise it seems that all of the calculations are fairly similar to eachother, however I personally feel that the Surface Volume tool could yield the most accurate results. Because the Surface Volume tool uses a plane height specified by the user combined with a DEM or DSM, the volumes derived from that would be more accurate than just using the shapefile for the calculation extent combined with a raster or TIN, like one would with the Add Surface Information tool. In this assignment the TIN was used for the Add Surface Information and I feel as though that had an impact on the accuracy of the volume calculated, because the TIN file is not a direct representation of the surface, but rather a modified and simplified version. All in all, each tool for calculating volumes has the potential to serve its purpose in the specific parameters of the task and each tool was quite easy to use while also producing useful information.