Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update io.py #291

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 9 additions & 5 deletions tonic/io.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,14 +160,18 @@ def read_davis_346(filename):
all_addr = all_events["address"]
t = all_events["timeStamp"]

# Seperating DVS events from the shared set of DVS, APS, and IMU events.
bit_31 = (all_addr >> 31) & 0b1
dvs = np.where(bit_31 == 0)

# x, y, and p : bit-shift and bit-mask values taken from jAER (https://github.com/SensorsINI/jaer)
x = (346 - 1) - ((all_addr & 4190208) >> 12)
y = (260 - 1) - ((all_addr & 2143289344) >> 22)
p = ((all_addr & 2048) >> 11)
dvs_x = (346 - 1) - (all_addr[dvs] >> 12) & 0x3FF
dvs_y = (260 - 1) - (all_addr[dvs] >> 22) & 0x1FF
dvs_p = ((all_addr[dvs] & 2048) >> 11)

xytp = make_structured_array(x, y, t, p)
dvs_xytp = make_structured_array(dvs_x, dvs_y, t[dvs], dvs_p, dtype=events_struct)
shape = (346, 260)
return shape, start_timestamp, xytp
return shape, start_timestamp, dvs_xytp


def read_dvs_346mini(filename):
Expand Down
Loading