How-to-?

Planning Photo and Video Missions for UAVs

When wanting to conduct a drone flight or mapping mission over a precise area of interest, one needs to plan the flight and path beforehand. This ensures that the entire area is covered completely and removes any visual errors or barriers that might occur during field work. Further, prefixing flight settings allows for more consistent data collection as compared to manual flights on the go.

We use a combination of two softwares for planning flights.The first among them is FlyLitchi Mission Hub (FMH) and the second is QGIS. The two can also be used in conjunction with one another. The process using both these softwares is described in this blog.

Using FlyLitchi:

FMH is a web app that enables us to plan drone flights from the desktop and later execute them using the android based Litchi app - Litchi for DJI drones which is available for a one time purchase in Google Play Store. 

The FlyLitchi mission hub interface has many flights that are publicly available for viewing on the desktop app as shown in Fig 1. We can also share our flight paths and drone videos to this application.

Fig. 01: FlyLitchi mission hub interface.

Login and Register: 

FMH is a free desktop application. One needs to register in order to create, upload and save the flight missions. To do this, click the ‘Log in’ button on the top right of the interface and create your account.

Set your area of interest:

a. Search for your Area Of Interest (AOI) in the search bar which is at the top left of the interface.

b. Click around the AOI to create way points to set the route of the mission.

Fig. 02: Way Point settings

c. Click around the AOI to create way points to set the route of the mission.

d. This mission can be stored by clicking on the MISSIONS option - bottom left and then clicking Save.

Way Point Settings:

I. Lat-Long: The location of the point is automatically logged as soon as you create a point.

II. Altitude (m): One needs to set the altitude of the drone above ground for all the points. In India, the legal limit as per the Directorate General of Civil Aviation (DGCA) is 120m. 

There is an ‘Above Current’ option under ‘Altitude settings’ available when you are batch editing the way point attributes. The “Above Current” option in FMH allows you to add a specific altitude to the current altitude of selected waypoints. It’s a convenient way to elevate all waypoints by a set distance without adjusting each one separately.

III. Speed (m/s): One can set the speed depending on the purpose of the mission. Max speed is 15m/s.

In a video mission like this, the speed can be set between 10m/s to 15m/s.

Pro tip: If you’re designing a mission to create an orthomosaic, keep the maximum speed below 8m/s to avoid distortion.

IV. Curve (m): If the curve is 0m then the drone will exactly fly to each point and then head to the next. If the purpose of the mission does not necessitate going to the exact location (esp. Turning Points) of the points, the drone will follow a curved path (blue line in Fig: 2) near the point (curve > 0m).

Fig. 03: Curve at the turns 

V. Heading: This is a circular (turn right - turn left) movement of the drone at a point location. It ranges from 0 to 360°. This controls which direction the drone is pointing. It is marked by a triangle-like marker on each way point. 

VI. POI: One can set one or multiple Points of Interest (POI) in FMH. The drone automatically points to the POI if set to do so. Here you can select which POI the drone should focus on if there are multiple POIs.

VII. Gimbal Pitch: This is like the angle defining the up-down movement of the camera. One can choose between 30 to -90°, where -90° points straight down. 

If you have chosen to Focus on a POI, then the drone automatically recalibrates its gimbal pitch to capture the POI throughout its mission. Alternatively, by picking the ‘Interpolate’ option, you can set a constant pitch angle which will be consistently maintained through the mission.

VIII. Intervals and actions: One can add some actions at each waypoint like Start/ Stop recording, Click a picture, Stay/ Hover etc. This option allows to set an action and the duration of the action if applicable.

Fig. 04: Way Point settings and Mission settings.

Mission settings: 

I. Units: One can choose the unit of measurement here.

II. Map Type: One can choose the base map upon which the flight missions appear. 

III. Heading Mode: The direction that the drone faces is set by this.

A. Auto: The drone faces the next way point.

B. Initial: The heading of the first way point is fixed for all.

C. Manual: Heading can be fixed during the flight. 

D. Custom: You can set the heading for each way point in FlyLitchi.

IV. Finish Action: At the end of the automated flight, the drone follows this action. 

A. RTH: Return to home - flies back to the drone launch point.

B. Land: It will land at the end of the mission.

C. Back to Start: The drone returns to the start of the mission.  

D. Reverse: It comes back the same path as the mission. 

V. Path Mode: The curve setting in way point settings is overridden by this path mode. If path mode is set to ‘Straight line’ then the flight path cannot have curved turns. If ‘Curved path’ is selected, one can set the curves at the points. 

VI. Cruising Speed and Max Flight Speed (m/s): The speed can be set here. 

VII. Default Curve Size (%): If path mode = ‘Curved turns’, then the new points that you add to the flight path will have the default curve size % that you specify. Default curve size will not work if the Path mode is set to ‘Straight Lines’.

VIII. Default Gimbal Pitch Mode: Same as way point settings but ‘MISSIONS’ settings override the way point settings.

Note: Mission settings override the way point settings.


Using QGIS to aid flight planning:

The boundary of the video mission can also be created in QGIS: This method is useful when the area of interest may not be obviously distinguishable in a satellite image. For example, if one owns a parcel of land, the boundaries need to be incorporated precisely and cannot be determined accurately through an image.

Here one has two options:

a. Load a boundary file of the AOI that you may already have.

b.  Create a shapefile layer from the Layer menu.

If you already have a shapefile for your area of interest-load it into QGIS and export it as a .kml file. This is because the FMH only processes .kmls and .csvs at present. The process for importing the .kml into FMH is described towards the end of the blog.

If you don’t already have a shapefile, you can create one using the following steps:

a. Go to Layer> create Layer and select New Shapefile Layer

Fig. 05: Creating a shapefile in QGIS.

b. Choose the name, source folder and projection to save your file.

Fig. 06: Creating a line shapefile.

c.  Now right click on the layer and select toggle editing. Then click on the Add line feature. You can now create a feature by digitising this boundary. 

Fig. 07: Digitising a line shapefile.

d. Export this line file to a .kml file. 

e. Import the .kml file to FMH using the ‘import’ option from the MISSIONS tab on the bottom left of the screen. 

Fig. 08: Import kml to FMH

f. Check and edit settings of each way point as mentioned in the previous section. 

Thus FlyLitchi and QGIS can be used to create video missions. The planned flights saved in FMH can then be executed using Litchi for DJI drones android app. The videos from the drone are recorded as .mp4 files.

The next step in our workflow would be processing these videos to sync them with telemetry data. More information on this process can be found on our blog on using Dashware.

The Practical Nuances of Calculating Field of View

In this blog, we explore single-image photogrammetry – which is the extraction of information from a single image – including measurements and creation of 3D models. As we delve into this topic, we are learning a lot about the practical nuances of applying these techniques to solve real-world problems. We are currently working on calculating the real-life size of a Ganges river dolphin from the drone footage we acquired from our fieldwork in Bihar earlier this year. This blog continues from our previous post on measuring object size using a nadir image. While that post covered theoretical formulas, here we focus on the practical application of those formulas.

A single frame extracted from drone footage of a Ganges river dolphin surfacing, with zoomed inset of the same.

To get the real-life size of our dolphin, we would need to know the number of pixels the dolphin is made up of in an extracted frame (the image), along with the size of each pixel in some real-life units (eg: metres, centimetres). We would then multiply the number of pixels with the pixel real-life size to get estimates on area covered, breadth, and length. This real-life size that each pixel corresponds to is known as the Ground Sampling Distance or the GSD. The GSD is an extremely useful metric for any georeferenced image since it represents the distance between two consecutive pixel centres measured on the ground, or the distance a side of a pixel represents.

This exploration is driven by the absence of a reference object of a known size in any of our drone footage acquired during our fieldwork from earlier this year. It's challenging to have a reference object consistently in the frame since the drone moves with the dolphin sightings, which are sporadic and spaced out. If there had been a reference object, we could have used the ratio between the object's pixel count and its known size to establish a scale. This scale would then be used to determine the real-life size of a dolphin based on its pixel count.

Theoretically, measuring the GSD of a nadir image is straightforward. One of the formulas we can use to figure out the GSD is as follows, taken from our aforementioned blog:

GSD = A_L/ I_L

where 

A_L is the real-life length of the area being captured in an image, in metres

I_L is the number of pixels that make up the length of that image

To calculate A_L we can use the following formula:

A_L= 2 * H * tan(FOV_L/ 2)

where

H is the altitude of the drone, in metres

FOV_L is the angular field of view along the length axis of the image


I_L and H are parameters that are easy to calculate. While I_L can be figured out by just examining the number of pixels making up the length of the image, H is a parameter captured by the drone itself as metadata. Finding the FOV_L for our drones though – took quite some time!

This parameter, more generally called the field of view (FOV), is used to calculate the GSD of our drone images using the above formula. We tried to figure out the FOV of our drone cameras by exploring forums and official drone manuals, which inevitably led us to some extremely interesting finds—especially regarding the factors and camera settings that might affect a drone's FOV.

So let’s take a look at what exactly is the FOV, how can we find the FOV for a given drone camera, and what all settings would one have to take into account if they are measuring the FOV on their own.

WHAT IS THE FIELD OF VIEW?

The term field of view refers to the viewable area across a specific axis as seen in an image. It is the amount of area that a particular lens system can capture in an image. The larger the FOV, the more area that can be seen and captured by the camera. Inversely, the smaller the FOV, the less is the area that is being seen. Thus, FOV is directly proportional to the extent or amount of area being captured by a camera.

A graphic showing an aerial drone camera's field of view¹- Luo, Y., & Chen, Y. (2021), CC BY 4.0

This term usually refers to either the actual physical area that is captured (in units such as mm) or the angle at which a lens is capturing that area. In this context, we will be using FOV to refer to the angular extent of the captured image. Thus, it should be assumed to be expressed in degrees for the rest of this blogpost.

For any given image, there are multiple types of FOVs. These FOVs are specific to the axis being considered while measuring the area seen by a lens. By axis here, we are referring to an imaginary line that travels across the diagonal, width, or length of an image. Corresponding to these dimensions, there are three distinct FOVs: FOV_D, FOV_W, and FOV_L, respectively. We will be referring to these collectively as FOVs/ FOV unless specified otherwise.

An diagram showing the angles being captured by the three different FOVs for a given image.

To gain a deeper intuition about this term we can carry out a simple exercise. 

Pull out your mobile phone and open your camera to photo mode. Try to keep your phone fixed in a particular position and observe how the edges of the area being captured in your screen change when you do the following:

  1. Change aspect ratio of picture

  2. Change from photo to video mode

  3. Change from HD to 4K or to some other photo/video quality setting

The above are three images taken by a smartphone in the same position but with different aspect ratios: 9:16, 1:1, 3:4  from left to right, respectively. The vertical and horizontal areas being covered change drastically as we shift from one aspect ratio to another. Thus, all the three FOVs change too when we change between these settings.

FACTORS THAT AFFECT A DRONE’S FIELD OF VIEW

One’s first instinct in figuring out the FOV of their drone would be to simply check the official manual for the mentioned specs. Since we use off-the-shelf drones for our work, understanding any limitations was also crucial. As it turns out, the specs in the official DJI manuals aren’t specific or exhaustive. The official DJI manuals don’t really mention how the FOV changes with different camera settings but rather usually mention a single default FOV. This FOV measurement indicates the diagonal FOV and applies only to the native aspect ratio of that drone’s camera while taking pictures with that drone. 

Consider this scenario. Say you need the FOV for when you are recording a video at 60 fps with a 16:9 aspect ratio at resolution 3840 x 2160. The first thought would be to apply the manual mentioned FOV and proceed. But that would be incorrect as based on the settings you are applying, the FOV also tends to change. Chances are that you won’t be able to simply search online for the FOV for your particular combination of settings or even find it for these specific settings in the manual. Rather, you will have to try and figure it out on your own.

The discussion around how to build an experiment to measure the FOV of a drone at some given settings is best left for another day. For now, let’s take a look at some of the factors that change the FOV of the drone’s camera.

Aspect Ratio

The aspect ratio is the ratio of width of the image to its height. It is typically expressed as two numbers separated by a colon, such as 4:3 or 16:9. Camera sensors, devices inside the camera that capture light to create an image, are manufactured in various shapes and sizes, each having a native aspect ratio. The native aspect ratio is determined by the number of pixels along the width and height of the sensor. When shooting in the sensor's native aspect ratio, the entire sensor area is used, maximising the resolution and image quality.

When we shift from one aspect ratio to another, we will usually notice a change in the extent of the area being captured in the frame. This occurs because the camera either crops the image or resizes it to fit the desired aspect ratio. Cropping involves trimming parts of the image, effectively reducing the number of pixels used from the sensor. For instance, changing from a 3:2 to a 1:1 (square) aspect ratio would mean cutting off parts of the image on the sides. Since the extent of area being captured is changing, the FOVs end up changing too.

Consider these two images captured by the same drone camera with different aspect ratios:

Images taken with a DJI quadcopter showing a change in the field of view when aspect ratio is changed from 3:2 (top) to 16:9 (base). Notice how the upper and lower portions of the top image get cropped in the bottom image.

Zoom Level

This is one of the more obvious factors. The more you zoom in when taking an image, the lesser is the physical area you are capturing in the image. The more zoomed out the frame is, the more is the extent of the area being captured by the camera. As the captured area changes, so does the FOV.

A still from this video shows how an increase in the optical zoom level of a DJI Mavic 3 Pro results in smaller captured areas.

Video Mode

If there are additional modes in which you can record your video, then FOVs for different modes might vary significantly. Even when the resolution and aspect ratio remain the same, a change in the recording mode can alter the FOVs. Take the DJI Mavic 2 Pro as an example. There are two different modes for recording a 4K video: Full FOV mode and the HQ mode. Videos recorded using these modes have the same resolution, 3840 x 2160. However, both of these have different FOVs! 

In the Full FOV mode, the full camera sensor is used, more or less, followed by a downsampling of the video to a 4K resolution. In the HQ mode, however, a cropped portion of the sensor is used to capture video in 4K resolution² directly. This leads to different portions of the camera sensors being used and therefore, different amounts of areas being captured. Thus, their FOVs are different too.

This image taken from this video clearly illustrates the difference between Full FOV mode and HQ mode on the DJI Mavic 2 Pro. Both modes have the same resolution and aspect ratio., but they capture different areas.

Frames per second

Commonly written as fps, it is the measurement of how many individual image frames appear in one second of video. The higher the fps, the more frames there are in a video, and the smoother that video appears.

This was surprising to be honest. One wouldn’t expect the FOV to change with a change in fps. While fps is simply the number of frames recorded in a video, FOV is a completely different concept that just governs the amount of area a camera captures. They are theoretically supposed to be independent of each other. However, for some drones, changing the fps at which you are recording a video changes the FOV.

Take the AIR2S ³ ⁴ for example. Changing the fps while recording a video will change FOVs of the resultant video. The higher the fps the more frames the drone is recording and processing. If recording a high quality video at 4K resolution, then the drone might lack computational power to process all the frames at the same time. As a fix, the drone crops the video to reduce the data/information that the drone is processing. Because the video is cropped, the FOV is also reduced.

The top image shows an image taken by DJI Air2S at 24 fps while the one at the base is at 60 fps by the same drone with the exact same other settings. Notice how the area captured and field of view reduce in the bottom image.

In conclusion, there are many practical nuances that one might overlook when focusing on the theoretical aspects of a problem. Listed in this blogpost are just some of the factors that affect the FOV when working with drones. Building equations to model how all the above factors influence FOVs could be a fascinating challenge. Creating a parametric equation would be a valuable tool for effective estimation of FOVs, but it would require significant effort to collect data across all the setting combinations via multiple field experiments for a number of different drones. Moreover, there would be a minor problem where for every combination of camera settings that one employs- one would need to understand how that setting exactly affects the FOV, which might not be a trivial exercise. Therefore, instead of taking that route, we are only trying to measure the FOVs for the settings which we commonly employ during field work. We have worked on some interesting field work and experiments for this – and look forward to discussing this soon!

REFERENCES

1- Energy-Aware Dynamic 3D placement of Multi-Drone Sensing fleet. Sensors, 21(8), 2622. https://doi.org/10.3390/s21082622 , Luo, Y., & Chen, Y. (2021)

2- DJI Mavic 2 Pro 4K HQ vs Full FOV EXPLAINED + TESTS 

3- DJI Air 2S video crop at high fps? 

4-  Air 2S FOV - 4K 30FPS VS. 4K 60FPS  

And some Helpful Links

Calculating Object Sizes in Drone Images

The author, along with a colleague, is experimenting with drone calibration. Picture by Nancy Alice/ TfW.

Currently, my focus lies in solving the intriguing problem of calculating the size of objects in drone-captured images – a recurring maths problem in our conservation work. In this case it was to be able to estimate the size of a Ganges river dolphin as captured in videos using small quadcopters. Setting this workflow is foundational as solving this problem could help us and other conservationists in a number of areas including, but not limited to, estimating the demographic distribution of animal species, calculating garbage hotspot sizes, sizing up the footprint of an image, tracking an individual animal’s body condition over time, and more.

As it turns out, this problem has already been solved, at least under certain assumptions. There are a couple of ways to calculate the size of an arbitrary object, some of which are elaborated upon in this blogpost.

A First Step

Images are made up of pixels and usually, pixels are small squares. We are going to assume that we have square pixels. Each element or distinct object one can see in an image is made up of pixels. Since we want to measure the real-life size of an object in an image, one way of doing that is to use the number of pixels occupied by that object. If we know how many pixels it occupies along with how many real-life centimetres/metres each pixel corresponds to, then we can calculate:

Area of an Object = Number of Pixels in the Object * Area Occupied by a Pixel in Square Centimetres

⇒ Area of an Object = Number of Pixels in the Object * GSD²


Where GSD (Ground Sampling Distance) is the distance between two consecutive pixel centres measured on the ground or the distance a side of a pixel represents. Here, it is the centimetres the side of a pixel denotes.

This also works under the assumption that all pixels are of the same size, and additionally denote the same real-life centimetres. Our formula won’t work if different pixels capture different amounts of distances on the ground, say, if one pixel captures 1 cm while another captures 10 cm of the ground.

Thus, our immediate problem becomes to find the GSD. Counting the pixels making up an object can be done rather trivially.

Diagram showing how to calculate the area occupied by an object of interest in an image.

The following is the description of the problem statement. 

There is an image, I, which has been taken from a drone, UAV, flying at a height, H. The dimensions of this image are I_W, I_L, and, I_D, corresponding respectively to the width, length, diagonal dimension of the image as measured in pixels. Additionally, the actual real-life area being captured has the following corresponding dimensions: A_W, A_L, and, A_D, measured in metres (m).

The dimensions (in pixels) of an image I, as captured by our drone’s camera.

The real-life area captured by our drone’s camera. Different dimensions of the area have been marked.

A nadir image is one which is taken with the drone camera pointing straight down at the ground. This image has been taken in a nadir position.

Diagram of our drone capturing a nadir image of the ground at a known height or altitude.

Additionally, the drone has a camera which has a focal length, F, and a sensor to capture the image with dimensions, S_W, S_L, and S_D, corresponding respectively to the width, length, diagonal dimension of the sensor as measured in millimetres (mm). All of these are the real sizes and not 35mm equivalent dimensions.

The dimensions of the camera sensor have been illustrated here.

The next parameter is the field of view or FOV. This is expressed in degrees. Sometimes, people call it angle of view instead. This again is different for the width, length, and diagonal of the image as there are different amounts of areas being captured corresponding to each of these dimensions. So, we have three views with us: FOV_W, FOV_L, and FOV_D.

Diagram of the field of views corresponding to the length and width of the area being captured in our image. The point where the field of view angle forms from is the lens of the camera.

The final parameter is the one we are interested in finding out, GSD. As defined earlier, this is the real-life, actual distance each pixel side represents. Thus, the distance per pixel side. If we have the distance, in centimetres/metres, covered by the width or length of the image and then divide it by the number of pixels covered by that dimension in the image, then could divide the distance by the pixels to get the GSD. Thus, we have:

GSD (m)= A_W/ I_W = A_L/ I _L

Where (m) indicates that the GSD is measured in metres.

Now, let’s jump into actually solving this problem.

Our First Approach

This consists of an easy approach to estimate the areas covered by the image by using some basic trigonometry. Refer to our short yet detailed tutorial on solving this exact problem in one of our previous posts back in 2019, for details and derivations for the formula used:

Diagram showing the relationship between our drone’s sensor, the camera lens, and the area being photographed/ captured.

A_D= 2 * H * tan(FOV_D/ 2)

A_W= 2 * H * tan(FOV_W/ 2)

A_L= 2 * H * tan(FOV_L/ 2)

Alternatively, we can also find A_W and A_L using the aspect ratio, r = I_W/ I_L and the fact that that A_W, A_L, and A_D form a right triangle, as follows:

A_L = A_D/ √(1 + r²)

A_W = r * A_D/ √(1 + r²)

Now, for calculating the GSD, we have:

GSD (m) = A_W/ I_W = A_L/ I_L

Tada! We are done with the first approach. If following this was tough, this video explains this approach very well as well.

Our Second Approach

Another common way to solve this problem is to use similarity to derive the more commonly used formula for calculating GSD.

Diagram of the triangles formed when using a drone to capture a Nadir image of the ground. Applying concepts from ‘Similarity’ allows us to derive a formula for the GSD.

If we take a look at how our camera sensor captures an image of the ground, we can see that there are two triangles that are formed, △AOB and △COD. Both of these triangles have a common angle i.e FOV = ∠AOB = ∠COD. The FOV being used here depends on the dimension of the sensor we are looking at. If AB is the diagonal of the sensor, S_D , then FOV_D = ∠AOB = ∠COD. In that case, A_D = CD. Similarly, if AB is S_W, then A_W = CD.

Since AB || CD, we see that ∠OAB = ∠ODC and ∠OBA = ∠OCD since they are alternate interior angles.

Since three corresponding angle pairs are equal in both the triangles, we have similarity by AAA criterion, △AOB ~COD. As a consequence of similarity we know that the ratio of the areas of similar triangles is equal to the square of the ratio of their respective sides.

AB²/ CD² = (1/2 * AB * F)/ (1/2 * CD * H)

⇒ AB/ CD = F/ H

⇒ CD = AB * H/ F 

Because AB and CD can represent either the diagonal, width, or the length dimensions,

A_D = S_D * H/ F

A_W = S_W * H/ F

A_L = S_L * H/ F

Finally, since we know that

GSD (m) = A_W/ I_W = A_L/ I_L

We get,

A_W = GSD * I_W = S_W * H/ F

⇒ GSD (m) = S_W * H/ (I_W * F)

Similarly,

GSD (m)= S_H * H/ (I_H * F)

Tada! We have done it once again. We have solved the crisis of the missing GSD! And that’s a wrap! 

In conclusion, choosing the appropriate formula from the above depends on which parameters you can access and trust. As an example, you might have found the focal length of your camera for a given setting through the EXIF data, but then maybe you don’t trust the data being reported. On the other hand, you might know the default field of view of your camera from its official documents but then, you find out that the field of view keeps changing from one mode of the drone to the other, for different aspect ratios, zoom levels, etc. (it is quite a mess). 

Going through all these formulae and deriving them was a fun and educational experience. It gives us a clearer understanding of the caveats of using drone parameters in scientific research. We are now using these to estimate the size of river dolphins in the Ganges and better understand their age, body structure and health.

We hope you find this useful for your work- have fun and tread carefully. If you have any comments, or use some completely different way to solve this problem, we would love to hear from you- write to us at <contact@techforwildlife.com>

Cheers!