← Back

ofxSiliconRetina

github.com/federicohyo/ofxSiliconRetina · @federicohyo
OF 0.12 Releases Hardware Interface Video/Camera

openFrameworks addon for interfacing to the Dynamic Vision Sensors. This addon is a basic logger and player for the DAVIS/DVS sensors family

8 1 Last commit 4mo ago Created 9y ago

README

ofxDVS



An openFrameworks addon for interfacing Dynamic Vision Sensor (DVS / event) cameras with built-in neural-network inference pipelines for real-time object detection and gesture recognition.

Features



Supported Cameras



FamilyModelsResolution
DVS128DVS128128 x 128
DAVISDAVIS128, DAVIS208, DAVIS240A/B/C, DAVIS346A/B/Cbsi, DAVIS640, DAVISHet640varies
DVXplorerDVXplorer640 x 480
Select the camera family by setting the #define flags in src/ofxDVS.hpp (DAVIS, DVS128, or DVXPLORER).

Dependencies



Bundled (in libs/)



External (system / OF addons)



DependencyTypeNotes
openFrameworks 0.12.0FrameworkLinux 64-bit tested
dv-processingSystem libraryCamera I/O (dv::io::camera)
ofxDatGuiOF addonGUI panels
ofxFFmpegRecorderOF addonMP4 video recording (requires system ffmpeg)
ofxGuiOF addon (core)Additional GUI elements
ofxPocoOF addon (core)Networking utilities
ofxNetworkOF addon (core)Network I/O

Installation



1. Clone or copy this addon into openFrameworks/addons/ofxDVS/. 2. Install dv-processing system-wide (follow their build instructions). 3. Install ofxDatGui into openFrameworks/addons/. 4. Install ofxFFmpegRecorder into openFrameworks/addons/. 5. Make sure ffmpeg is installed system-wide (sudo apt install ffmpeg on Ubuntu). 6. The bundled libcaer and onnxruntime libraries are in libs/. If they don't match your architecture, rebuild and copy them there.

Building the Example



cd example_dvs
make
make run


Or use the openFrameworks Project Generator to create an IDE project that includes ofxDVS and ofxDatGui.

Architecture



src/
  ofxDVS.hpp / .cpp              Core addon class (camera I/O, event processing, draw, GUI)
  dvs_yolo_pipeline.hpp / .cpp   YOLO detection pipeline (VTEI build, inference, NMS, drawing)
  dvs_tsdt_pipeline.hpp / .cpp   TSDT gesture pipeline (event history, tensor build, inference)
  dvs_nn_utils.hpp               Shared NN utilities (sigmoid, NMS, letterbox transforms)
  dvs_gui.hpp / .cpp             NN and tracker GUI panel creation + event handlers
  dvs_inference_worker.hpp       Thread-safe async inference worker (template)
  onnx_run.hpp / .cpp            ONNX Runtime wrapper (load, run, FP16 support)
  RectangularClusterTracker.hpp / .cpp   Event-driven cluster tracker
  ofxDvsPolarity.hpp             Polarity event data structures


Event Reconstruction



The addon includes real-time event-driven image reconstruction. Since DVS cameras only output per-pixel brightness changes (not absolute intensity), this feature integrates events over time to reconstruct a continuous image of the scene.

How it works: GUI controls:
SliderRangeDescription
Recon Decay0.90 – 1.0Per-frame decay factor. Lower = faster fade, higher = longer trails
Recon Contrib0.01 – 0.5Intensity added per event. Higher = brighter pops
Recon Spread1 – 8Spatial spread radius in pixels. Higher = softer bleed
Toggle Recon Image in the GUI to enable/disable.

Video Recording



The addon can record the viewer output to MP4 video using ffmpeg. Controls are in the >> Video Output folder on the NN panel.

Button / SliderDescription
START / STOP RECORDING MP4Begin or end recording. Output: bin/data/dvs_video_<timestamp>.mp4
PAUSE / RESUME RECORDINGPause recording without starting a new file
REC FPSFrame rate for the output video (10 &ndash; 60, default 30)
Workflow for stitching multiple AEDAT files into one video: start recording, load the first file, pause, load the next file, resume, and so on. Click STOP when done.

Hotkeys



KeyAction
cToggle GUI visibility
GUI toggles and sliders control all other functionality (DVS, APS, IMU, tracker, NN, recording, etc.) via the panel interface.

ONNX Models



Place model files in example_dvs/bin/data/. The code loads:

Build Notes for Ubuntu 20.04 + OF 0.12.1



Building on Ubuntu 20.04 requires several adjustments due to toolchain and library version differences.

Prerequisites



# g++-13 (dv-processing 2.0.3 requires C++20)
sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y
sudo apt-get install -y g++-13

Inivation PPA for dv-processing and boost-inivation

sudo add-apt-repository ppa:inivation-ppa/inivation -y sudo apt-get install -y dv-processing boost-inivation

OF dependency fix: libssl3 does not exist on 20.04

In scripts/linux/ubuntu/install_dependencies.sh, replace libssl3 with libssl1.1

Install onnxruntime (bundled in libs/onnxruntime/)

sudo cp libs/onnxruntime/libonnxruntime.so /usr/local/lib/ sudo rm /usr/local/lib/libonnxruntime.so /usr/local/lib/libonnxruntime.so.1 sudo ln -s libonnxruntime.so.1.20.0 /usr/local/lib/libonnxruntime.so.1 sudo ln -s libonnxruntime.so.1 /usr/local/lib/libonnxruntime.so sudo ldconfig


C++ Standard Conflict



OF 0.12.1 detects the system gcc (v9) and sets -std=c++17, but dv-processing requires C++20. The example_dvs/Makefile appends CXXFLAGS += -std=gnu++20 after including the OF build system so the last -std= flag wins.

fmt Version Mismatch



OF 0.12.1 bundles fmt v11 headers but Ubuntu 20.04 only has libfmt.so.9. This causes linker errors for fmt::v11::* symbols. Fixed by adding -DFMT_HEADER_ONLY to PROJECT_CFLAGS in example_dvs/config.make.

Inivation Boost



dv-processing depends on boost-inivation (>= 1.80) installed at /opt/inivation/boost/include. The system boost 1.71 lacks required headers (boost/endian.hpp, boost/nowide/). Added -I/opt/inivation/boost/include to PROJECT_CFLAGS.

C++20 Namespace Fixes



g++-13 with C++20 is stricter about unqualified names from std::. The following were fixed:

License



MIT License &mdash; Copyright (c) 2017 Federico Corradi

Get this addon

HTTPS
SSH

Latest release

0.1 Version 0.1 published 9y ago
First release of code

controlling speed playback us precision showing the time 3d mesh now shows pixels coordinates and us legend GUI with buttons background activity filter Image generator filter
  • APS/DVS/IMU on / off buttons