Coder Social home page Coder Social logo

zed-python-api's Introduction

Stereolabs ZED - Python API

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

Stable API notice

The ZED Python API is now stable but has some breaking changes from the previous (beta) version. The older beta version can be found in the legacy branch.

The changes were made to better reflect the C++ API and ease of use. Mainly all classes have a similar name to the C++ SDK (without the "Py" prefix), and all components were migrated to a unified sl namespace.

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.sl as sl

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

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

Feel free to open an issue if you find a bug, or a pull request for bug fixes, features or other improvements.

zed-python-api's People

Contributors

adujardin avatar nesnes avatar abastie avatar ajtrask avatar kctess5 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.