OpenNI-Reading and Processing Depth Data

Report
OpenNI-Reading and Processing
Depth Data
Author: 鄭暐達
Introduction
Introduction




SDK version: OpenNI SDK v1.5.4.0
Sensor driver: OpenNI-Compliant Sensor Driver v5.1.2.1
Middleware: NiTE v1.5.2.21
Download:
http://www.openni.org/openni-sdk/openni-sdk-history2/#.UZLzTKL-EhI
Production Node

Sensor related nodes:




Device
Depth generator
Other generator
Middleware related nodes:


User generator
Other gerenator
Capability

Optional extension to the API

Provide additional functionality

Different production node support different capability

Ex. Skeleton, Alternative view, Pose detection, etc.
Getting Started

Download and install OpenNI first.

Download and install sensor driver and middleware.

Try to run the samples in the OpenNI directory.

OpenNI\samples\bin\

If success, then install is complete

If not, google the error message or try to reinstall.

You can use cmd to run the samples to see the error
messages
Overview
Context
Depth
generator
User generator
Skeleton
capability
Retrieving Depth Data

Context initialize


Create depth generator





mapMode.nXRes = 320;
mapMode.nYRes = 240;
mapMode.nFPS = 30;
xDepth.SetMapOutputMode(mapMode);
Start generating context


xDepth.Create( xContext );
Resolution and fps configuration


xContext.Init();
xContext.StartGeneratingAll();
Loop


Data update
Grab data from depth generator


xDepth.GetMetaData( xDepthData );
Data processing.
Finding Skeleton Position


Context initialize
Create user generator


Setup callback functions for skeleton capability



g_UserGenerator.Create(xContext);
PoseDetected, NewUser, UserLost,etc.
g_UserGenerator.RegisterUserCallbacks( NewUser, LostUser,
NULL, hUserCB );
Loop


Data update
Get skeleton joint position from user generator using capability.

mSC.GetSkeletonJointPosition( UserID, XN_SKEL_HEAD,
mJointPos[0] );
Reference


OpenNI user guide
Heresy’s space:

http://kheresy.wordpress.com/
Demo Time Schedule


SIFT homework demo schedule is on the web
Please fill up the schedule before demo

similar documents