Skip to content
This repository has been archived by the owner on Sep 1, 2024. It is now read-only.

Different duration compared to metavision_studio #19

Open
fedebecat opened this issue Oct 14, 2023 · 6 comments
Open

Different duration compared to metavision_studio #19

fedebecat opened this issue Oct 14, 2023 · 6 comments

Comments

@fedebecat
Copy link

Hi,

I am not sure if I am doing something wrong, I took a look around the issues but I didn't find anything similar.
I have a raw video that I recorded myself using the metavision library. The file is a raw evt3 file.

If I read the file by doing:

wizard = Wizard(encoding="evt3") arr = wizard.read(raw_file) print(f"Recording duration: {(arr[-1]['t']-arr[0]['t'])/int(1e6)} s.")

I get that the duration is 5.14747s, whereas when I open the video with metavision studio I see that the actual duration is 2.2580322s. Any clue about what could be going wrong?
I also recorded the same scene with an RGB camera which should be roughly synchronized with the event camera and I got slightly more than 2 seconds also for RGB.

Thank you!

Federico

@fabrizio-ottati
Copy link
Member

Ciao Federico,
yeah, I know about this issue and I have to look into it. It does not happen with the samples on Prophesee website, apart from the EVT3 one. Strange things happen with the timestamps. I will look into it!

@fedebecat
Copy link
Author

Ok, thank you very much!

@fedebecat
Copy link
Author

fedebecat commented Oct 14, 2023

If it can be of any use, I compared the timestamps obtained using metavision and the ones obtained with expelliarmus. I noticed that the 12 least significant bits are always the same. I figure that if there is something wrong it should be in the EVT_TIME_HIGH part of the timestamp.

@fabrizio-ottati
Copy link
Member

fabrizio-ottati commented Oct 14, 2023

If you would like to try and tackle it yourself, feel free to to do it :) I started another project called misha last year, with the intention of using new pipelines for numpy in C++, but then the last year of PhD happened :) I still want to tackle it though

@lbristiel-psee
Copy link

Hi,

I am affraid that there is a problem in the EVT3 decoder code of expelliarmus.
I tested the Wizard on pedestrians.raw (mentioned in the README) and compared to what our EV3 decoder sample outputs (see https://docs.prophesee.ai/stable/samples/standalone/evt3_decoder.html) and events are properly decoded in the begining (first events) but after a while the timestamps starts to diverge and the value given by expelliarmus are too large. So for pedestrians I end up witha length of 65s instead of 30s though the events coordinate are correct.

Here is what I get with expelliarmus

$ python3 test.py 
First event encoded as (t, x, y, p): (5840504, 707, 297, 0)
13th event encoded as (t, x, y, p): (5840587, 689, 302, 0)
130th event encoded as (t, x, y, p): (5845610, 1005, 312, 1)
100000th event encoded as (t, x, y, p): (7143405, 3, 548, 0)
Last event encoded as (t, x, y, p): (65942920, 211, 334, 0)
Number of events: 39297796.
Recording duration: 60.102416 s.

and here is what I get with MV SDK evt3_decoder:

$ sed -n '13p' out.csv 
689,302,0,5840587
$ sed -n '130p' out.csv 
1005,312,1,5841514
$ sed -n '100000p' out.csv 
3,548,0,6492141
$ tail out.csv
211,334,0,35890568

=> same coordinate but not same timestamps.

so someone should double check the source code of EV3 decoded in expelliarmus.
You can use the code of our decoder as an example: https://github.com/prophesee-ai/openeb/blob/main/standalone_samples/metavision_evt3_raw_file_decoder/metavision_evt3_raw_file_decoder.cpp

Hope this helps,
Laurent for Prophesee Support

@fabrizio-ottati
Copy link
Member

fabrizio-ottati commented Oct 18, 2023

Nice, thanks @lbristiel-psee! At this point, it would make much more sense to make a lightweight decoder around openeb than maintaining a separate project.

EDIT

This line could be why the durations do not match :) It is not mentioned in the documentation, though.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants