Tuesday, November 17, 2015

Lab 11- GCP's

Overview:
    In this weeks lab we were introduced again to the software Pix4D, however this week we would use GCP's while using the software to tie down our pictures to create true orthomosaics. Pix4D can process projects with or without GCP's. GCP's make higher global accuracy of the project when processing the images. When adding GCP's, there are several different ways to go about this depending on: if the initial images are geolocated, the coordinate system of the original images, and the coordinate system of the GCP's. I will go into greater depth about these three different methods.
    The first method I want to discuss is used when the image geolocation and the GCP's have a known coordinate system that is already in the Pix4D database. Although they may be in different coordinate systems, the software is able to do a conversion between the two. This is the most common case, and it allows to mark the GCP's on the images with little manual intervention. Since this method does require manual intervention, it is not recommended for overnight processing because you do have to mark the GCP's in the images. This is the method we used in lab 11.
 figure 1
    The second method that can be used is when the initial images are without geolocation, the initial images are geolocate in a local coordinate system, or the GCP's are in a local coordinate system. Once again with this method you have to manually mark the GCP's on the images allowing for better picture clarification. Since it does require a manual step, it is advised not to let this process run overnight since only the first initial processing will be done up to the part of manually marking the GCP's. 
 figure 2
    The third and final method of adding GCP's works for any case, no matter the coordinate system of the images or GCP's but it does require more time to mark the GCP's on the images. After importing the images and GCP's the processing can be done without any intervention by the user. This is the best choice for over night processing. 
figure 3
    The next process of creating a true orthomosaic and dealing with your GCP's is choosing a coordinate system. When creating a new project, the select output coordinate system window is displayed. The output coordinate system does not need to be the same as the images or GCP's coordinate system, however it is recommended that the output coordinate system is the same as the GCP's coordinate system. When choosing a coordinate system the default for images is WGS84. It is easier to display your GCP's on your images when the coordinate systems match, allowing for better accuracy in your pictures. 

Methods:
    Now that you have a basic overview of the different methods of adding GCP's and choosing a proper coordinate system for your images, I will now talk about the processing that we did in this lab. There was two parts to this lab and creating images, one with GCP's and one without GCP's. I will first talk about the part of adding GCP's and manually tying them down to your images along with the quality reports associated with them. 
    The very first thing that I needed to do was create a new project in Pix4D. This allowed me to save my project into my folder so I could easily access the reports and images. I now needed to add the images that I wanted to use. We used 342 images from the flight mission over the south middle school pond and surrounding area. The camera we used was the Canon Power Show SX260, with a default coordinate system of WGS84. Like I talked about earlier, this is the default coordinate system that is in the camera, however we want to change it. Since we are looking at a relatively small area we want to use the North American Datum (NAD83) Zone 15 North. This singles the area out to a coordinate system that fits the Wisconsin area very well. After I added the images and changed to coordinate system I was ready to go on through to adding the GCP's. This part was tricky at first because there were a few steps I had to jump through but was able to accomplish the task of adding the GCP's. In figure 4 on the right hand side menu in the lower portion you can see 5 small boxes. I check the GCP box then right clicked on it and went into the GCP/ manual tie point manager. 
 figure 4
The new window that opened allowed me to import our GCP's that we took while in the field for the area of interest. One small change when importing the GCP's was that I had to change he 'coordinates order' box to Y,X,Z. I then was able to go into my flight folder and import our six GCP's from the mission flight. This showed exactly where my GCP's were located on the Pix4D window. (figure 5)
 figure 5
After having imported all my images and the GCP's, I was now ready to run the initial processing. On the lower bar in figure 5 you can see three boxes, while one of them is the initial processing box. I had to uncheck the other two boxes so only the initial processing would run. Then I was ready to hit start located just below that. The initial processing took close to 45 minutes to run, and also gave us a quality report. The quality report (figure 6) basically gives an overview of the project after the intial processing was run. It gives all kinds of information about the area covered, images, flight path, and importantly about the GCP's and their errors. 
figure 6

After I looked over the quality report, and the initial processing was completed, I was ready to go back into the GCP/ manual tie manager under the GCP box on the lower right hand side. With the new window popped up I then clicked on the rayCloud Editor button in the lower left. This now brought me to another window that had all my GCP's referenced in it. I was able to go in and manually adjust exactly where the center was on every GCP. The more images I did the more the software adjusted to putting my cursor closer to the center of the GCP each time. A safe number of times to adjust each GCP was around 10. I went a little wild with a few getting into the 20 times adjustment range, but this just lead to better accuracy of my tie points. After I was happy with the number of adjustments with my GCp's I clicked okay which brought me back to the map view screen. I checked box two: point cloud and mesh, and box three: DSM, orthomosaic and index boxes in the lower tab. I was now ready to finish running my project. Again after each step was completed it would give me another quality report, this time though it would include GCP information such as errors and locations. (figure 7,8)
 figure 7

 
figure 8

    When I was finished running the last two boxes, my final orthomosaic came through. (figure 9) The final orthomosaic showed all the GCP's on it as well as the flight path along with the exact tie points to each image. At first it came across as being very jumbled but that was just because all the lines showing the tie points. Once I unchecked the tie point box and had the triangle mesh created, it was easy to see exactly what I was looking at. 
figure 9
In figure 9 you can see exactly the area that we planned to have made into an orthomosaic. The triangle area with the pond in the middle has the GCP's on the path along the outside. You can faintly see some of them. You can also see our cars parked in the lower right hand corner of the image as well, with the first GCP just in front of them. After completing the orthomosaic and the GCP processing, along with looking over the quality reports, I wanted to create a flight animation of the orthomosaic to give it justice of exactly the area we are looking at. Figure 10 shows the flight animation. 


 figure 10

    After completing everything with this orthomosaic and GCP's, it was now time to continue on with the lab and create another orthomosaic. This orthomosaic was of the same area, but this time I didn't use any GCP's when creating it. The reason I didn't use any of the GCP's was to see just how off the images and flight path is without having the GCP's to tie the images down. One way to see if there is any GCP's was by looking at the quality report on the first page under 'Quality check' 'georeferencing'. This will tell you exactly if you have nay GCP's in your orthomosaic. (figure 11)
 figure 11
You can see that it says that it is georeferenced, but does not contain any GCP's. This is one of many ways to tell if you have GCP's in your orthomosaic. Also, since I did not contain GCP's in the ortho, the flight path is way off and doesn't follow our area that we wanted to take pictures off. It has it going way out to the west. This is because we did not use GCP's. The GCP's allows for those images from the flight path to be pulled back into the designated area of interest. (figure 12)
 figure 12

    The only reason we ran two different orthomosaics was to see exactly how much GCP's can contribute to the accuracy of the ortho image. After completing this lab I realize that it is vital almost always to use GCP's when conducting flight mission. This allows for better accuracy along with making sure your showing exactly the area you want. Without Pix4D we wouldn't be able to show the difference between the two orthoimages, as they appear very similiar, but with a quality report, Pix4D, and the flight mission, I can see why it is vital to use GCP's. Now we have used Pix4d twice in lab and still have only covered the basics with it, GCP's and creating orthomosaics and using the measurement tools. There is still lots to learn from this software as it can shed light onto stuff that we never thought imaginable. 




Tuesday, November 10, 2015

Lab #10- Construction of a point cloud data set, true orthomosaic, and digital surface model using Pix4D software

Overview:
    Lab 10 was the introduction to the Pix4d software and some of the features it has to offer. Pix4D is an image processing software that is based on finding thousands of common points between images. Pix4D uses key points to create a 3D image. Key points are points on two images that overlap and align. With a high overlap in pictures, the more key points Pix4D will find, which leads to a more accurate 3D image. The recommended overlap for quality 3D images is at least 75% frontal and 60% side overlap.  Now this overlap is recommended for most cases, however small changes should be made when looking at other types of terrain. For instance when taking images of an agriculture field it would be smart to have a higher overlap due to the fact that much of the field is generally similar which makes it harder for Pix4D to find key points. When processing images of large uniform areas (water, sand, snow, fields) it is important to always use a high overlap and have the exposure settings set properly to gain as much contrast as possible. By following these quick tips it will allow for a better 3D image.
    Pix4D can also process images from multiple flights. When designing your flight plans however, you need to make sure that the plan captures the images with enough overlap, along with enough overlap between the two flight plans. Also, it is smart to try to take the images from the two different flight plans under the same conditions. This will lead to better quality images. You don't want to take images one day one a clear sunny day, then the next flight you gather your images from is cold, cloudy, and raining. This wouldn't lead to good contrast between your images and you would see the difference.
    One topic that always comes up with when dealing with mapping is GCP's (ground control points). Pix4D does not require GCP's  for processing, but they do significantly increase the absolute accuracy of the project. In projects with geolocated images, GCP's do increase the accuracy along with placing the model at the exact position on the earth. Basically it would be smart to use GCP's whenever possible especially for projects that need high quality reports.
    The final product I want to talk about when using Pix4D is your quality report. The quality report tells you about all the information that was put into the processing information of Pix4D. The report will tell the GCP's, how many images were taken and used, the coordinate system, and adding check points, along with many other features. A quality report will allow you to break down the information that was put into Pix4D to see if you can gain better optimization for your images.

Methods:
    Since this was our first time using Pix4D, the process of computing the information to create our orthomosaics at first seemed to be out of this world. I was very confused but as the process went on I gained a grasp on how Pix4D worked and the ways to use it.
    To begin we needed to create a new project in Pix4D. This was very simple and created it just like any other project. We went to project in the upper tab and went to create new project. This would allow us to save our projects into our lab folder for the class. Now we were ready to add our images. One thing to note however that all our images added just fine when we used the Sony SX260 camera. They were all geolocated already with orientation, meaning that all the images had the tie points already.
Figure 1
We were asked to create two different mosaics however, one with the Sony SX260 images and another with the Gems images. The Gems images however were more difficult to work with as they weren't geolocated. We had to go in and geolocate them with the export file-RGB from the Gems imagery folder.
Figure 2
After geolocating,219 out of the 220 images were properly geolocated. Although one was not located, it is still alright since there is so many images that we are dealing with. Now if we were just using say 15 images and one or two were missing, we would then have a problem. 
    We then went through a few pop-up screens talking about what projection we wanted and if we wanted it in meters or feet, we left these all at the default and proceed to the map. Our next screen would look like this:
Figure 3
Before continuing, under the layers box on the right hand side of the screen we turned on the GCP's and both of the processing areas. We can now click on the start box on the lower portion of the screen. Depending on how fast your computer is, how many images your processing, and the image quality, it could take from a couple minutes to compute all the data or several hours. It is all contingent. Upon the slow and painful process of waiting for the Pix4D to compute your images, you will eventually end up with an image. 
Figure 4
Now the image above looks scrambled and not very pleasing to the eye. All the big green dots are were the images were taken throughout the flight plan, while the blue dots are the geolocated points since this was taken with the SX260 camera. To be able to make this image make sense you need to locate the 'Triangle Meshes' box on the left side display. Once you click on this it will compute for a few minutes and a magical image will appear that will make sense for you. 
Figure 5
Now you can see an orthomosaic image that makes sense. I turned off the cameras box on the left hand side so the green and blue dots disappeared. Upon creating this image we were asked to do four more things for this lab. We needed to find the surface area of an object, volume of an object, measure the length or width of some object, and make a video animation of our image. Three of these functions are located under the measure tab on the upper portion of Pix4D, while the video animation is located right next to the measure icon. Upon creating the measurements we needed I could then export them individually and save them as a shapefile to allow me to bring them into ArcMap to create maps. Video animation was a little tricky at first, but the dialogue box that pops up when you click on the video animation button allows you to follow step by step instructions to create a video of your choosing. 
Video 1
With the video being the last step that we had to complete in Pix4D, we have now completed what we wanted to accomplish in it. Our next step would to be creating maps in ArcMap showing our shapefiles that we created from the measurements and the differences between the SX260 camera and the position compared to the Gems imagery. 
    I created four maps in Arcmap allowing me to show the difference between the two cameras that we used. When taking the images with the SX260 camera, the camera had to be have been slightly tilted giving us an image at an angle. This didn't show up on our maps we created but I noticed it in Pix4D. The first two maps I created were from the Gems images. I created just a mosaic of the soccer fields then created another one with my measurements on the mosaic. In both my Gems maps and the SX260 maps my measurements were of the same structures. This allowed me to compare the two measurements. Although the angle was slightly different with the SX260, the measurements would remain the same. 

Figure 6

Figure 7

Figure 8

Figure 9
One difference you can see between the Gems images and the SX260 images is of the soccer field area that is pictured. The reason why there is a difference is because we used two different flight paths for either camera. We could have uploaded and used the same flight path if we so choose, but decided to create a new flight path for each camera. Roughly the same area is pictured so it's not a big deal, but if this was to compare images for a multi-million dollar project I would have used the same flight path for both of the cameras giving the exact same area pictured. 
    In the end this software can open the doors to much more than what was performed in this lab. Only a small section was covered on how to make orthomosaic maps and use the measuring and video animation tools. These are just the basics of the computing skills that can be done with the software. With these tools in hand now however and reading through the software manual, the possibilities are endless. From mapping tunnels, to using GCP's, and mapping standing buildings, structures, and interior, all these functions lead to endless possibilities with improving map making and reports for business while opening a vast array of new jobs.