Skip to content

aflyingnoob/zed-python

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Stereolabs ZED - Python Integration (beta)

This package lets you use the ZED stereo camera in Python 3.

Getting started

Prerequisites

Please check your python version with the following command. The result should be 3.5 or higher.

python --version

Cython and Numpy can be installed via pip.

python -m pip install cython numpy

Note: On Linux, it is advised to use the python3 command instead of python which by default point to python 2.7. To do so, the following packages python3-dev and python3-pip need to be installed.

python3 --version
pip3 install -r requirements.txt

Build the plugin

python setup.py build
python setup.py install

or on Linux

python3 setup.py build
python3 setup.py install

If an error occurs during the compilation, make sure that you're using the latest ZED SDK and that you installed an x64 version of python. python -c "import platform; print(platform.architecture())"

The packages .pyd for Windows or .so for Linux will be generated and installed.

You can use python setup.py cleanall to remove every cpp files generated and build directory.

Make sure to be out of the plugin driectory when using it. It will prevent Python from considering the pyzed folder of the plugin as the pyzed package.

Use the plugin

Code

Import the packages in your Python terminal or file like this:

import pyzed.camera as zcam
import pyzed.core as mat
import pyzed.defines as sl
import pyzed.types as types
import pyzed.mesh as mesh
import numpy as np

Vectors operations like norm, sum, square, dot, cross, distance but also simple operations can be done with Numpy package.

Note: *pyzed.camera is linked with pyzed.core and pyzed.mesh packages so you must import pyzed.camera before pyzed.core and pyzed.mesh to avoid import errors.

Run the tutorials

The tutorials provide simple projects to show how to use each module of the ZED SDK. For a similar version using the C++ API checkout the Cpp tutorials.

Run the examples

Please refer to the examples README for more informations.

Contributing

This is a beta version of the wrapper. Feel free to open an issue if you find a bug, or a pull request for bug fixes, features or other improvements.

About

Python 3 wrapper for the ZED SDK

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 95.4%
  • C++ 4.6%