caprieldeluca / Drone-Footprints

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Aerial Drone (aka UAV/UAS) Imagery Footprint and GeoTIFF Utility.

Author: Dean Hand
Date Created: 09/07/2019

Name: Drone_Footprints.py
The purpose of this module is to calculate imagery footprints of individual drone images. There is no stitching of images, so the process is actually quite fast. The output is geo-rectified GeoTiff image file and a GeoJSON file with:

  • Drone Flightpath (LineString)
  • Drone location at point of photo (Point)
  • Individual Image Footprints (Polygons)

Installation

Requirements

  • Ready-made gdal version 3.8.3 or later. On Ubuntu, you can install as follows:
sudo add-apt-repository ppa:ubuntugis/ubuntugis-unstable
sudo apt-get update
sudo apt-get install libgdal-dev

Installation via pip

pip install -r requirements.txt

πŸ’‘ Processing Notes and Tips

Arguments

-i - The Default root folder for the mission you wish to process. Required

-o - The output directory for the GeoJSON file and GeoTiffs. Required

-w - Sensor Width (default is 13.2) Not Required (Check your Drones Specs for information)

-d - Sensor Height (default is 8.8) Not Required (Check your Drones Specs for information)


Example Commands

python Drone_Footprints.py -i '/Users/<user>/Downloads/flight2/images' -o '/Users/<user>/Downloads/flight2/output

python Drone_Footprints.py -i "/Path/To/Dataset/images" -o "/Path/To/Dataset/output" -w 6.16 -d 4.62


⚠️ The accuracy of this process depends highly on a number of factors.

  1. IMU calibration
  2. Gimbal calibration
  3. Compass Calibration
  4. Shooting angle (for best results - Parallel to Main Path)
  5. Capture Mode (for best results - Hover&Capture at Point)
  6. Gimbal Roll Angle (for best results - NADIR aka -90Β° aka straight down)
  7. Yaw Degrees - I've found the GimbalYawDegree data from the files to be unreliable at best, so the code calculates the GSD and FOV using the FlightYawDegree.

πŸ“ Sort into Datasets

It is highly recommended that you sort the images you want processed into corresponding datasets

  • Separate Images by flight mission
    • Create a mission folder for each flight mission
    • Create an image folder within the mission folder
β”œβ”€β”€ /Path/to/mission_folder
β”‚   β”œβ”€β”€ images

Outputs locations

It is a good practice to set your output folder -o location within your flight mission folder as shown in Example Commands, but it is not required.

β”œβ”€β”€ /Path/to/output_folder
β”‚   β”œβ”€β”€ geotiffs
β”‚   β”‚   β”œβ”€β”€ image1.tif
β”‚   β”‚   β”œβ”€β”€ image1.tif
β”‚   β”œβ”€β”€ geojsons
β”‚   β”‚   β”œβ”€β”€ M_2024-02-06_11-16.json

Geojson name is constructed using the date/time of processing like so:

  • M = mission
  • 2024-02-06 = year, month, day
  • 11-16 = hour, minute

πŸ’₯ Future Builds

Sensor Size checks

There still remains many empty cells in drone_sensors.csv, but will update it as that information becomes available.


⭐ Sample Outputs

Sample Dataset

Sample JSON Output

M_2024-02-04_07-03.json

Sample GeoTIFFs

Sample Screenshots (QGIS)

drawing

drawing

IMAGE ALT TEXT HERE


known Issues

Images that are not taken at Nadir are still not warping correctly as I've intended. I could use some help or insight there.

Tested and works with:

  • Phantom 4 Series
  • Mavic 2 Series
  • EVO II

Not currently working with older drones (i.e. Phantom 3 Series). The differences in how telemetry is processed and translated into metadata is.... troublesome.


About

License:GNU Affero General Public License v3.0


Languages

Language:Python 93.0%Language:Makefile 7.0%