I use an Emlid M+ mounted in a UAV. For most of the flights, the events are equal to the number of images taken by the drone.
But in one case, I had an event less than the number of images. As I started learning the Python programming language a few months ago, it motivated me to try to create a script that could detect that missing event, so I can dismiss that particular image from the dataset.
This was the flight:
Trying to locate and then manually figuring out which number of image the missing event corresponds to, can take some time.
So I created a script that does it automatically.
Note: The texts on the screenshots are in Spanish as it is my native language.
The inputs are:
- The name of the events.pos file
- The number of the first image
And the outputs are:
- The number of “holes” detected.
- Number of the first and last images of the dataset, to check that are equal to the images actually taken by the drone.
- The images corresponding to the missing geotags.
- A graph view with the “holes” and the number of image for every event.
After running the script with our example, we get the following results:
If we zoom in into the red circle we can see that the event for the image 2060 is missing here:
Testing the script on a file where several events are missing.
If I manually create more “missing events” in the same .pos file to check how the script works, I get the following results:
Testing the script on a file where no event is missing.
And if I run the script in an event.pos file that has no missing event, I get the following:
So we can see that it works well with different scenarios.
Here is the link to the repository in case someone wants to try it out (it is recommended to use a python IDE):
DISCLAIMER: The script is written in Python and is provided ‘as is’, without any warranties. It may contain errors and the end user should check the data produced.
For the script to run well:
1- The images have to be taken continuously, as the calculation of missing geotags is based on the distance between consecutive images.
2-The event.pos file must be in the same folder as the .py file where the code is executed from.
It may not give correct results in the case where all events from a curve (between 2 parallel lines of the flight) are missing.