Save Data from Davis

251 views
Skip to first unread message

Eman Hasanwu p

unread,
Oct 17, 2018, 3:46:29 AM10/17/18
to davis-users
Hi There,

I am new in using Davis 240c, I want to save and print out the data I have gotten from Davis in text file : I would like to have the follwing format for the text file : 
timestamp  x  y  polarity. 

Could anyone help in this?

Thank you in advance.


Tobi Delbruck (work)

unread,
Oct 17, 2018, 4:30:15 AM10/17/18
to davis...@googlegroups.com
You can roll your own solution quite easily if you have matlab. You can
load a recording in aedat-2.0 format recorded by jaer into matlab data
structure and then write it out as you like. It should also be possible
to do this in python although I have not used these scripts myself.

See https://github.com/inivation/AedatTools

Note that DAVIS also can include APS intensity frames and IMU samples,
which are not easy to represent in a single file.

Please think about forking the repos and suggesting pulls if you develop
any new scripts or find bugs.


Eman Hasanwu p

unread,
Oct 17, 2018, 10:39:02 AM10/17/18
to davis-users
Thank you, sir, for your timely response. Actually,  I am running Davis 240C on Ubuntu 18 and I have installed CAer library.  how I can load Davis events using ubuntu command line.
Thank you.

Luca Longinotti

unread,
Oct 17, 2018, 11:22:00 AM10/17/18
to davis-users
cAER currently only supports input/output in the AEDAT 3 format.

If you want a text file format on Linux, the easiest is to use libcaer directly. Look at one of the examples like examples/davis_simple.cpp.
In the main processing loop, you just have to go through all events and print the data to file in whatever format you want.
Plus open/close the file outside of the loop.

Hope this helps, have a nice day!

Tobi Delbruck (work)

unread,
Oct 19, 2018, 6:11:37 AM10/19/18
to davis...@googlegroups.com
Inspired by this question, I wrote a basic implementation of a new jAER
filter called DavisTextOutputWriter
https://github.com/SensorsINI/jaer/blob/master/src/net/sf/jaer/util/textoutput/DavisTextOutputWriter.java

It writes out text format DVS files. You can apply filters beforehand,
but be sure to select the option from File menu to "Enable filtering of
logged or network streams"

Usage should ideally be self explanatory. Only tested on one recorded
file so  far. Please report bugs and needed features.

Tobi Delbruck

unread,
Oct 21, 2018, 10:21:05 AM10/21/18
to davis-users
I pushed DavisTextOutputWriter filter that outputs text format DVS and IMU data from any recording from DVS or DAVIS cameras. Actually it should work for other sensors such as Cochlea but the interpretation of the event type and x and y will depend on the device of course.  Use it like any other EventFilter and look at the tooltips for usage. To use it, you have to build from source. Or wait for next release.

Sample output of DVS events looks like this:

# jAER DAVIS/DVS camera text file output
# created Sun Oct 21 10:11:11 CEST 2018
# source-file: F:\Resilio Sync\Recordings\Tobi data\fluid flow particle tracking\helium bubbles\DVS128-2010-02-12T11-55-47+0100-0.dat
# dvs-events: One event per line:  timestamp(us) x y polarity(0=off,1=on)
31455838 73 9 1
31455840 109 113 0
31455840 119 117 1
31455842 46 107 0
31455842 54 107 1
31455844 34 82 1
31455844 32 17 0
31455845 32 17 0
31455846 32 17 0

and of IMU samples looks like this:

# jAER DAVIS/DVS camera text file output
# created Sun Oct 21 09:59:04 CEST 2018
# source-file: F:\Resilio Sync\Tobi laptop data\Davis346Bmini\Davis346mini-2017-06-08T16-27-19+0200-03460001-0 ini foyer apsdvs.aedat
# dvs-events: One measurement per line: timestamp(us) ax(g) ay(g) az(g) gx(d/s) gy(d/s) gz(d/s)
127996031 0.174683 -0.769775 0.165405 28.595421 111.335876 31.251909
127997032 0.175781 -0.767334 0.168457 28.213741 111.450378 31.633589
127998034 0.174561 -0.764404 0.162476 27.862595 111.633591 32.053436
127999035 0.173218 -0.761841 0.159058 27.488550 111.877861 32.381680
128000036 0.167603 -0.760986 0.159790 27.152672 112.167938 32.618320
128001038 0.163696 -0.761230 0.164307 26.854961 112.358780 32.870228


Luca Longinotti

unread,
Oct 29, 2018, 6:20:44 AM10/29/18
to davis-users
There's also an example for writing to text files using libcaer now:

tonyde...@gmail.com

unread,
Nov 7, 2018, 7:14:27 AM11/7/18
to davis-users
I truly found that there are lots of useful tools have been already compiled in jAER, however when I try to use daivsOutputWriter to obtain a .txt format file with events. The time stamps of those recorded events are kind of weird. They do not even follow a time sequence in my result, I do not know if there is something wrong with my operation or this filter is not completed right now. Because timestamps are so important for lots of follow-up processing.

timestamp(us) x y polarity           these data line is from line 8666 to 8686 in jAER-events.txt
24897464 74 176 0
24897471 75 178 0
24897471 97 160 0
24897471 115 160 1
24897475 63 162 0
24897475 118 162 1
24897479 108 156 1
24897492 76 151 0
24897492 94 151 0
24897492 112 155 1
12857495 174 3 0
12857652 132 118 1
12857717 110 112 0
12857915 104 91 0
12858022 221 138 1
12858132 107 122 0
12858234 234 24 0
12858257 109 113 0
12858394 116 106 0
12858403 10 63 0
12858440 111 153 0

The timestamps are actually jumped to a low value with a big difference. I record several files for different logfile, and I found they all crushed after some points. Btw, I found this problem by trying to remove the time offset.

best wishes

Tony

在 2018年10月21日星期日 UTC+8下午10:21:05,Tobi Delbruck写道:

Tobi Delbruck

unread,
Nov 7, 2018, 9:54:37 AM11/7/18
to davis...@googlegroups.com
Thanks very much Tony. I'll take a look. Probably some dumb thing I left in there from stealing code from aviwriter classes. Did you for so you can make a a pull request? Otherwise send me the line numbers and I'll push the fixes.

Just to check, you are definitely on head revision? My first commit was buggy with this problem from including non dvs events like IMU and APS

tonyde...@gmail.com

unread,
Nov 7, 2018, 10:58:08 AM11/7/18
to davis-users
Thanks for timely response. Yes, I used the latest version, maybe because I used only DVS dataset, so there are no IMU and APS data output. The bug still exist, and the timestamps seem like growing up at very first, then drop down to a small value and growing up from this small value again. Very strange situation. I don't know if there are some reset mechanism in the code, I am trying to find ground truth from txt file extracting from aedat to make a comparison with these two txt outputs.

timestamp x,    y,  polarity
13201020 108 62 1
13201410 57 31 0
13201830 92 23 0
135958160 57 110 1
135958160 118 40 1
135958170 103 58 1
135958170 71 58 1
135967710 0 127 1
12450 108 21 1
12450 108 21 1
22870 9 11 1
33290 89 51 1
36800 98 3 1
38570 56 118 1
54130 21 1 1
74960 32 33 1
95800 102 0 1
103980 0 0 0
104540 0 1 0
104910 0 2 0

Regards,

Tony

在 2018年11月7日星期三 UTC+8下午10:54:37,Tobi Delbruck写道:

Tobi Delbruck (INI)

unread,
Nov 8, 2018, 1:40:42 AM11/8/18
to davis...@googlegroups.com
Can you share this file? Is it possible this file has nonmonotonic
timetamps?  It is possible if the timestamp is reset, if the USB cable
is not good (so data is corrupted) and on DVS128 cameras because of a
logic race condition in the timestamping logic.


tonyde...@gmail.com

unread,
Nov 8, 2018, 2:07:47 AM11/8/18
to davis-users
I found an interesting phenomenon, if I pause my aedat file at first, and then enable the textoutput filter and then record the data, it works fine. But if I do not pause my .aedat file at first, the output will like what I described before. I think maybe it is caused by operation delay inside the jAER?

在 2018年11月8日星期四 UTC+8下午2:40:42,Tobi Delbruck写道:

Tobi Delbruck (INI)

unread,
Nov 8, 2018, 2:26:10 AM11/8/18
to davis...@googlegroups.com
Interesting. Do you have the "rewindBeforeRecording" option enabled? I
have pushed an update that prints warning for writing out nonmonotonic
timestamps.

tonydeng2016

unread,
Nov 8, 2018, 5:09:48 AM11/8/18
to Tobi Delbruck, davis...@googlegroups.com
Yes, I did. And thanks for updating.


--
You received this message because you are subscribed to the Google Groups "davis-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to davis-users...@googlegroups.com.
To post to this group, send email to davis...@googlegroups.com.
Visit this group at https://groups.google.com/group/davis-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/davis-users/575a0f93-e56c-6128-55f6-b27125050892%40ini.uzh.ch.
For more options, visit https://groups.google.com/d/optout.

huixiang liu

unread,
Feb 2, 2023, 2:38:45 AM2/2/23
to davis-users
Hello, sorry to bother you. I browse the two GitHub links under this session and find that the two links you posted have been invalid, are there any new links to replace them? It's very important to me.  Looking forward to your reply!

Tobi Delbruck

unread,
Feb 2, 2023, 3:23:48 AM2/2/23
to davis-users
https://github.com/SensorsINI/AedatTools is still available, it is fork from cedric which had most recent activity. Don't know about any other link that was referred to.
Tobi

huixiang liu

unread,
Feb 2, 2023, 10:31:04 PM2/2/23
to davis-users
Thank you for your answer. It's very helpful

huixiang liu

unread,
Feb 10, 2023, 1:27:36 AM2/10/23
to davis-users
Hello,Bother you again.
I found https://github.com/SensorsINI/AedatTools, here are the matlab generated by rosbag aedat DVS camera format file, I have been looking for ways to write python aedat4 file, Now I know the dv - processing (https://gitlab.com/inivation/dv/dv-processing) is the use of python written aedat file, but in Windows environment, The installation and use of dv-processing library has not been successful. Do you know any other alternative method to write aedat4 files?
Best regards.
在2023年2月2日星期四 UTC+8 16:23:48<to...@ini.phys.ethz.ch> 写道:

Tobi Delbruck (UZH-ETH)

unread,
Feb 10, 2023, 1:35:21 AM2/10/23
to davis...@googlegroups.com
Using dv python to write the aedat4 file would be the best way since it
would handle all the special data types and formatting of the AEDAT-4.0
format, which is pretty complicated. What is the problem installing it
on windows?
Reply all
Reply to author
Forward
0 new messages