Detecting missing events in event.pos files with Python

Hi everyone,

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
    input

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.

3 Likes

Thank you working!

1 Like

Good stuff! Thank you for your contribution!

1 Like

Very Creative thinking!.. Well done. Sometimes I think I should get some coding training…maybe that will be my 2023 resolution.
Never stop creating!!

2 Likes

Hi @Doppler_Uav,

It looks like a nice challenge to test and improve your Python skills! But let me leave a note for anyone who faces similar issues.

It’s usually more effective to deal with causes than effects. In most cases I’ve seen, time marks were missing because of issues with the hardware setup, like RF interference or loose connection between the Reach and the camera. If it’s fixed, post-processing doesn’t require any additional steps and becomes much easier. So, don’t hesitate to create a new thread with the description of you issue. We’re always ready to look into the reasons and help you obtain the best results with your Reach.

3 Likes

Thanks @jmiranda!

I think Python is a good language to start with.

Hi @kseniia.suzdaltseva,

Yes, I agree with you. Actually, I have had very good results with M+. I only once had a case where the number of images didn’t match the events (one event less than images), so it motivated me to try creating a script to detect that situation, as I started learning python some time ago.

For the second example I had to manually “create” the missing events to test the script, I never had so many missing events.

If there are repeatedly missing events on the flights, that would probably be related to the hardware setup as you say and it has to be corrected.

2 Likes

This topic was automatically closed 100 days after the last reply. New replies are no longer allowed.