Giter VIP home page Giter VIP logo

zed-opencv's Introduction

Stereolabs ZED - OpenCV

This sample shows how to interface the ZED SDK and OpenCV to acquire and display ZED stereo images and depth map.

Getting started

Prerequisites

Build the program

Download the sample and follow these instructions:

Build for Windows

  • Create a "build" folder in the source folder
  • Open cmake-gui and select the source and build folders
  • Generate the Visual Studio Win64 solution
  • Open the resulting solution and change configuration to Release
  • Build solution

Build for Linux

Open a terminal in the sample directory and execute the following command:

mkdir build
cd build
cmake ..
make

Run the program

  • Navigate to the build directory and launch the executable file

  • Or open a terminal in the build directory and run the sample :

      ./ZED\ with\ OpenCV [path to SVO file]
    

You can optionally provide an SVO file path (recorded stereo video of the ZED)

Features

This sample is the perfect place to get started coding with the ZED. It shows how to use the basic functions of the ZED SDK:

  • Capture stereo video from the ZED or an SVO file.
  • Capture depth map as a compatible 32bits float OpenCV matrix.
  • Display stereo video in several viewing modes: raw, rectified, grayscale, anaglyph, overlay, difference and side-by-side.
  • Display disparity and depth map.
  • Adjust several depth parameters: depth sensing mode, max range, depth confidence.

To learn how to add camera tracking capabilities, see the dedicated tracking sample.

Keyboard shortcuts

This table lists keyboard shortcuts that you can use in the sample application.

Parameter Description Hotkey
Left image view Display left rectified RGB image. '0'
Right image view Display right rectified RGB image. '1'
Side by Side view Display the left and right images side by side. '2'
Overlay view Display overlay view. '3'
Difference view Display difference view. '4'
Anaglyph view Display anaglyph view. '5'
Depth view Toggle between disparity / depth map display. 'd'
Confidence view Display depth map confidence. The confidence value is mapped between 0 (high confidence threshold, sparse data) and 100 (low confidence threshold, dense data). 'c'
Confidence threshold Increase/Decrease depth map confidence threshold. 'b'/'n'
Sensing mode Toggle between STANDARD sensing mode (faster, should be used by most applications) / FILL (fully dense and filtered depth map). 's'
Exit Quit the application. 'q'

Limitations

  • For simplicity's sake, this sample uses GPU->CPU data transfer to retrieve and display the images with OpenCV.
  • For optimal performance, we recommend using a direct device to device copy of the ZED SDK GPU buffer to OpenGL buffer, rather than using the CPU as an intermediate.

zed-opencv's People

Contributors

adujardin avatar

Watchers

James Cloos avatar Chenhan Jiang 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.