This library contains some utilities to build an event-based retina with open hardware such as a Raspberry Pi along with its camera module, your laptop's webcam or a (test) video.
The goal is to setup an event-based image processing scheme with the following priorities:
The architecture is based on the client (e.g. the Raspberry Pi, your local computer) grasping images and transforming them into events which are then transferred through the network.
pip3 install git+https://github.com/laurentperrinet/openRetina
Do not forget to setup the IP address of your RPi on the network.
The openRetina
library needs some dependencies to run:
numpy
(http://numpy.scipy.org/),zeromq
(http://zeromq.org/),vispy
is dedicated to the visualization of the numpy
array,IPython
(http://ipython.scipy.org/) for running interactive sessionsmatplotlib
(http://matplotlib.org/) and scipy
(http://www.scipy.org/) as well but this is optional.On the client, if you use a Raspberry Pi, you should need to only setup picamera
(and its dependencies) and on a local machine, you should need opencv
(to grab images from the webcam) or imageio
to read local video files.
On the π, use:
bash -c "$(curl -fsSL https://raw.githubusercontent.com/laurentperrinet/config-scripts/master/raspbian-setup.sh)"
sudo apt-get install python3-picamera
on your server
python photoreceptors.py
on your RaspberryPi:
python retina.py
The part of the code for the raspberry client heavily relies on the excellent examples by Dave Jones @ http://picamera.readthedocs.org