PyDepthEye
A simple Python binding for Seeed Studio DepthEye camera
Building
Currently, the program can only be built on Ubuntu 16.04.
Building and installing Boost
- Download and extract the boost libraries: `curl -L https://dl.bintray.com/boostorg/release/1.70.0/source/boost_1_70_0.tar.gz | tar xz
- Install system dependencies:
sudo apt install -y python-dev build-essential git-core python-numpy
- Prepare to build the boost libaries:
cd boost_1_70_0 && ./bootstrap.sh
- Build boost libraries:
./b2 --with-python
- Install boost libraries:
sudo ./b2 --with-python install
- Run
sudo ldconfig
Setting up DepthCam dependencies
- Clone the DepthEye SDK:
git clone https://github.com/pointcloud-ai/DepthEyeSdk.git
- Set up an environment variable to point to the installation dir:
export VOXEL_SDK_PATH=${HOME}/DepthEyeSdk/third_party/voxelsdk_ubuntu_4.13
Building
- Clone the PyDepthEye repository:
git clone https://github.com/avishorp/PyDepthEye.git
. - Build:
cd PyDepthEye && make
. The process should complete with module nameddepth_eye.so
.
Using the module
To use the Python module, voxel SDK libraries must be in the path. This can be either be done by copying the libraries to a system library directory, or by setting LD_LIBRARY_PATH prior to execution of Python. Instructions are available at the PyDepthSdk repository README file.
Basic Example
import sys
import depth_eye
def frame_cb(phase, amplitude):
# Phase and amplitude images are available here
# as numpy arrays. Each array is 80x60. The value
# of each pixel ranges between 0 to 2047
pass
devices = depth_eye.scan()
print("Found %d devices" % len(devices))
if (len(devices) == 0):
print("No device found, exiting")
sys.exit(1)
# If multiple devices are connected, select one here
selected = devices[0]
frame_rate = 100
c = depth_eye.capture(selected, frame_cb, frame_rate)