Git Product home page Git Product logo

zed-matlab's Introduction

Stereolabs ZED - Matlab Integration

This sample shows how to use the ZED SDK functionalities within Matlab.

Getting started

Prerequisites

  • Windows 7 64bits or later, Ubuntu 16.04
  • Matlab with MEX compiler installed
  • ZED SDK and its dependency (CUDA)

Build the program

Build for Windows

For detailed installation instructions, check out our blog post.

Build for Linux

Download the sample and execute the following command in a terminal:

export MATLAB_ROOT=/usr/local/MATLAB/R2012b # Put your actual Matlab path here
mkdir build
cd build
cmake ../src
make
make install

Run the program

In the Matlab directory, open the file ZED_Camera.m with Matlab and press run. Press any key to exit the program.

Features

This sample is split into 3 parts, each of them shows a specific feature of the ZED SDK in Matlab.

  1. ZED_Camera.m :

    In this part, we first initialize the ZED Camera and then retrieve both stereo images (Left and Right) as well as the depth data (32-bits float buffer) and the depth image normalized to 8-bits (grayscale). Then, with Matlab, we compute the depth histogram from the depth data values and display it.

    Drawing
  2. ZED_Tracking.m :

    This part shows how to get the positional tracking information. First, we initialize the ZED camera and the tracking, then we display the current left image as well as all the positions of the camera.

    Drawing
  3. ZED_PointCloud.m :

    This part shows how to initialize the ZED camera and retrieve for each frame the current point cloud (X,Y,Z) of the scene. Then we use the mesh function of Matlab to display it.

    Drawing

Limitations

This sample application is not designed to run in real time

Troubleshooting

On Linux, If you get the following error :

 /usr/local/MATLAB/R2014a/bin/glnxa64/../../sys/os/glnxa64/libstdc++.so.6: version `GLIBCXX_3.4.21` not found

Launch matlab with LD_PRELOAD:

LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.21:/usr/lib/x86_64-linux-gnu/libfreetype.so.6 matlab&

You can also create an alias in a bash terminal (just once) to simplify the launch:

echo "alias matlab=LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.21:/usr/lib/x86_64-linux-gnu/libfreetype.so.6 matlab&" >> ~/.bashrc

Then just launch the application by typing:

matlab

zed-matlab's People

Contributors

nesnes avatar p-yver avatar adujardin avatar

Watchers

zwb 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.