With loris you can read and write different file formats from neuromorphic cameras such as .aedat4, .dat, .es or .csv. Loris is also an amazing animal
version | read | write | |
---|---|---|---|
.aedat4 | 4 | ☑ | ☐ |
.dat | 1/2 | ☑ | ☐ |
.es | 2.x | ☑ | ☑ |
.csv | - | ☑ | ☐ |
pip install loris
import loris
my_file = loris.read_file("/path/to/my-file.dat")
events = my_file['events']
for event in events:
print("ts:", event.t, "x:", event.x, "y:", event.y, "p:", event.p)
ordering = "xytp" # corresponds to the order in your array
loris.write_events_to_file(event_array, "/path/to/my-file.es", ordering)
loris.write_events_to_file(structured_event_array, "/path/to/my-file.es")