Time alignment between a DVS and a carmera

237 views
Skip to first unread message

z_y...@163.com

unread,
Aug 18, 2020, 6:49:06 AM8/18/20
to davis-users
we need to align the record time between events and the video from different sources, and we meet two problems:
1. How to software-trigger or hardware-trigger the DVS to record the signal?
or
2. How to get the time offset between event timestamps and computer time at micro second precision ?

Luca Longinotti

unread,
Aug 18, 2020, 7:21:41 AM8/18/20
to davis...@googlegroups.com, z_y...@163.com
Assuming a recent DAVIS346 / DVXplorer model:

1) You can use the SIGNAL IN port to send a pulse, and then configure
the signal detector to create a trigger event when it detects it.
In DV, you can just send the output of type 'triggers' to a file and it
will have trigger events with the timestamp of when they happened.
In the Capture module in DV search for 'Detector' to enable the
feature, you have to turn on 'Run Detector' and one of 'Detect Pulses'
or Rising Edges or Falling Edges.

2) In DV all events, triggers etc. already use a microsecond-precision
real-time timestamp (offset from Unix time), so it already is recorded
in 'computer time' with the best possible alignment we can get with the
current setup. In practice this usually means a few milliseconds
between dvs time and actual computer time, but due to how USB works
that's the best that's possible.

z_y...@163.com

unread,
Aug 18, 2020, 8:46:38 AM8/18/20
to davis-users
Thanks for your kindly reply, I have another question: now I got an event-data name:'20200619_aedatDavis346mini-2020-06-18T17-14-42+0800-00000106-0.txt' and the first event is "491473730 132 72 0", the last event is "494764288 230 73 0", how to caculate the unix time of the first event, unixtime(2020-06-18T17-14-42 )-last_event_timestamp? do I need to get the start time of the DVS or other message?How?

Luca Longinotti

unread,
Aug 18, 2020, 9:06:34 AM8/18/20
to davis...@googlegroups.com, z_y...@163.com
The first number represent the 64-bit timestamp, which is Unix time
since the Epoch (the Unix epoch is 00:00:00 UTC on 1 January 1970) in
microseconds.
clock_gettime() expresses time as a 'struct timespec' which has seconds
and nanoseconds, you could directly convert our timestamp to that using
the following formula:

int64_t timestamp = 1597755944349080;
struct timespec unixTime;
unixTime.tv_sec = timestamp / 1000000;
unixTime.tv_nsec = (timestamp % 1000000) * 1000;

I'm not sure where you got that .txt file from, but the timestamp value
seems not to be the AEDAT4/DV format of 'Unix Time in microseconds'.
Older or other formats did not use this specification and simply
recorded increasing time from the camera in microsecond, with no notion
of a relation to 'real-time' or Unix time.

z_y...@163.com

unread,
Aug 19, 2020, 3:39:03 AM8/19/20
to davis-users
Thank you very much, I think I need to update the firmware~  I am now using an older format, aedat2...
Message has been deleted

z_y...@163.com

unread,
Aug 31, 2020, 3:21:37 AM8/31/20
to davis-users
hi, now I have aligned the davis346b's timestamp with a camera's raw image timestamp using a millisecond stopwatch and caculate a time-offset between dvs-timestamp and camera-timestamp, but in deferent video, the time-offset have nearly hundred millisecond difference,I am tring to locate where the time-difference come, can you give me some ideas?  It's that possible that the initial offset that DVS using to caculated the real time varies between different records? 

在2020年8月18日星期二 UTC+8 下午9:06:34<Luca Longinotti> 写道:

Luca Longinotti

unread,
Sep 3, 2020, 9:13:17 AM9/3/20
to davis...@googlegroups.com, z_y...@163.com
The initial offset does change every time the Capture module is
restarted. If you use our Python reader for files, you can access the
initial timestamp offset value like this:

$ my_aedat_file._name_info_map['events']['tsOffset']

That the measured real world difference is up to 100ms is possible in
theory, we try to query the system clock and assign the timestamp as
close as possible, but there can be unpredictable system delays.
Without special hardware support on host and USB it's very difficult if
not impossible to get high (microsecond-level) precision between device
and host timestamps.

-----Original Message-----
From: z_y...@163.com <z_y...@163.com>
To: davis-users <davis...@googlegroups.com>
Subject: Re: [davis-users] Time alignment between a DVS and a carmera
Date: Mon, 31 Aug 2020 00:07:44 -0700

hi, now I have aligned the davis346b's timestamp with a camera's raw
image timestamp using a millisecond stopwatch and caculate a time-
offset between dvs-timestamp and camera-timestamp, but in deferent
video, the time-offset have nearly hundred millisecond difference,I am
tring to locate where the time-difference come, can you give me some
ideas? It's that possible that the initial offset that DVS using to
caculated the real time varies between different records? You said in
this group that "the infoNode stored in file recordings contains a
'tsOffset' attribute that records the initial offset" , can you tell me
where to get the tsOffset?

kind regrads

在2020年8月18日星期二 UTC+8 下午9:06:34<Luca Longinotti> 写道:

z_y...@163.com

unread,
Nov 30, 2020, 2:19:38 AM11/30/20
to davis-users
Dose davis-346mini-blue has sync connectors inside? I mean can I  remove the shelling and synchronize it,  If it is possible, which pins is the sync connetors? We want to hardware synchronize it. We have a  davis-346(red) and it has outside sync connectors, I wonder whether the davis-346mini-blue also does. If so, we can synchronize different type cameras.

Tobi Delbruck (UZH-ETH)

unread,
Nov 30, 2020, 2:40:40 AM11/30/20
to davis...@googlegroups.com
Yes, Davis346Blue has the header but you need a special adapter board to
connect to the header.  I bet there are still some available, and if not
it is a very simple 2 layer PCB and the plan for it must be available.

Tobi


Reply all
Reply to author
Forward
0 new messages