open-neuromorphic / expelliarmus

A Python package for decoding RAW and DAT files (Prophesee) to structured NumPy arrays of events.
https://expelliarmus.readthedocs.io/
GNU General Public License v2.0
36 stars 9 forks source link

Mismatch between expelliarmus and metavision #6

Closed stevenabreu7 closed 1 year ago

stevenabreu7 commented 1 year ago

I loaded the same .raw file from a prophesee camera (evt2 format) with expelliarmus and metavision and I get very different numpy arrays from it. Here is the code I used for expelliarmus:

from expelliarmus import Wizard
import numpy as np

wizard = Wizard(encoding="evt2", fpath="A1.raw")
arr = wizard.read()
np.save("A1.npy", arr)

And the code using prophesee's meta vision library:

from metavision_core.event_io import EventsIterator
import numpy as np

ev_it = EventsIterator("A1.raw")
arr = np.concatenate([ev for ev in ev_it])
np.save("A1.npy", arr)

Here is a histogram of the events over time for both approaches (for eight different data files, top is meta vision, bottom is expelliarmus): hist_numpy hist_numpy_wiz

Looking at the numpy data, I cannot easily see what went wrong. What's curious is that the first ~40 entries have timestamps <50, and then it jumps to a timestamp of >3e9.

Any idea what could have gone wrong there?

fabrizio-ottati commented 1 year ago

Uhm I think this is a bug inside expelliarmus, honestly. I will look into it immediately. Does it happen also for EVT3? I don't know if you have access to this kind of format.

stevenabreu7 commented 1 year ago

Yeah unfortunately I don't have a EVT3 file available so I can't check. Thanks for looking into it so quickly!

fabrizio-ottati commented 1 year ago

Could you try with this EVT2 RAW file and see what you get? If you could pass me the resulting NPY file on Discord, I would be really grateful :) You can find the link in the README of the repository.