

This file is referred to as a MEX file, it re-implements the majority of the ZED SDK functions in Matlab. In this directory, you will find a mex subfolder with a ‘mexZED.cpp’ file which contains the ZED SDK functions and the interface with Matlab. src: Contains all the files needed to build the Mex file wrapping the SDK functions.matlab: Contains Matlab examples ZED_Camera.m, ZED_Tracking.m and ZED_PointCloud.m that demonstrate the use of the ZED SDK features in Matlab.The Matlab interface contains the following directories: ZED Matlab interface available on GitHub.Matlab (tested with R2012b and R2014b versions).Here we use the ability of Matlab to execute C++ code through an intermediate file called MEX file.
#Matlab and simulink in depth how to
The purpose of this section is to explain how to use the ZED and its SDK to capture depth and motion tracking in Matlab.

Image_right = img(:, width/2 +1: width, :) Īs a result, you should see the left and right images in the same window. % Split the side by side image image into two images % Create Figure and wait for keyboard interrupt to quitį = figure('name','ZED camera','keypressfcn','close','windowstyle','modal') Zed.Resolution = zed.AvailableResolutions Here is a code snippet that demonstrates how to open the ZED, grab side-by-side images and split them into left and right images: clear all close all clc Now, in the Matlab Command Window, enter: When the setup process is finished, uncheck the “Show support package examples” check box and click on Finish. Package installation can take around 10-15 seconds.
#Matlab and simulink in depth software license
Go through the MathWorks auxiliary software license agreement. Matlab will ask for your MathWorks account credentials. A dialog window should appear that prompts you to install a package to support video acquisition with USB cameras:Ĭlick Next and Log In. If you encounter the error, click on the link in the error log. Open Support Package Installer to install the Webcam Support Package. MATLAB Support Package for Webcams has not been installed.

You should encounter this error if you’ve never used Matlab with a webcam before: Error using webcamlist (line 20) Open Matlab and in the Command Window, enter this command: > webcamlist Even if you’re new to Matlab, this tutorial should be easy to follow. You must have a MathWorks account (free) and Matlab installed on your system. To get the rectified video and depth, see the second part of this tutorial. This section shows how to open the camera in Matlab and display the raw (unrectified) video feed. The second part explains how to get depth, point cloud and positional tracking data. The first part shows how to capture video with the camera in Matlab. This tutorial is intended for those who want to use the ZED with Matlab.
