Unpack your camera, plug the camera in a USB 3.0 port and go to the next step. ZED cameras are all UVC compliant so they should be automatically recognized by your computer.
The ZED SDK is available for Windows, Linux and Nvidia Jetson platforms.But I personally recommend using Ubuntu under Linux.It contains all the libraries that powers your camera along with tools that let you test its features and settings.
Select your platform and follow the installation guide: Linux, Jetson,Windows.
Currently, we offer a companion SDK with Ubuntu version 18.04.
The ZED Explorer ( /usr/local/zed/tools/ZED Explorer ) is an application for ZED live preview and recording. It lets you change video resolution, aspect ratio, camera parameters, and capture high resolution snapshots and 3D video.
If the ZED is recognized by your computer, you'll see the 3D video from your camera.
The Mini-PC we provide is connected to ZED as shown in Figure 1.Since zed's Python API calls to CUDA, we had to plug in an external graphics card(eg. NVIDIA GeForce GTX 1070).We provide the MINI-PCIE card for free, in addition, you need to prepare a graphics card and independent power supply for using it.
Relevant SDK has been installed on this Mini-PC, and after the hardware connection is completed, you can directly tune to 5 Code Samples
cd path/
chmod + x ZED_SDK_Ubuntu18_v3.7.run
./ZED_SDK_Ubuntu18_v3.7.run
Setup CUDA
CUDA is an NVIDIA library used by the ZED SDK to run fast AI and computer vision tasks on your graphics card. During the ZED SDK installation, CUDA is automatically downloaded and installed by the ZED SDK if it is not detected on your computer.
sudo reboot
This section explains how to use the ZED SDK in Python 3 on Windows and Linux platforms.
python3 -m pip install cython numpy opencv-python pyopengl
cd /usr/local/zed/
python3 get_python_api.py
That's it ! The Python API is now installed. To get started, check out our Code Samples.
We only provide reference code samles at Mini-PC( /home/ubuntu/zed2/ ), specific ZED python API documentation at https://www.stereolabs.com/docs/
This tutorial shows how to get the image and depth from the ZED SDK. The program will loop until 300 frames are grabbed.
python3 Img_depth.py
Code Overview:
zed = sl.Camera()
init_params = sl.InitParameters()
init_params.camera_resolution = sl.RESOLUTION.HD1080
init_params.camera_fps = 30
err = zed.open(init_params)
if err != sl.ERROR_CODE.SUCCESS:
print('open error')
exit(1)
runtime_parameters = sl.RuntimeParameters()
runtime_parameters.sensing_mode = sl.SENSING_MODE.STANDARD
Image = sl.Mat()
dep = sl.Mat()
while len(timesp1) < FPS=300:
if zed.grab(runtime_parameters)==sl.ERROR_CODE.SUCCESS:
timestamp = zed.get_timestamp(sl.TIME_REFERENCE,CURRENT)
zed.retrieve_image(image, sl.VIEW.LEFT)
img_L = image.get_data()
zed.retrieve_image(image, sl.VIEW.RIGHT)
img_R = image.get_data()
zed.retrieve_image(dep,sl.VIEW.DEPTH)
dep_map = dep.get_data()
This tutorial shows how how to retreive the current point cloud.
python3 Point_cloud.py
Because the raw data takes up too much space,the ZED SDK allows you to record large video datasets using H.264, H.265 or lossless compression. The SDK uses Stereolabs SVO format to store videos along with additional metadata such as timestamp and sensor data.
python3 Record.py
python3 ExportRaw.py "path/to/file.svo"
Usage:
python3 Export.py A B C
Please use the following parameters from the command line:
A - SVO file path (input) : "path/to/file.svo"
B - mp4 file path (output) or image sequence folder(output) :
"path/to/output/file.mp4" or "path/to/output/folder"
C - Export mode: 0=Export LEFT+RIGHT mp4.
1=Export LEFT+DEPTH_image mp4.
2=Export LEFT+RIGHT image sequence.
3=Export LEFT+DEPTH_image sequence.
4=Export LEFT+DEPTH_image+Point_cloud sequence.
A and B need to end with '/' or '\'
Examples:
(mp4 LEFT+RIGHT): python3 Export.py "path/to/file.svo" "path/to/output/file.mp4" 0
(mp4 LEFT+DEPTH): python3 Export.py "path/to/file.svo" "path/to/output/file.mp4" 1
(SEQUENCE LEFT+RIGHT): python3 Export.py "path/to/file.svo" "path/to/output/folder" 2
(SEQUENCE LEFT+DEPTH): python3 Export.py "path/to/file.svo" "path/to/output/folder" 3
(SEQUENCE LEFT+DEPTH+POINT): python3 Export.py "path/to/file.svo" "path/to/output/folder" 4