How to Create Your Own Terrain Surface Model - CodiMD
  300 views
<center> # Drone Mapping:<br>How to Create Your Own Terrain Surface Model *Written by Jose Benitez. Originally published 2020-09-22 on the [Monadical blog](https://monadical.com/blog.html).* </center> --- I first started learning about drones four years ago, at the University of Antioquia (Medellín). My interest soon grew into an obsession, and I spent a lot of my free time building them and flying them around campus, racing friends. Before long I was saving up for one of those cool flying 4k cameras so that I could get a drone’s eye view of things. I love that drones extend our vision of the world and allow us to see, sense and feel the environment at a new level of awesomeness. This hobby evolved into an interest in developing software for autonomous applications and custom drone solutions. With this post, I want to give you an idea of what drone mapping is and why it’s useful, and show how you can have a go at doing some yourself with your own drone. I’ve included the details of one of my flights and some of the results I’ve been able to achieve. <center> <img src="https://docs.monadical.com/uploads/upload_17503ddb2111439e8ed5c7ea5ad459d7.jpg" style="width: 70%; border-radius: 8px; box-shadow: 6px 6px 6px rgba(0,0,0,0.2)" alt="vector-image"> </center> <br> So let’s take off! But first... ## What is drone mapping? Drone mapping is the art of generating a digital model of the surface of an area using images that are taken with drones. These models provide useful information about the land (e.g, distances, areas or volume measurements) and can be used to create various types of plans/schemas used in civil industry, mining, real estate, and law. As well as being great for the environment (no more paper, digital drawings are the future! :deciduous_tree:), drone mapping has lots of advantages over other types of satellite, human, or aircraft inspection. It’s much faster, cheaper, and more precise. It also allows us to track the progress of a project by keeping a record of developments as they happen. ### What do I need to get started? First of all, you need the right drone and the right conditions. Your drone must be able to cover the area that you want to map. Depending on the size of this area and the size of your drone, you might need to do more than one flight. The best conditions for flying are when it’s not too windy, dusty, or cloudy. Check out [UAV forecast](https://www.uavforecast.com/) to get a live weather forecast with information on important variables like wind speed, visibility, cloud cover, and GPS satellite health. Secondly, the drone must be able to perform *missions*, i.e., it has to be able to follow a sequence of waypoints in the air that will serve as a path for taking pictures. Not all drones are capable of performing missions. Missions are planned from a mobile app and the app defines which drones are supported. And finally, the drone must have a camera. To create the surface model, you’re also going to need some software to process the images it takes. :::info **Note:** For this article, I used a DJI Mavic Air drone. Full specs can be found on the [official page](https://www.dji.com/mavic-air). ::: ## Capturing images For this task, the drone must be able to follow a path in the air, while taking overhead photos. These photos are taken at predefined spatial or temporal intervals and can sometimes include images from different angles to improve the accuracy of the model. Photos contain metadata, like [EXIF tags](https://en.wikipedia.org/wiki/Exif), that store the location (GPS coordinates) where the photo was taken -- this will be used to build the model. ### Mission platforms Before you take your drone out, you need to install an app that has drone mapping capabilities. There are also desktop applications for this, but most people find that a mobile app is more practical. Apps for drone mapping allow you to define your flying area and create a mission for your drone. <center> <img src="https://docs.monadical.com/uploads/upload_0f7bd139b906db07769cf5a10f5fb63b.jpeg" style="width: 70%; border-radius: 8px; box-shadow: 6px 6px 6px rgba(0,0,0,0.2)" alt="drone-apps"> </center> <br> I’ve worked with a few different apps in the past and have found that these three work best for my drone: **DroneDeploy:** Easy to operate and takes a good number of images. Usually generates a long path, but is fast to fly. **DroneHarmony:** Easy to operate, has lots of options for area coverage planning, but takes fewer pics than some apps (depending on your settings) and requires more knowledge to run. **DJI Pilot:** Generally works well and takes a good number of images, but uses mapbox (an outdated satellite map) and makes drone speed a little slow. :::info **Note:** Pix4DCapture, MissionPlanner, UgCS for DJI, 3D Survey Pilot and Precision Flight do not support DJI Mavic Air. ::: Once you’ve chosen your app, you’ll need to open a map on it, locate the place you want to model, and draw your area of interest. When you have your area defined, the app’s algorithm will generate a mission for the drone. The mission contains the path that the drone will follow with the points at which it will take pictures of the ground. <center> <img src="https://docs.monadical.com/uploads/upload_611968c5acbc34438abf2a9970959e19.png" style="width: 100%; border-radius: 8px; box-shadow: 6px 6px 6px rgba(0,0,0,0.2);" alt="overlap"> </center> *<small style="float:right;margin-top:5px">From https://support.dronedeploy.com/docs/making-successful-maps</small>* <br> When setting up the mission in the app, you can adjust various parameters. One of the most important settings to consider is *overlap*. This defines how much one picture will overlap with its neighboring pictures, and is essential to the construction of the final image of the site (which is built from these smaller pictures). Having a good amount of overlap will improve the model quality, since it will allow for more detail in the final image. There’s a tradeoff to think about here: a longer mission and more pictures means more memory and more flying time. Height is another important parameter: at lower altitudes you can see more detail, but this will increase the mission length and the number of pictures that need to be taken. When I tested the apps mentioned above (DroneHarmony, DroneDeploy and DJI Pilot), I defined the flying area in roughly the same way each time. Each app created a slightly different mission, since they each use a different algorithm. To improve the quality of the final model, some apps extend the path to create more waypoints, and some generate double orthogonal paths (i.e., another path at a 90º angle). For my flight, I used DroneHarmony and planned the mission in the field, but you can define the area and generate the mission at any time, I did it just before takeoff. <center> <img src="https://docs.monadical.com/uploads/upload_0260e8c71c8a1a0144755d24de544494.jpg" style="width: 100%; border-radius: 8px; box-shadow: 6px 6px 6px rgba(0,0,0,0.2)" alt="mission-paths"> </center> *<small style="float:right;margin-top:5px">DroneHarmony planned (yellow) and traveled (green) paths</small>* <br> ## Processing images After gathering the images, the next step is a process called [*photogrammetry*](https://en.wikipedia.org/wiki/Photogrammetry) to construct the final model of the area. Photogrammetry is performed by software, and involves taking measurements from photos by using trigonometry and the GPS coordinates attached to each image. The resulting model contains information concerning the height of the surface of the terrain and can be used to create contour lines, a point cloud and/or an [orthophoto](https://en.wikipedia.org/wiki/Orthophoto). Before you process your images, you need to have an idea of your desired result. Do you want a digital 3D model, a contour lines image, or an orthophoto? You will input this into your photogrammetry platform (if you don’t specify this up front, the software will churn out every possible result and take much longer to process your images). ### Photogrammetry platforms #### DroneDeploy / Pix4D Both of these photogrammetry platforms are super user-friendly since they have a good graphical interface. All you need to do is load your images and let the software do its job (this takes ~5 hours for ~150 images). After processing, you can preview and download the results from a web browser. Pix4D also has a desktop version. The main disadvantage here is the price for the service (around US$150 per month), although both platforms do include mobile apps for mission planning (which make the workflow so much easier), along with a support center and an account-based management platform for multiple projects. #### OpenDroneMap `ODM` is an open source (yay! :confetti_ball:) photogrammetry tool that you can run yourself using [`Docker`](https://www.docker.com/why-docker) on your computer. If you’re not comfortable using the command line and Docker, `ODM` offers a web interface called [`WebODM`](https://webodm.net/) (around US$29/month or pay-as-you-go), a graphical version of the `ODM` command line interface. To process your images in `ODM`, first create a folder (e.g, `drone_mapping`) where you will keep your projects. Inside `drone_mapping`, create a folder to store your project (e.g., `ProjectName`), and inside `ProjectName`, create a folder called `images`, where you will manually transfer the images gathered by the drone. Now you can enter the following into the command line: ```fish docker run -ti --rm -v /path/to/projects/drone_mapping:/datasets opendronemap/odm --project-path /datasets ProjectName ``` If you want to make the processing faster, you can also include some flags in the command line to let the program know whether or not you want to process a 3D model and/or a surface model. Set these flags according to what result you want, e.g., a 3D model, an orthophoto, a point cloud, etc. Take a look at the [ODM outputs](https://docs.opendronemap.org/outputs.html) and [ODM options and flags](https://docs.opendronemap.org/arguments.html) to learn more. ## Results Here are the resulting models of some of my recent attempts. The first two are from the flight I’ve detailed in this post. I chose to model the area around a friend’s house, close to the top of a hill, since there are lots of nice slopes here. <center> <img src="https://docs.monadical.com/uploads/upload_4ff81f6fcf1cd64faa97c0a7af8969a5.gif" style="width: 100%; border-radius: 8px; box-shadow: 6px 6px 6px rgba(0,0,0,0.2)" alt="hill-gif"> <img src="https://docs.monadical.com/uploads/upload_26b9204cef7d9dcf5eb3f09b29524bc3.png" style="width: 100%; border-radius: 8px; box-shadow: 6px 6px 6px rgba(0,0,0,0.2); margin:12px 0 16px 0" alt="hill-still"> </center> The model below is from part of a highway at the edge of a mountain. You can see that, while the highway has come out well, the trees and the terrain on the right were harder to model (that’s why I’ve picked an angle that shows off more of the highway!). <center> <img src="https://docs.monadical.com/uploads/upload_edfa96dc3c5fb1f52a0baf5c85f9befd.png" style="width: 100%; border-radius: 8px; box-shadow: 6px 6px 6px rgba(0,0,0,0.2)" alt="highway"> </center> <br> The next model shows a roadside area that is under construction. For construction projects like this one, drone mapping can be used to measure distances, calculate soil volume, or simply track the progress of a build. <center> <img src="https://docs.monadical.com/uploads/upload_8411819b145003e9b8112c71ca2cb0b3.png" style="width: 100%; border-radius: 8px; box-shadow: 6px 6px 6px rgba(0,0,0,0.2)" alt="civil-construction"> </center> <br> This last model was done for a friend who wanted to make an architectural sketch of a house. He used the contour lines extracted from this digital surface model (built with ODM). <center> <img src="https://docs.monadical.com/uploads/upload_a746d3f5cb5c134b9e862f5672b9a8f5.jpeg" style="width: 100%; border-radius: 8px; box-shadow: 6px 6px 6px rgba(0,0,0,0.2)" alt="contour-lines"> <img src="https://docs.monadical.com/uploads/upload_9c2223ed6a9110a2584f1ba3e535db68.jpeg" style="width: 100%; border-radius: 8px; box-shadow: 6px 6px 6px rgba(0,0,0,0.2); margin:12px 0 5px 0" alt="house-sketch"> *<small style="float:right;">From Constructo: Arquitectura, Diseño, Construcción</small>* </center> ## Conclusion Drone mapping is no longer a new and exclusive technology. Even though the selection of drones available is still pretty limited (mostly to DJI), there are some great options when it comes to mobile apps and photogrammetry software. So grab a drone, a mission app, some photogrammetry software, and you're all set. Have a good flight and watch out for those trees! :sunglasses: ## Tips * Fly between 10AM and 2PM (less cloud coverage is better, light is very important, shadows downgrade model quality, and wind makes it harder for the drone). * High overlap helps (but weigh this against cost to battery life and processing time). * Repeat the path in an orthogonal direction to improve model accuracy quality. * Avoid any moving objects in the area -- don’t map a construction site with moving vehicles! --- <center> <img src="https://monadical.com/static/logo-black.png" style="height: 80px"/><br/> Monadical.com | Full-Stack Consultancy *We build software that outlasts us* </center>





Back to top



Some other posts: