110 likes | 318 Views
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-history-2/#.UZLzTKL-EhI.
E N D
OpenNI-Reading and Processing Depth Data Author: 鄭暐達
Introduction • SDK version: OpenNI SDK v1.5.4.0 • Sensor driver: OpenNI-Compliant Sensor Driver v5.1.2.1 • Middleware: NiTEv1.5.2.21 • Download: http://www.openni.org/openni-sdk/openni-sdk-history-2/#.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
Retrieving Depth Data • Context initialize • xContext.Init(); • Create depth generator • xDepth.Create( xContext); • Resolution and fps configuration • mapMode.nXRes = 320; • mapMode.nYRes = 240; • mapMode.nFPS = 30; • xDepth.SetMapOutputMode(mapMode); • Start generating context • xContext.StartGeneratingAll(); • Loop • Data update • Grab data from depth generator • xDepth.GetMetaData( xDepthData); • Data processing.
Finding Skeleton Position • Context initialize • Create user generator • g_UserGenerator.Create(xContext); • Setup callback functions for skeleton capability • 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