Welcome to our Community
Wanting to join the rest of our members? Feel free to sign up today.
Sign up

Anafi & ArcGIS

rab4280

New member
Joined
Oct 8, 2021
Messages
3
Reaction score
0
I am curious if anyone else is using their Anafi video/metadata in ArcGIS or similar programs. I have been using ExifTool to extract embedded metadata like the GPS latitude, longitude, and altitude, and plotting them in ArcGIS. I can plot the flight path and even create animations of the drone's position over time. I am also interested in using it with Full Motion Video, although it will be a lot more work to get the embedded metadata out and into a compatible format.

Does anyone else have experience working with Anafi metadata? Are there any tools available that already do what I am trying to do? Thanks!
 
Quick update for anyone curious on this topic. The most helpful tool I have found so far is ExifTool (ExifTool by Phil Harvey). It's requires you to use the Windows command line but it is relatively easy to use it get GPS latitude and longitude for every frame in the video. This can be saved a CSV and imported into ArcGIS. I'm still trying to figure out quaternions and getting the drone heading info! If any nerds out there know about this stuff let me know!
 
You can use the vmeta command line tool from Parrot GroundSDK / PDRAW to extract a CSV or JSON file containing all the metadata from your video.

I just made a post about this on the WebODM forum, I can repost it here as well if people are interested.
 
Quick update for anyone curious on this topic. The most helpful tool I have found so far is ExifTool (ExifTool by Phil Harvey). It's requires you to use the Windows command line but it is relatively easy to use it get GPS latitude and longitude for every frame in the video. This can be saved a CSV and imported into ArcGIS. I'm still trying to figure out quaternions and getting the drone heading info! If any nerds out there know about this stuff let me know!
Do you know if there is a way to extract single frames (f.ex every 30) from the video and keep the location metadata with the image?

Or how to export every n-th frame metadata with exiftool?

What arguments are you using to extract with exiftool?

I’m currently exporting every single frame from the videos to match with the CSV-file from vmeta, and picking a selection of frames for photogrammetry and looking for a way to make it easier…
 
Here are the arguments I am using with exiftool:

Code:
exiftool -api largefilesupport=1 -ee -c %+.8f -p "$gpslongitude, $gpslatitude, ${GPSAltitude#;$_=sprintf('%.3f',$_)}" video.MP4 > gps.txt

I included support for large files and formatting of the decimal points to make it easier to import into ArcGIS.

You end up rows of CSV data like this:
Code:
-93.92477274, +29.87869263, 0.008
-93.92477274, +29.87869263, 0.047
-93.92477274, +29.87869263, 0.082

Obviously, you can adjust the number of significant figures to fit your application or add additional fields to export.

There might be a way to export every n-th frame with exiftool, but I honestly find it easier to dump all the data to a CSV file and then use Python and Pandas dataframes to downsample as needed.


If I understand your post, I think what you want to is extract still images frames (ex jpg or tif) from the videos and include embedded metadata in the image. I don't know any tools that do that, and it may be something you need to code up yourself in something like Python or C++. You may also be interested in using Pix4D software to do your photogrammetry capture. Let me know what you find!
 
Thanks @rab4280 ,

I will check this out. Im currently using the workflow in this post:


It works quite well if you have the Parrot Ground SDK installed, but exiftool is much more commonly used. I might make a revised version of the workflow.

And I’m not a programmer!

I’ve used Pix4Dcapture before, but this was (as you can see in the post) not an option at the time. I’m currently looking for a different flight planner that supports terrain follow, but it’s not been easy…
 
...I’m currently looking for a different flight planner that supports terrain follow, but it’s not been easy…
I'm curious about what sources you plan to use for terrain elevation, are you doing a 3D model first (eg with ODM) with your own data ?
Or is the 'low res' data available online good enough for you, opentopography.org, Nasa, etc ?
 
I'm curious about what sources you plan to use for terrain elevation, are you doing a 3D model first (eg with ODM) with your own data ?
Or is the 'low res' data available online good enough for you, opentopography.org, Nasa, etc ?
I’d like to try both. For the specific site I made a preliminary dataset (the example in my post). It would be fun to do it from scratch just as a proof of concept.

But I also have access to nation wide high resolution (1m) data through our national mapping service. You can use the online map to apply for a high resolution download. Or as WCS service directly in a GIS program.

To be honest, it would probably not matter too much if the resolution is “low” either - ie within say 10m, as the cliff itself is very steep, and I would have a “GSD” of about 1cm / pixel at 30m from the cliff.

But the built in terrain services in QGroundcontrol doesn’t cover the area at all.
 
Interesting... I also found a local source for higher resolution terrain. I think they offer both the ground map, and the "features" map, ie buildings, trees ?, and other obstacles. I didn't look at the latter, yet.
I'm not familiar at all with Mavlink, QGroundcontrol or GroundSDK, I'm using a QGis plugin for grid like surveys "Flight Planner", and added a few functions to create flight plans for the Anafi. But the documentation is lacking for savedPlan.json, I'm not even sure if wayPoints' "altitude" reads decimals values, same question with "speed" and "period" between photos ? I can only find scarce infos, in this forum and others.
You are right that low res elevation maps are not an issue for videos, but if you are flying near cliffs that are located based on a 30 meters resolution, your drone has better not come too close ;-)
 
I flew the area again during a break this Easter. Manually this time, using the gps-lapse function in FreeFlight6. The resulting model looks much better than my first one - no surprise there! But it felt very inefficient to fly manually.

I have tried the QGIS plugin, but I couldn’t get it working properly, so I gave up. At the moment I’m stuck with manually planning in QGroundControl, which is quite time consuming but kind of works. I basically enter waypoints along the height curves, first as a basic grid, then fill in and adjust. See attached screenshot 1. QGroundControl do support terrain follow, but it is limited to the elevation data from Airmap, which cuts off at 60°N, and I’m further north than that. I’ve not found a way to import

I exported the kml files from both my manual flight log and the plan from QGC and opened them in Google Earth for comparison - then I can compare theory and practice. I already did some adjustments based on the Google earth view. See attached screenshot 2. But the anti collision on the ANAFI Ai would come in handy here! The heights / distances doesn’t match between the QGC map provider and Google Earth.

I‘ve been recommended to test UGCS for mission planning, and I want to try it - but it is a bit pricey for a hobby project, and a 14 day trial is not much with so infrequent flying as I do…
 

Attachments

  • Screenshot 2022-04-16 at 23.29.23.png
    Screenshot 2022-04-16 at 23.29.23.png
    3.7 MB · Views: 10
  • Screenshot 2022-04-16 at 23.50.18.png
    Screenshot 2022-04-16 at 23.50.18.png
    7.7 MB · Views: 10
No luck with those high latitudes! QGroundControl looks great although I'm curious to see how it handles the Anafi. Also if you lose the wifi connection, will the flight plan go the the end? My main issue would be that apparently you still need to register and connect to the internet to plan the flight (in case you need to modify it at the last minute without connection). I see resolution from Airmaps that provides the terrain is also limited to 30 meters from their website ('limited' if you compare with the low range and camera focal of the Anafi).

The QGIS plugin is limited to grid (and corridor) surveys, and it only produces new layers with the positions and coverage of the photos needed to map a polygon of your choice on the map, after setting your usual parameters (ie camera, gsd, sidelap, etc). at least these are the only features I'm using ! Not sure about the 'Flight control' part...
The Anafi is not listed so you need to add a .txt file with the camera focal, resolution for each mode (rectiliner, wide, etc), and the plugin only accepts polygons (area of interest) on projected layers (eg EPSG:3857 CRS with different units than lat/lon in degrees), maybe that's the reason you have issues... GIS learning curve is quite steep, I'm not a pro either !

I'm not a programmer and this was my first try at Python, I only inserted functions to read these points, 'wrap' a .json file around them, also I had to use some radical approximations to calculate distances and altitude from the data provided by the plugin. I found local 0.5 meters resolution maps for terrain elevation, and all that seems to work well (not sure in a different place/latitude !).
Limitations are more about the Anafi specs and savedPlan.json format (no gps lapse in it, and the drone sometimes doesn't follow the order when handling the camera, at least when I fly several plans without landing, etc).
If I was not using QGis for other reasons on my Windows tablet, I don't think I would even consider this alernative, but it's the only one that works now for me (I need to have a look at QGroundControl, but I can't find much info about Anafi users)...
 

Attachments

  • flight_planner.jpg
    flight_planner.jpg
    313.4 KB · Views: 5
  • plan.jpg
    plan.jpg
    298.7 KB · Views: 5
Interesting! I like the visual representation of camera overlap in QGIS. I’ve added that txt file for the Anafi, and managed to create a polygon that was accepted. But it stops when I try to load the DTM, it won’t accept my WMS layer even though I’m able to choose it. I have not tried a manual import yet, but I have the data available.

I’ve noticed some of the same issues with Pix4Dcapture. It will fly the mission autonomous, but it will only capture the photos if you are connected to the drone. If you lose connection it still flies the pattern but you won’t get the data.

I’ve not flown with QGC yet, just made plans and had a short takeoff, move and land test indoors. I’m hoping it will work as a fully autonomous flight as it is based on mavlink. But since it’s connecting via the laptop Wi-Fi it will obviously have a shorter range than the controller.. otherwise I’d have to look into an external antenna, and then suddenly it’s a much bigger project.

Edit: FYI, you can download offline maps in QGroundControl, so you are not dependent on an internet connection in the field. Click the QGC icon in the top lefthand corner, choose application settings, offline maps. Zoom to the desired area and you're set.

1650370280701.png

On a related note, in a Facebook forum I was recommended to try UGCS. Apparently it supports the Anafi, and is a solid pro level flight control / planner. It is a bit pricey though (for hobby use), and you will also be tied to using a PC. But the connection to the drone is via the controller, and it supports importing elevation data from many different sources. In my case it would be worth a try at least.
 
Last edited:
It will fly the mission autonomous, but it will only capture the photos if you are connected to the drone.
Let's hope this is not a 'feature' of the latest firmware update, to follow EU's rules? I haven't checked the forum about that! Like you have now to remove any tilt from the takeoff block in FlightPlan, else the mission just doesn't start anymore, this didn't happen with previous FW.

it stops when I try to load the DTM, it won’t accept my WMS layer even though I’m able to choose it. I have not tried a manual import yet, but I have the data available.

I just download the .tiff files from the provider, and add new raster layer(s) with the .tiff as source in QGIS. Despite a totally different (local) CRS than the CRS used in the plugin's layers, ie area of interest polygon, photos and centres point layers, the raster appears on the right place, and altitudes are correct (I needed to do my own calculations for the .json, since the Anafi takes above ground elevations, not real altitudes, unlike the original plugin when 'follow terrain' is checked).
 
@rab4280 I'm working on some Python software that parses image metadata from drones to calculate the spot on the ground the camera is pointed at

Parrot uses a different orientation format than any other drone I've seen, I'm trying to figure out how to use quaternions to convert from Omega, Phi, Kappa to NED (North, East, Down) coordinates:

The documentation says there should be a XMP metadata tag Xmp.drone-parrot.CameraYawDegree that gives it in the same format as evry other drone mfn. , but I haven't actually seen it recorded on any of the images I tested

Anyways, check it out @ OpenAthena.com if you're interested
 
@rab4280 I'm working on some Python software that parses image metadata from drones to calculate the spot on the ground the camera is pointed at

Parrot uses a different orientation format than any other drone I've seen, I'm trying to figure out how to use quaternions to convert from Omega, Phi, Kappa to NED (North, East, Down) coordinates:

The documentation says there should be a XMP metadata tag Xmp.drone-parrot.CameraYawDegree that gives it in the same format as evry other drone mfn. , but I haven't actually seen it recorded on any of the images I tested

Anyways, check it out @ OpenAthena.com if you're interested
Hi,

What do you mean by different orientation format?

Are you’re looking at the Anafi Ai metadata, or the other drones from Parrot..?

I believe the Anafi Ai is the only one that use xmp for metadata. I don’t know much about the Ai, so I won’t be of much help there.

But as far as I know, the ordinary Anafi gives normal yaw, pitch and roll data for the camera position in the exif data.

I can check some of my photos tomorrow, and share some raw files with you if you want. However, I’m not at home at the moment, so I won’t be able to test the pdraw output until the upcoming weekend at the earliest, but there is a good chance that the data you’re looking for is available embedded in real time from the drone’s live feed..
 
Don't remember the exact model, in the metadata it's called "Disco"?

I'm just looking at the raw EXIF and XMP metadata automatically included with the images

Mainly just trying to parse this data for position and orientation. Most drone mfn.'s it's pretty easy, just Parrot does something different with Omega, Phi, Kappa notation which I find harder to understand
 
I think that’s your problem..

The Parrot Disco is a (discontinued) fixed wing drone without a gimbal. That and the Bebop series drones use an extreme fisheye camera and electronic stabilisation to move the “camera”, which is basically a cropped and rectified part of the high resolution fixed position camera view.

I suggest you look into the newer drones - the Anafi series. Then you most likely find the “normal” metadata.
 
  • Like
Reactions: t3l3tubie
Don't remember the exact model, in the metadata it's called "Disco"?

I'm just looking at the raw EXIF and XMP metadata automatically included with the images

Mainly just trying to parse this data for position and orientation. Most drone mfn.'s it's pretty easy, just Parrot does something different with Omega, Phi, Kappa notation which I find harder to understand
If position is still an issue with more recent Parrot pictures, you can look at "ImportPhotos" a plugin for QGIS. I'm using it to check the results of the flight plans done with my 'own' plugin, so I know it works - at least with the the Anafi 4K! But I don't see any orientation data, and I don't think it handles videos...
It's also written in Python, so it should be easy for you to see how it reads the exif/gps data.
 

Members online

Forum statistics

Threads
5,307
Messages
45,090
Members
8,004
Latest member
gearsgood