Kinect Tutorial
Nicholas Gillian
Responsive Environments, MIT Media Lab
Thursday, September 12th, 2013
Thursday, September 12, 13
Kinect
RGB Camera
3D Depth Sensors
•Depth map is constructed by analyzing a speckle pattern
of infrared laser light
•Body position is inferred using machine learning
•Kinect uses structured light
Thursday, September 12, 13
Kinect
•Structured light: project a known pattern onto the scene
and infer depth from the deformation of that pattern
Jason Geng, Structured-light 3D surface imaging: a tutorial,
Advances in Optics and Photonics,Vol. 3, Issue 2, pp. 128-160 (2011)
Zhang et al, 3DPVT (2002)
Thursday, September 12, 13
Kinect
•Kinect uses an astigmatic lens with different focal length
in x- and y directions
•The lens causes a projected circle to become an ellipse
whose orientation depends on depth
Thursday, September 12, 13
Kinect
•The Kinect also uses parallax, i.e. if you look at a scene
from different angle, things that are closer get shifted to
the side more than things that are far away
•The Kinect analyzes the shift of the speckle pattern by
projecting from one location and observing from another
3D Depth Sensors
Thursday, September 12, 13
Kinect
•Body position is inferred using machine learning
Jamie Shutton et. al, Real-Time Human Pose Recognition in Parts from Single Depth Images, CVPR, 2011
Thursday, September 12, 13
Kinect
•Body position is inferred using machine learning
100K poses 1 million training samples
Jamie Shutton et. al, Real-Time Human Pose Recognition in Parts from Single Depth Images, CVPR, 2011
Thursday, September 12, 13
Kinect
•Randomized Decision Forests
The probability of pixel u
belonging to body part c is:
Jamie Shutton et. al, Real-Time Human Pose Recognition in Parts from Single Depth Images, CVPR, 2011
Thursday, September 12, 13
Kinect
•Features
Jamie Shutton et. al, Real-Time Human Pose Recognition in Parts from Single Depth Images, CVPR, 2011
Thursday, September 12, 13
Kinect Libraries, APIs & Tools
•OpenNI SDK
•Openframeworks
•Microsoft Official Kinect SDK
•Synapse
Thursday, September 12, 13
OpenNI - Installation
•OpenNI
•NITE
•Sensor Kinect
Thursday, September 12, 13
OpenNI - Data
RGB Image Depth Image
Label Image
[640 480]
Depth: Unsigned short
Label: Unsigned short
RGB: Unsigned char
Thursday, September 12, 13
OpenNI - Generators
XnGenerator
AudioGenerator GestureGenerator HandsGenerator UserGenerator ...
//For example
DepthGenerator depthGenerator;
ImageGenerator imageGenerator;
Thursday, September 12, 13
OpenNI - Configuration
<OpenNI>
	

 <Licenses>
	

 	

 <License vendor="PrimeSense" key="0KOIk2JeIBYClPWVnMoRKn5cdY4="/>
	

 </Licenses>
	

 <Log writeToConsole="true" writeToFile="false">
	

 	

 <!-- 0 -Verbose, 1 - Info, 2 - Warning, 3 - Error (default) -->
	

 	

 <LogLevel value="3"/>
	

 	

 <Masks>
	

 	

 	

 <Mask name="ALL" on="false"/>
	

 	

 </Masks>
	

 	

 <Dumps>
	

 	

 </Dumps>
	

 </Log>
	

 <ProductionNodes>
	

 	

 <Node type="Depth">
	

 	

 	

 <Configuration>
	

 	

 	

 	

 <Mirror on="true"/>
	

 	

 	

 </Configuration>
	

 	

 </Node>
	

 	

 <Node type="Image" stopOnError="false" />
	

 	

 <Node type="User" />
	

 </ProductionNodes>
</OpenNI>
This key is common
PrimeSense key
Enable the depth camera
Enable the RGB camera
Enable the user tracker
Thursday, September 12, 13
OpenNI - Manual Configuration
XnStatus nRetVal = context.FindExistingNode(XN_NODE_TYPE_DEPTH, depthGenerator);
Thursday, September 12, 13
OpenNI - Manual Configuration
XnStatus nRetVal = context.FindExistingNode(XN_NODE_TYPE_DEPTH, depthGenerator);
if (nRetVal != XN_STATUS_OK){
xn::MockDepthGenerator mockDepth;
nRetVal = mockDepth.Create(context);
// set some defaults
XnMapOutputMode defaultMode;
defaultMode.nXRes = 640;
defaultMode.nYRes = 480;
defaultMode.nFPS = 30;
nRetVal = mockDepth.SetMapOutputMode(defaultMode);
// set FOV
XnFieldOfView fov;
fov.fHFOV = 1.0225999419141749;
fov.fVFOV = 0.79661567681716894;
nRetVal = mockDepth.SetGeneralProperty(XN_PROP_FIELD_OF_VIEW, sizeof(fov), &fov);
XnUInt32 nDataSize = defaultMode.nXRes * defaultMode.nYRes * sizeof(XnDepthPixel);
XnDepthPixel* pData = (XnDepthPixel*)xnOSCallocAligned(nDataSize, 1, XN_DEFAULT_MEM_ALIGN);
nRetVal = mockDepth.SetData(1, 0, nDataSize, pData);
CHECK_RC(nRetVal, "set empty depth map");
depthGenerator = mockDepth;
}
Thursday, September 12, 13
OpenNI - Accessing Data
// Read next available data
context.WaitOneUpdateAll( userGenerator );
userSelector->UpdateFrame();
//Variables
UserGenerator userGenerator;
Context context;
Thursday, September 12, 13
OpenNI - Get the depth data
//Get the latest depth and image meta data
depthGenerator.GetMetaData( depthMD );
//Get a pointer to the depth data
const XnDepthPixel* pDepth = depthMD.Data();
//Loop over the depth pixels
for (XnUInt y = 0; y < depthMD.YRes(); y++){
for (XnUInt x = 0; x < depthMD.XRes(); x++){
//Access the current depth value
*pDepth;
//Increase the depth pixel
pDepth++;
}
}
//Variables
DepthGenerator depthGenerator;
DepthMetaData depthMD;
Thursday, September 12, 13
OpenNI - Get the RGB data
//Get the latest image meta data
imageGenerator.GetMetaData( imageMD );
//Get a pointer to the image data
const XnRGB24Pixel* pImage = imageMD.RGB24Data();
//Loop over the image pixels
for (XnUInt y = 0; y < imageMD.YRes(); y++){
for (XnUInt x = 0; x < imageMD.XRes(); x++){
//Access the current pixel value
* pImage;
//Increase the pixel pointer
pImage++;
}
}
//Variables
ImageGenerator imageGenerator;
ImageMetaData imageMD;
Thursday, September 12, 13
OpenNI - Skeleton data
//Variables
UserGenerator userGenerator;
XnUserID userIDs[ numTrackedUsers ];
XnUInt16 numUsers = userGenerator->GetNumberOfUsers();
userGenerator->GetUsers(userIDs, numUsers);
for( int i=0; i < numUsers; i++ ){
if( userGenerator->GetSkeletonCap().IsTracking( userIDs[i] ) ){
XnPoint3D userCenterOfMass;
userGenerator->GetSkeletonCap().IsCalibrating( userIDs[i] );
userGenerator->GetSkeletonCap().IsCalibrated( userIDs[i] );
userGenerator->GetCoM( userIDs[i], userCenterOfMass );
XnSkeletonJointTransformation jointData;
if( userGenerator->GetSkeletonCap().IsJointAvailable( XN_SKEL_HEAD ) ){
userGenerator->GetSkeletonCap().GetSkeletonJoint(userIDs[i], XN_SKEL_HEAD, jointData );
}
}
}
Thursday, September 12, 13
Kinect Gesture Recognition
Thursday, September 12, 13
SUPERVISED LEARNING
Thursday, September 12, 13
Supervised Learning
Training Data
Thursday, September 12, 13
Supervised Learning
Training Data
Thursday, September 12, 13
Supervised Learning
Input Vector
Training Data
Thursday, September 12, 13
Supervised Learning
Input Vector
Training Data
{Feature Vector}
Thursday, September 12, 13
Supervised Learning
Input Vector
Training Data
{Feature Vector}
Feature
Thursday, September 12, 13
Supervised Learning
Input Vector
Training Data
{Feature Vector}
Feature
{Attribute}
Thursday, September 12, 13
Supervised Learning
Input Vector Target Vector
Training Data
Thursday, September 12, 13
Supervised Learning
Learning Algorithm
Input Vector Target Vector
Training Data
Thursday, September 12, 13
Supervised Learning
Learning Algorithm
Model
Input Vector Target Vector
Training Data
Thursday, September 12, 13
Supervised Learning
Learning Algorithm
Prediction
New Datum
Model
Training Data
Thursday, September 12, 13
Supervised Learning
Learning Algorithm
Prediction
Predicted Class
Class A
Model
Training Data
New Datum
Thursday, September 12, 13
Supervised Learning
Learning Algorithm
Prediction
Predicted Class
Class A
Model
Training Data
New Datum
Thursday, September 12, 13
Kinect Gesture Recognition
Synapse
OSC
Skeleton Data
Openframeworks
www.nickgillian.com/wiki/pmwiki.php/GRT/
OpenframeworksKinectExample
Thursday, September 12, 13
Kinect Code Tutorial Slides
www.nickgillian.com/09-12-13.html
Thursday, September 12, 13

More Related Content

PDF
How Augment your Reality: Different perspective on the Reality / Virtuality C...
PDF
Programming with kinect v2
PPTX
Develop Store Apps with Kinect for Windows v2
PDF
Kinect Sensors as Natural User Interfaces
PPTX
Kinect2 hands on
PPTX
Odessa .NET User Group - Kinect v2
PDF
Kinect v2 Introduction and Tutorial
PDF
Human interface guidelines_v1.8.0
How Augment your Reality: Different perspective on the Reality / Virtuality C...
Programming with kinect v2
Develop Store Apps with Kinect for Windows v2
Kinect Sensors as Natural User Interfaces
Kinect2 hands on
Odessa .NET User Group - Kinect v2
Kinect v2 Introduction and Tutorial
Human interface guidelines_v1.8.0

What's hot (19)

PPTX
Nui e biometrics in windows 10
PDF
Kinect Hacks for Dummies
PPT
Kinect krishna kumar-itkan
PDF
Introduction to Kinect - Update v 1.8
PDF
Kinect v1+Processing workshot fabcafe_taipei
PDF
3 track kinect@Bicocca - sdk e camere
PDF
Develop store apps with kinect for windows v2
PPTX
Kinectic vision looking deep into depth
PDF
Introduction to development
PDF
PyKinect: Body Iteration Application Development Using Python
PDF
2 track kinect@Bicocca - hardware e funzinamento
PPTX
Solving Visibility and Streaming in the The Witcher 3: Wild Hunt with Umbra 3
PPT
Visibility Optimization for Games
PPT
Shadow Techniques for Real-Time and Interactive Applications
PPTX
Siggraph 2011: Occlusion culling in Alan Wake
PPT
Itcs 4120 introduction (c)
PDF
Final_draft_Practice_School_II_report
PPTX
Game Worlds from Polygon Soup: Visibility, Spatial Connectivity and Rendering
PPTX
Khronos Munich 2018 - Halcyon and Vulkan
Nui e biometrics in windows 10
Kinect Hacks for Dummies
Kinect krishna kumar-itkan
Introduction to Kinect - Update v 1.8
Kinect v1+Processing workshot fabcafe_taipei
3 track kinect@Bicocca - sdk e camere
Develop store apps with kinect for windows v2
Kinectic vision looking deep into depth
Introduction to development
PyKinect: Body Iteration Application Development Using Python
2 track kinect@Bicocca - hardware e funzinamento
Solving Visibility and Streaming in the The Witcher 3: Wild Hunt with Umbra 3
Visibility Optimization for Games
Shadow Techniques for Real-Time and Interactive Applications
Siggraph 2011: Occlusion culling in Alan Wake
Itcs 4120 introduction (c)
Final_draft_Practice_School_II_report
Game Worlds from Polygon Soup: Visibility, Spatial Connectivity and Rendering
Khronos Munich 2018 - Halcyon and Vulkan
Ad

Viewers also liked (20)

PPTX
Kinect V2: what's new!!!
PDF
Raskar UIST Keynote 2015 November
PPTX
What is Media in MIT Media Lab, Why 'Camera Culture'
PPTX
Google Glass Breakdown
PPTX
Coded Photography - Ramesh Raskar
PDF
Stereo and 3D Displays - Matt Hirsch
PPTX
Multiview Imaging HW Overview
PPTX
Leap Motion Development (Rohan Puri)
PDF
What is SIGGRAPH NEXT? Intro by Ramesh Raskar
PPT
Introduction to Camera Challenges - Ramesh Raskar
PPTX
PPTX
Raskar stanfordextremecompuimagingapr2016
PPTX
Compressed Sensing - Achuta Kadambi
PPTX
Light Field Photography Introduction
PPTX
Introduction to Photography
PPTX
Time of Flight Cameras - Refael Whyte
PDF
[PDF] the molecular control toolkit - Controlling 3D molecular graphics via g...
PPTX
Leap Motion - Aydin Akcasu
PDF
Developing "True HDR" for the iPhone
PPTX
Introduction to Light Fields
Kinect V2: what's new!!!
Raskar UIST Keynote 2015 November
What is Media in MIT Media Lab, Why 'Camera Culture'
Google Glass Breakdown
Coded Photography - Ramesh Raskar
Stereo and 3D Displays - Matt Hirsch
Multiview Imaging HW Overview
Leap Motion Development (Rohan Puri)
What is SIGGRAPH NEXT? Intro by Ramesh Raskar
Introduction to Camera Challenges - Ramesh Raskar
Raskar stanfordextremecompuimagingapr2016
Compressed Sensing - Achuta Kadambi
Light Field Photography Introduction
Introduction to Photography
Time of Flight Cameras - Refael Whyte
[PDF] the molecular control toolkit - Controlling 3D molecular graphics via g...
Leap Motion - Aydin Akcasu
Developing "True HDR" for the iPhone
Introduction to Light Fields
Ad

Similar to Kinect Tutorial (20)

PPT
Using the Kinect for Fun and Profit by Tam Hanna
PPT
First kinectslides
PPT
cs247 slides
PDF
The not so short
 
KEY
Getmoving as3kinect
DOCX
Vipul divyanshu documentation on Kinect and Motion Tracking
PPTX
Lidnug Presentation - Kinect - The How, Were and When of developing with it
PDF
Hacking the Kinect with GAFFTA Day 3
PPTX
March.2012.KinectForWindows
DOCX
Kinect installation guide
PPT
The not so short introduction to Kinect
 
PDF
4 track kinect@Bicocca - skeletal tracking
PDF
Photogrammetry for Museums, from Super-Geek to Super-Easy
PPTX
Visug: Say Hello to my little friend: a session on Kinect
PPTX
Beginning direct3d gameprogramming07_lightsandmaterials_20161117_jintaeks
PDF
Kinect for Windows SDK - Programming Guide
PDF
Dataset creation for Deep Learning-based Geometric Computer Vision problems
PPTX
Virtual Dance Game Using Kinect and ICP Algorithm
PDF
AN ENHANCEMENT FOR THE CONSISTENT DEPTH ESTIMATION OF MONOCULAR VIDEOS USING ...
PDF
An Enhancement for the Consistent Depth Estimation of Monocular Videos using ...
Using the Kinect for Fun and Profit by Tam Hanna
First kinectslides
cs247 slides
The not so short
 
Getmoving as3kinect
Vipul divyanshu documentation on Kinect and Motion Tracking
Lidnug Presentation - Kinect - The How, Were and When of developing with it
Hacking the Kinect with GAFFTA Day 3
March.2012.KinectForWindows
Kinect installation guide
The not so short introduction to Kinect
 
4 track kinect@Bicocca - skeletal tracking
Photogrammetry for Museums, from Super-Geek to Super-Easy
Visug: Say Hello to my little friend: a session on Kinect
Beginning direct3d gameprogramming07_lightsandmaterials_20161117_jintaeks
Kinect for Windows SDK - Programming Guide
Dataset creation for Deep Learning-based Geometric Computer Vision problems
Virtual Dance Game Using Kinect and ICP Algorithm
AN ENHANCEMENT FOR THE CONSISTENT DEPTH ESTIMATION OF MONOCULAR VIDEOS USING ...
An Enhancement for the Consistent Depth Estimation of Monocular Videos using ...

More from Camera Culture Group, MIT Media Lab (13)

PPTX
Raskar Sig2017 Siggraph Achievement Award Talk
PPTX
Lost Decade of Computational Photography
PPTX
God’s Eye View: Will global AI empower us or destroy us? | Ramesh Raskar
PPTX
Dont follow the rainbow: How to avoid career traps that can lead you to fail,...
PDF
Raskar PhD and MS Thesis Guidance
PDF
Making Invisible Visible, Ramesh Raskar Keynote at Embedded Vision 2019
PPTX
Augmented Surgeons: AI AR for Anatome, Raskar Aria 2019
PPTX
Geo-spatial Research: Transition from Analysis to Synthesis
PDF
Split Learning versus Federated Learning for Data Transparent ML, Camera Cult...
PPTX
Unspoken Challenges in AR and XR
PPTX
Computer Vision Introduction
PPTX
Raskar Sig2017 Siggraph Achievement Award Talk
Lost Decade of Computational Photography
God’s Eye View: Will global AI empower us or destroy us? | Ramesh Raskar
Dont follow the rainbow: How to avoid career traps that can lead you to fail,...
Raskar PhD and MS Thesis Guidance
Making Invisible Visible, Ramesh Raskar Keynote at Embedded Vision 2019
Augmented Surgeons: AI AR for Anatome, Raskar Aria 2019
Geo-spatial Research: Transition from Analysis to Synthesis
Split Learning versus Federated Learning for Data Transparent ML, Camera Cult...
Unspoken Challenges in AR and XR
Computer Vision Introduction

Recently uploaded (20)

PDF
Rapid Prototyping: A lecture on prototyping techniques for interface design
PPTX
AQUEEL MUSHTAQUE FAKIH COMPUTER CENTER .
PDF
Examining Bias in AI Generated News Content.pdf
PDF
substrate PowerPoint Presentation basic one
PPTX
AI-driven Assurance Across Your End-to-end Network With ThousandEyes
PDF
giants, standing on the shoulders of - by Daniel Stenberg
PDF
5-Ways-AI-is-Revolutionizing-Telecom-Quality-Engineering.pdf
PDF
A hybrid framework for wild animal classification using fine-tuned DenseNet12...
PDF
Transform-Your-Factory-with-AI-Driven-Quality-Engineering.pdf
PDF
The-2025-Engineering-Revolution-AI-Quality-and-DevOps-Convergence.pdf
PDF
Human Computer Interaction Miterm Lesson
PDF
EIS-Webinar-Regulated-Industries-2025-08.pdf
PPTX
Build automations faster and more reliably with UiPath ScreenPlay
PDF
Co-training pseudo-labeling for text classification with support vector machi...
PDF
zbrain.ai-Scope Key Metrics Configuration and Best Practices.pdf
PDF
Identification of potential depression in social media posts
PDF
Early detection and classification of bone marrow changes in lumbar vertebrae...
PDF
Connector Corner: Transform Unstructured Documents with Agentic Automation
PDF
NewMind AI Weekly Chronicles – August ’25 Week IV
PDF
IT-ITes Industry bjjbnkmkhkhknbmhkhmjhjkhj
Rapid Prototyping: A lecture on prototyping techniques for interface design
AQUEEL MUSHTAQUE FAKIH COMPUTER CENTER .
Examining Bias in AI Generated News Content.pdf
substrate PowerPoint Presentation basic one
AI-driven Assurance Across Your End-to-end Network With ThousandEyes
giants, standing on the shoulders of - by Daniel Stenberg
5-Ways-AI-is-Revolutionizing-Telecom-Quality-Engineering.pdf
A hybrid framework for wild animal classification using fine-tuned DenseNet12...
Transform-Your-Factory-with-AI-Driven-Quality-Engineering.pdf
The-2025-Engineering-Revolution-AI-Quality-and-DevOps-Convergence.pdf
Human Computer Interaction Miterm Lesson
EIS-Webinar-Regulated-Industries-2025-08.pdf
Build automations faster and more reliably with UiPath ScreenPlay
Co-training pseudo-labeling for text classification with support vector machi...
zbrain.ai-Scope Key Metrics Configuration and Best Practices.pdf
Identification of potential depression in social media posts
Early detection and classification of bone marrow changes in lumbar vertebrae...
Connector Corner: Transform Unstructured Documents with Agentic Automation
NewMind AI Weekly Chronicles – August ’25 Week IV
IT-ITes Industry bjjbnkmkhkhknbmhkhmjhjkhj

Kinect Tutorial

  • 1. Kinect Tutorial Nicholas Gillian Responsive Environments, MIT Media Lab Thursday, September 12th, 2013 Thursday, September 12, 13
  • 2. Kinect RGB Camera 3D Depth Sensors •Depth map is constructed by analyzing a speckle pattern of infrared laser light •Body position is inferred using machine learning •Kinect uses structured light Thursday, September 12, 13
  • 3. Kinect •Structured light: project a known pattern onto the scene and infer depth from the deformation of that pattern Jason Geng, Structured-light 3D surface imaging: a tutorial, Advances in Optics and Photonics,Vol. 3, Issue 2, pp. 128-160 (2011) Zhang et al, 3DPVT (2002) Thursday, September 12, 13
  • 4. Kinect •Kinect uses an astigmatic lens with different focal length in x- and y directions •The lens causes a projected circle to become an ellipse whose orientation depends on depth Thursday, September 12, 13
  • 5. Kinect •The Kinect also uses parallax, i.e. if you look at a scene from different angle, things that are closer get shifted to the side more than things that are far away •The Kinect analyzes the shift of the speckle pattern by projecting from one location and observing from another 3D Depth Sensors Thursday, September 12, 13
  • 6. Kinect •Body position is inferred using machine learning Jamie Shutton et. al, Real-Time Human Pose Recognition in Parts from Single Depth Images, CVPR, 2011 Thursday, September 12, 13
  • 7. Kinect •Body position is inferred using machine learning 100K poses 1 million training samples Jamie Shutton et. al, Real-Time Human Pose Recognition in Parts from Single Depth Images, CVPR, 2011 Thursday, September 12, 13
  • 8. Kinect •Randomized Decision Forests The probability of pixel u belonging to body part c is: Jamie Shutton et. al, Real-Time Human Pose Recognition in Parts from Single Depth Images, CVPR, 2011 Thursday, September 12, 13
  • 9. Kinect •Features Jamie Shutton et. al, Real-Time Human Pose Recognition in Parts from Single Depth Images, CVPR, 2011 Thursday, September 12, 13
  • 10. Kinect Libraries, APIs & Tools •OpenNI SDK •Openframeworks •Microsoft Official Kinect SDK •Synapse Thursday, September 12, 13
  • 11. OpenNI - Installation •OpenNI •NITE •Sensor Kinect Thursday, September 12, 13
  • 12. OpenNI - Data RGB Image Depth Image Label Image [640 480] Depth: Unsigned short Label: Unsigned short RGB: Unsigned char Thursday, September 12, 13
  • 13. OpenNI - Generators XnGenerator AudioGenerator GestureGenerator HandsGenerator UserGenerator ... //For example DepthGenerator depthGenerator; ImageGenerator imageGenerator; Thursday, September 12, 13
  • 14. OpenNI - Configuration <OpenNI> <Licenses> <License vendor="PrimeSense" key="0KOIk2JeIBYClPWVnMoRKn5cdY4="/> </Licenses> <Log writeToConsole="true" writeToFile="false"> <!-- 0 -Verbose, 1 - Info, 2 - Warning, 3 - Error (default) --> <LogLevel value="3"/> <Masks> <Mask name="ALL" on="false"/> </Masks> <Dumps> </Dumps> </Log> <ProductionNodes> <Node type="Depth"> <Configuration> <Mirror on="true"/> </Configuration> </Node> <Node type="Image" stopOnError="false" /> <Node type="User" /> </ProductionNodes> </OpenNI> This key is common PrimeSense key Enable the depth camera Enable the RGB camera Enable the user tracker Thursday, September 12, 13
  • 15. OpenNI - Manual Configuration XnStatus nRetVal = context.FindExistingNode(XN_NODE_TYPE_DEPTH, depthGenerator); Thursday, September 12, 13
  • 16. OpenNI - Manual Configuration XnStatus nRetVal = context.FindExistingNode(XN_NODE_TYPE_DEPTH, depthGenerator); if (nRetVal != XN_STATUS_OK){ xn::MockDepthGenerator mockDepth; nRetVal = mockDepth.Create(context); // set some defaults XnMapOutputMode defaultMode; defaultMode.nXRes = 640; defaultMode.nYRes = 480; defaultMode.nFPS = 30; nRetVal = mockDepth.SetMapOutputMode(defaultMode); // set FOV XnFieldOfView fov; fov.fHFOV = 1.0225999419141749; fov.fVFOV = 0.79661567681716894; nRetVal = mockDepth.SetGeneralProperty(XN_PROP_FIELD_OF_VIEW, sizeof(fov), &fov); XnUInt32 nDataSize = defaultMode.nXRes * defaultMode.nYRes * sizeof(XnDepthPixel); XnDepthPixel* pData = (XnDepthPixel*)xnOSCallocAligned(nDataSize, 1, XN_DEFAULT_MEM_ALIGN); nRetVal = mockDepth.SetData(1, 0, nDataSize, pData); CHECK_RC(nRetVal, "set empty depth map"); depthGenerator = mockDepth; } Thursday, September 12, 13
  • 17. OpenNI - Accessing Data // Read next available data context.WaitOneUpdateAll( userGenerator ); userSelector->UpdateFrame(); //Variables UserGenerator userGenerator; Context context; Thursday, September 12, 13
  • 18. OpenNI - Get the depth data //Get the latest depth and image meta data depthGenerator.GetMetaData( depthMD ); //Get a pointer to the depth data const XnDepthPixel* pDepth = depthMD.Data(); //Loop over the depth pixels for (XnUInt y = 0; y < depthMD.YRes(); y++){ for (XnUInt x = 0; x < depthMD.XRes(); x++){ //Access the current depth value *pDepth; //Increase the depth pixel pDepth++; } } //Variables DepthGenerator depthGenerator; DepthMetaData depthMD; Thursday, September 12, 13
  • 19. OpenNI - Get the RGB data //Get the latest image meta data imageGenerator.GetMetaData( imageMD ); //Get a pointer to the image data const XnRGB24Pixel* pImage = imageMD.RGB24Data(); //Loop over the image pixels for (XnUInt y = 0; y < imageMD.YRes(); y++){ for (XnUInt x = 0; x < imageMD.XRes(); x++){ //Access the current pixel value * pImage; //Increase the pixel pointer pImage++; } } //Variables ImageGenerator imageGenerator; ImageMetaData imageMD; Thursday, September 12, 13
  • 20. OpenNI - Skeleton data //Variables UserGenerator userGenerator; XnUserID userIDs[ numTrackedUsers ]; XnUInt16 numUsers = userGenerator->GetNumberOfUsers(); userGenerator->GetUsers(userIDs, numUsers); for( int i=0; i < numUsers; i++ ){ if( userGenerator->GetSkeletonCap().IsTracking( userIDs[i] ) ){ XnPoint3D userCenterOfMass; userGenerator->GetSkeletonCap().IsCalibrating( userIDs[i] ); userGenerator->GetSkeletonCap().IsCalibrated( userIDs[i] ); userGenerator->GetCoM( userIDs[i], userCenterOfMass ); XnSkeletonJointTransformation jointData; if( userGenerator->GetSkeletonCap().IsJointAvailable( XN_SKEL_HEAD ) ){ userGenerator->GetSkeletonCap().GetSkeletonJoint(userIDs[i], XN_SKEL_HEAD, jointData ); } } } Thursday, September 12, 13
  • 25. Supervised Learning Input Vector Training Data Thursday, September 12, 13
  • 26. Supervised Learning Input Vector Training Data {Feature Vector} Thursday, September 12, 13
  • 27. Supervised Learning Input Vector Training Data {Feature Vector} Feature Thursday, September 12, 13
  • 28. Supervised Learning Input Vector Training Data {Feature Vector} Feature {Attribute} Thursday, September 12, 13
  • 29. Supervised Learning Input Vector Target Vector Training Data Thursday, September 12, 13
  • 30. Supervised Learning Learning Algorithm Input Vector Target Vector Training Data Thursday, September 12, 13
  • 31. Supervised Learning Learning Algorithm Model Input Vector Target Vector Training Data Thursday, September 12, 13
  • 32. Supervised Learning Learning Algorithm Prediction New Datum Model Training Data Thursday, September 12, 13
  • 33. Supervised Learning Learning Algorithm Prediction Predicted Class Class A Model Training Data New Datum Thursday, September 12, 13
  • 34. Supervised Learning Learning Algorithm Prediction Predicted Class Class A Model Training Data New Datum Thursday, September 12, 13
  • 35. Kinect Gesture Recognition Synapse OSC Skeleton Data Openframeworks www.nickgillian.com/wiki/pmwiki.php/GRT/ OpenframeworksKinectExample Thursday, September 12, 13
  • 36. Kinect Code Tutorial Slides www.nickgillian.com/09-12-13.html Thursday, September 12, 13