Code Monkey home page Code Monkey logo

ofxkuzed's Introduction

#ofxKuZed Addon for working with StereoLab ZED camera in openFrameworks.

Addon videos:

ZED camera is a passive stereo camera, allowing to obtain depth data on sunlight at distance 20 meters.

##Addon's features

  • It wraps all basic camera settings such as resolution, fps and depth computing quality
  • It provides CPU-access to:
    • left and right rectified RGB images (as ofPixels, ofTexture)
    • depth data in millimeters (as ofFloatPixels, ofPixels, ofTexture)
    • point cloud with colors (as vectors of ofPoint and ofColor)
  • It uses "lazy" updating of all pixel arrays and textures: they are updated only by request to save CPU resources.
  • It includes an example '''zedExample''', demonstrating work with RGB and depth images, and point cloud from camera.

zedCamera

##Compiled example Binaries of the compiled example are here: https://sourceforge.net/projects/ofxkuzed-zedexample/

(Windows, Visual Studio 2015 Community C++, openFrameworks 0.9.3)

##Simple usage:

In ofApp.h:

	...
	#include "ofxKuZed.h"
	...
	class ofApp {
		...
		ofxKuZed zed;
		...
	};

In ofApp.cpp:

ofApp::setup() {
		zed.setResolution(ZED_RESOLUTION_HD720);
		zed.setFps(30);			
		//see zed.set... functions for more settings
		zed.init();
	}

	void ofApp::update() {
		zed.update();
		//ofPixels &left = zed.getLeftPixels();	//access to left image colors
		//ofFloatPixels &depth_mm = zed.getDepthPixels_mm(); //access to depth
		//vector<ofPoint> &points = zed.getPointCloud();	//access to point cloud
	}

	void ofApp::draw()	{
		float W = ofGetWidth();
		float H = ofGetHeight();
		ofSetColor(255);
		//zed.drawLeft(0, 0);	//draw left color image, it's synced with depth image
		zed.drawDepth(0, H / 2, W / 2, H / 2, 0, 5000);	//0 and 5000 - depth range to draw as white and black

		//To draw point cloud: 
		//Define "ofEasyCam easyCam" in ofApp class
		//ofEnableDepthTest();
		//easyCam.begin();
		//ofSetColor(255);
		//zed.drawPointCloud();
		//easyCam.end();
		//ofDisableDepthTest();
	}

##Advanced usage

See an example '''zedExample''' distributed with addon, and '''ofxKuZed.h''' file.

##Requirements Currently addon is tested on Windows 10.

To compile the addon's example you need:

  • Windows

  • Installed Microsoft Visual Studio 2015 Community C++

  • openFrameworks 0.9.3

  • Installed Cuda 7.5 (and NVidia videocard) https://cloud.mail.ru/public/79z4/164HTQkeq

    If you are using another CUDA:

     Write proper path in parameter <CUDA_DIR> in file '''zedExample.vcxproj'''
    
  • Installed ZED SDK (example project is configured for '''ZED_SDK_WinSetup_v1.0.0c.exe''') https://cloud.mail.ru/public/8Luw/yPxdYh91A

    If you are using older ZED SDK, you need:

     Write proper path in <ZED_SDK_DIR> in file''' zedExample.vcxproj''',
    
     Adjust project's properties to valid paths and libs names in the following settings:
     - C/C++ - General - Additional include directories
     - Linker - General - Additional library directories
     - Linker - Input - Additional dependencies
    

To run the example you need:

  • ZED camera
  • USB 3.0 is preferrable (camera works with USB 2.0 too, but slower)

##Credits The addon is based on

Addon is written by Kuflex lab, https://github.com/kuflex/ofxKuZed

###TODOs:

  • Port to Linux
  • Implement settings for RGB images (brightness, contrast)
  • Implement masking using GPU
  • Implement recording/playing SVO

ofxkuzed's People

Contributors

perevalovds avatar

Watchers

James Cloos avatar Daniel Buzzo 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.