OpenNI-Reading and Processing Depth Data Author: 鄭暐達
Introduction
SDK version: OpenNI SDK v Sensor driver: OpenNI-Compliant Sensor Driver v Middleware: NiTE v Download: 2/#.UZLzTKL-EhI 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
Overview Context Depth generator User generator Skeleton capability
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:
Demo Time Schedule SIFT homework demo schedule is on the web Please fill up the schedule before demo