Skip to content

DVS viewer

Alexandre Marcireau edited this page Oct 14, 2019 · 2 revisions

example files: examples/dvs_viewer

Communication with cameras is provided by dedicated libraries built upon the Sepia library. Each camera has its own extension library, such as dvs_sepia for the DVS. This example shows how to use the aforementioned extension. To use another camera, follow the same steps but replace the extension with the correct one.

You can either create an empty directory, install Tarsier and Chameleon as in the basics tutorials and DVS Sepia as shown below, or run:

git clone https://github.com/neuromorphic-paris/tutorials
cd tutorials/example/dvs_viewer
git submodule update --init --recursive -- third_party/dvs_sepia
git submodule update --init --recursive -- third_party/tarsier
git submodule update --init --recursive -- third_party/chameleon
premake4 gmake

Before building, you need to install libusb-1.0:

Debian / Ubuntu

Open a terminal and run:

sudo apt install libusb-1.0 # cross-platform USB API

macOS

Open a terminal and run:

brew install libusb # cross-platform USB API

If the command is not found, you need to install Homebrew first with the command:

ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

Windows

Download libusb 1.0 (Downloads > Latest Windows Binaries). After downloading and decompressing libusb-1.0.22.7z, run in the command prompt as administrator:

copy "%userprofile%\Downloads\MS32\dll\libusb-1.0.dll" "C:\Windows\SysWOW64"
copy "%userprofile%\Downloads\MS32\dll\libusb-1.0.lib" "C:\Windows\SysWOW64"
copy "%userprofile%\Downloads\MS32\dll\libusb-1.0.pdb" "C:\Windows\SysWOW64"
mkdir C:\Include\libusb-1.0
copy "%userprofile%\Downloads\include\libusb-1.0\libusb.h" "C:\Include\libusb-1.0"

You can then build the app:

cd build
make && release/dvs_viewer

The code is almost identical to that of an application reading events from a file, with the following differences:

  • the program must be linked to libusb-1.0 (premake4.lua, line 11).
  • macOS users must include Homebrew directories (premake4.lua, line 35 and 36).
  • dvs_sepia.hpp must be included instead of sepia.hpp (source/dvs_viewer.cpp, line 3). Including sepia.hpp is not required, as it is done by dvs_sepia.hpp.
  • The function dvs_sepia::make_camera must be used instead of sepia::make_observable (premake4.lua, line 40). The signature is similar, though no filename is required. Detailed documentation on the other parameters role can be found at https://github.com/neuromorphic-paris/opal_kelly_atis_sepia/wiki.
  • dvs_sepia::camera::width() and dvs_sepia::camera::height() return the sensor width and height, and can be used to replace the information provided by Event Stream headers.

An ongoing effort aims to merge all the sepia extensions into a single, user-friendly library. See https://github.com/neuromorphic-paris/sepia/issues/80 for details.

Clone this wiki locally