SlideShare ist ein Scribd-Unternehmen logo
1 von 24
Downloaden Sie, um offline zu lesen
Ing. Matteo Valoriani
               matteo.valoriani@studentpartner.com




KINECT Programming
Skeletal Tracking History
•   First experiments started over 4 years ago
•   Rapid iteration exploration
•   Started with tracking just hands
•   Then head and hands
•   Then added shoulders and elbows
•   Then built “heavy duty” pipeline
•   To today’s pipeline that tracks 20 joints and runs
    fast
                      KINECT Programming
PIPELINE ARCHITECTURE

    Player              Background   Skeletal
   Finding               Removal     Tracking




             KINECT Programming
The SkeletonStream object model




AllFramesReady and SkeletonFrameReady Events return a
SkeletonFrame which contain skeleton data
                        KINECT Programming
SKELETON DATA
                 • Maximum two players
                   tracked at once
                 • Six player proposals per
                   Kinect
                 • 20 joints in standard mode
                 • Not supported in near mode
                   with version 1.0




   KINECT Programming
SKELETON DATA




   KINECT Programming
The Skeleton object model
                                         Each skeleton has a
                                         unique identifier -
                                         TrackingID




                             Each joint has a Position, which is
                             of type SkeletonPoint that
                             reports the X, Y, and Z of the joint.
        KINECT Programming
SkeletonTrakingState
SkeletonTrakingState   What it means
NotTracked             Skeleton object does not represent a tracked user. The
                       Position field of the Skeleton and every Joint in the joints
                       collection is a zero point (SkeletonPoint where the X, Y and Z
                       values all equal zero)
PositionOnly           The skeleton is detected, but is not actively being tracked.
                       The Position field has a non-zero point, but the position of
                       each Joint in the joints collection is a zero point.
Tracked                The skeleton is actively being tracked. The Position field and
                       all Joint objects in the joints collection have non-zero points.




                                KINECT Programming
JointsTrakingState
 JointsTrakingState   What it means
 Inferred             Occluded, clipped, or low confidence joints. The skeleton
                      engine cannot see the joint in the depth frame pixels, but has
                      made a calculated determination of the position of the joint.
 NotTracked           The position of the joint is indeterminable. The Position value
                      is a zero point.
 Tracked              The joint is detected and actively followed.



Use TransformSmoothParameters to smooth joint data to
reduce jitter

                               KINECT Programming
KINECT Programming
private KinectSensor _KinectDevice;
private readonly Brush[] _SkeletonBrushes = { Brushes.Black, Brushes.Crimson, Brushes.Indigo,
                                     Brushes.DodgerBlue, Brushes.Purple, Brushes.Pink };
private Skeleton[] _FrameSkeletons;
#endregion Member Variables


private void InitializeKinect()    {

            this._KinectDevice.SkeletonStream.Enable();
            this._FrameSkeletons = new Skeleton[this._KinectDevice.SkeletonStream.FrameSkeletonArrayLength];
            this.KinectDevice.SkeletonFrameReady += KinectDevice_SkeletonFrameReady;

            this._KinectDevice.Start();
       }

private void UninitializeKinect()
        {
            this._KinectDevice.Stop();
            this._KinectDevice.SkeletonFrameReady -= KinectDevice_SkeletonFrameReady;
            this._KinectDevice.SkeletonStream.Disable();

            this._FrameSkeletons = null;
       }




                                             KINECT Programming
private void KinectDevice_SkeletonFrameReady(object sender, SkeletonFrameReadyEventArgs e)    {
           using (SkeletonFrame frame = e.OpenSkeletonFrame()) {
               if (frame != null)                {
                   Skeleton skeleton; Brush userBrush;                      Copy SkeletonsData in   local variable
                  LayoutRoot.Children.Clear();
                   frame.CopySkeletonDataTo(this._FrameSkeletons);

                    for (int i = 0; i < this._FrameSkeletons.Length; i++) {
                        skeleton = this._FrameSkeletons[i];                          Actually, Length is 6
                       if (skeleton.TrackingState != SkeletonTrackingState.NotTracked) {
                           Point p = GetJointPoint(skeleton.Position);
                           Ellipse ell = new Ellipse();
                           ell.Height = ell.Width = 30;
                           userBrush = this._SkeletonBrushes[i % this._SkeletonBrushes.Length];
                           ell.Fill = userBrush;
                                                                                      Scale Position
                           LayoutRoot.Children.Add(ell);
                           Canvas.SetTop(ell, p.Y - ell.Height / 2);
                           Canvas.SetLeft(ell, p.X - ell.Width / 2);
}   }   }   }   }




                                               KINECT Programming
private Point GetJointPoint(SkeletonPoint skPoint)             Mapping different
       {                                                       Coordinate systems
           // Change System 3D ->2 D
           DepthImagePoint point = this.KinectDevice.MapSkeletonPointToDepth(skPoint,
                                             this.KinectDevice.DepthStream.Format);

           // Scale point to actual dimension of container
           point.X = point.X * (int)this.LayoutRoot.ActualWidth /
                                    this.KinectDevice.DepthStream.FrameWidth;
           point.Y = point.Y * (int)this.LayoutRoot.ActualHeight /
                                    this.KinectDevice.DepthStream.FrameHeight;

           return new Point(point.X, point.Y);
       }




                                  KINECT Programming
Smoothing
TransformSmoothParameters   What it means
Correction                  A float ranging from 0 to 1.0. The lower the number, the more correction
                            is applied.
JitterRadius                Sets the radius of correction. If a joint position “jitters” outside of the set
                            radius, it is corrected to be at the radius. Float value measured in meters.
MaxDeviationRadius          Used this setting in conjunction with the JitterRadius setting to
                            determine the outer bounds of the jitter radius. Any point that falls
                            outside of this radius is not considered a jitter, but a valid new position.
                            Float value measured in meters.
Prediction                  Sets the number of frames predicted.
Smoothing                   Determines the amount of smoothing applied while processing skeletal
                            frames. It is a float type with a range of 0 to 1.0. The higher the value, the
                            more smoothing applied. A zero value does not alter the skeleton data.


                                      KINECT Programming
KINECT Programming
private void InitializeKinect()         {

          var parameters = new TransformSmoothParameters
          {
              Smoothing = 0.3f,
              Correction = 0.0f,
              Prediction = 0.0f,
             JitterRadius = 1.0f,
             MaxDeviationRadius = 0.5f
          };
          _KinectDevice.SkeletonStream.Enable(parameters);

          this._KinectDevice.SkeletonStream.Enable();
          this._FrameSkeletons = new
                               Skeleton[this._KinectDevice.SkeletonStream.FrameSkeletonArrayLength];
          this.KinectDevice.SkeletonFrameReady += KinectDevice_SkeletonFrameReady;

          this._KinectDevice.Start();
      }



                                            KINECT Programming
private void KinectDevice_SkeletonFrameReady(object sender, SkeletonFrameReadyEventArgs e)                {
           using (SkeletonFrame frame = e.OpenSkeletonFrame()) {
               if (frame != null)                {
                   Skeleton skeleton;
                   Brush userBrush;
                  LayoutRoot.Children.Clear();
                   frame.CopySkeletonDataTo(this._FrameSkeletons);

                       for (int i = 0; i < this._FrameSkeletons.Length; i++) {
                           skeleton = this._FrameSkeletons[i];
                           if (skeleton.TrackingState != SkeletonTrackingState.NotTracked) {
                               Point p = GetJointPoint(skeleton.Position);
                               Ellipse ell = new Ellipse();
                               ell.Height = ell.Width = 30;
                               userBrush = this._SkeletonBrushes[i % this._SkeletonBrushes.Length];
                               ell.Fill = userBrush;

                              LayoutRoot.Children.Add(ell);
                              Canvas.SetTop(ell, p.Y - ell.Height / 2);
                              Canvas.SetLeft(ell, p.X - ell.Width / 2);
                              if (skeleton.TrackingState == SkeletonTrackingState.Tracked)            {
                                        DrawSkeleton(skeleton, userBrush);
} }    }   }   }   }


                                                  KINECT Programming
private void DrawSkeleton(Skeleton skeleton, Brush userBrush)         {
//Draws the skeleton’s head and torso
  joints = new[] { JointType.Head, JointType.ShoulderCenter, JointType.ShoulderLeft, JointType.Spine,
             JointType.ShoulderRight, JointType.ShoulderCenter, JointType.HipCenter, JointType.HipLeft,
             JointType.Spine, JointType.HipRight, JointType.HipCenter };
  LayoutRoot.Children.Add(CreateFigure(skeleton, userBrush, joints));

  //Draws the skeleton’s left leg
  joints = new[] { JointType.HipLeft, JointType.KneeLeft, JointType.AnkleLeft, JointType.FootLeft };
  LayoutRoot.Children.Add(CreateFigure(skeleton, userBrush, joints));

  //Draws the skeleton’s right leg
  joints = new[] { JointType.HipRight, JointType.KneeRight, JointType.AnkleRight, JointType.FootRight };
  LayoutRoot.Children.Add(CreateFigure(skeleton, userBrush, joints));

  //Draws the skeleton’s left arm
  joints = new[] { JointType.ShoulderLeft, JointType.ElbowLeft, JointType.WristLeft, JointType.HandLeft };
  LayoutRoot.Children.Add(CreateFigure(skeleton, userBrush, joints));

  //Draws the skeleton’s right arm
  joints = new[] { JointType.ShoulderRight, JointType.ElbowRight, JointType.WristRight, JointType.HandRight };
  LayoutRoot.Children.Add(CreateFigure(skeleton, userBrush, joints));

  }


                                                 KINECT Programming
private Polyline CreateFigure(Skeleton skeleton, Brush brush, JointType[] joints)
       {
           Polyline figure = new Polyline();
           figure.StrokeThickness = 4;
           figure.Stroke = brush;

           for (int i = 0; i < joints.Length; i++)
           {
               figure.Points.Add(GetJointPoint(skeleton.Joints[joints[i]].Position));
           }

           return figure;
      }




                                            KINECT Programming
KINECT Programming
private void InitializeKinect()        {
    var parameters = new TransformSmoothParameters{
               Smoothing = 0.3f,
               Correction = 0.0f,
               Prediction = 0.0f,
               JitterRadius = 1.0f,
               MaxDeviationRadius = 0.5f };
    _KinectDevice.SkeletonStream.Enable(parameters);


     this._KinectDevice.SkeletonStream.Enable();
     this._FrameSkeletons = new Skeleton[this._KinectDevice.SkeletonStream.FrameSkeletonArrayLength];
     this.KinectDevice.SkeletonFrameReady += KinectDevice_SkeletonFrameReady;

     this._KinectDevice.ColorStream.Enable(ColorImageFormat.RgbResolution640x480Fps30);
     this._KinectDevice.ColorFrameReady += new EventHandler<ColorImageFrameReadyEventArgs>(_KinectDevice_ColorFrameReady);

     this._ColorImageBitmap = new WriteableBitmap(_KinectDevice.ColorStream.FrameWidth,
                                                  _KinectDevice.ColorStream.FrameHeight, 96, 96,
                                                  PixelFormats.Bgr32, null);
     this._ColorImageBitmapRect = new Int32Rect(0, 0, _KinectDevice.ColorStream.FrameWidth,
                                                     _KinectDevice.ColorStream.FrameHeight);
     this._ColorImageStride = _KinectDevice.ColorStream.FrameWidth * _KinectDevice.ColorStream.FrameBytesPerPixel;
     ColorImage.Source = this._ColorImageBitmap;


     this._KinectDevice.Start();      }
                                                                            Video Stream initialization


                                                KINECT Programming
private Point GetJointPoint(SkeletonPoint skPoint)
       {
            // Change System 3D ->2D                       Mapping on Color
         this.KinectDevice.DepthStream.Format);            Coordinate system

           ColorImagePoint point = this.KinectDevice.MapSkeletonPointToColor(skPoint,
                                       this.KinectDevice.ColorStream.Format);

           // Scale point to actual dimension of container
              point.X = point.X * (int)this.LayoutRoot.ActualWidth /
                                       this.KinectDevice.DepthStream.FrameWidth;
              point.Y = point.Y * (int)this.LayoutRoot.ActualHeight /
                                       this.KinectDevice.DepthStream.FrameHeight;

              return new Point(point.X, point.Y);
       }




                                     KINECT Programming
Choosing Skeletons
Using the AppChoosesSkeletons property and ChooseSkeletons
method is possible select which skeletons to track:

AppChoosesSkeletons      What it means
False(default)           The skeleton engine chooses the first two skeletons available for
                         tracking (selection process is unpredictable)
True                     To manually select which skeletons to track call the
                         ChooseSkeletons method passing in the TrackingIDs of the
                         skeletons you want to track.


The ChooseSkeletons method accepts one, two, or no TrackingIDs. The skeleton engine
stops tracking all skeletons when the ChooseSkeletons method is passed no parameters.
                                    KINECT Programming
Choosing Skeletons(2)
• Call ChooseSkeletons when AppChoosesSkeletons==false throws an
  InvalidOperationException.
• If AppChoosesSkeletons is set to true before the SkeletonStream is
  enabled, no skeletons are actively tracked until call ChooseSkeletons.
• Skeletons automatically selected for tracking before setting
  AppChoosesSkeletons is set to true continue to be actively tracked
  until the skeleton leaves the scene or is manually replaced. If the
  automatically selected skeleton leaves the scene, it is not
  automatically replaced.
• Any skeletons manually chosen for tracking continue to be tracked
  after AppChoosesSkeletons is set to false until the skeleton leaves
  the scene.
                             KINECT Programming

Weitere ähnliche Inhalte

Was ist angesagt?

Kinect presentation
Kinect presentationKinect presentation
Kinect presentationAnkur Sharma
 
DIANNE - A distributed deep learning framework on OSGi - Tim Verbelen
DIANNE - A distributed deep learning framework on OSGi - Tim VerbelenDIANNE - A distributed deep learning framework on OSGi - Tim Verbelen
DIANNE - A distributed deep learning framework on OSGi - Tim Verbelenmfrancis
 
GDC2019 - SEED - Towards Deep Generative Models in Game Development
GDC2019 - SEED - Towards Deep Generative Models in Game DevelopmentGDC2019 - SEED - Towards Deep Generative Models in Game Development
GDC2019 - SEED - Towards Deep Generative Models in Game DevelopmentElectronic Arts / DICE
 
The power of Kinect in 10 minutes
The power of Kinect in 10 minutesThe power of Kinect in 10 minutes
The power of Kinect in 10 minutesTom Kerkhove
 
Kinect for Xbox 360: the world's first viral 3D technology
Kinect for Xbox 360: the world's first viral 3D technologyKinect for Xbox 360: the world's first viral 3D technology
Kinect for Xbox 360: the world's first viral 3D technologykamutef
 
Xbox 360 Kinect
Xbox 360 Kinect  Xbox 360 Kinect
Xbox 360 Kinect Saif Pathan
 
The Nature of Code via Cinder - Modeling the Natural World in C++
The Nature of Code via Cinder - Modeling the Natural World in C++The Nature of Code via Cinder - Modeling the Natural World in C++
The Nature of Code via Cinder - Modeling the Natural World in C++Nathan Koch
 
Connect your Android to the real world with Bluetooth Low Energy
Connect your Android to the real world with Bluetooth Low EnergyConnect your Android to the real world with Bluetooth Low Energy
Connect your Android to the real world with Bluetooth Low EnergyGabor Paller
 
SIGGRAPH 2018 - Full Rays Ahead! From Raster to Real-Time Raytracing
SIGGRAPH 2018 - Full Rays Ahead! From Raster to Real-Time RaytracingSIGGRAPH 2018 - Full Rays Ahead! From Raster to Real-Time Raytracing
SIGGRAPH 2018 - Full Rays Ahead! From Raster to Real-Time RaytracingElectronic Arts / DICE
 
Solving Visibility and Streaming in the The Witcher 3: Wild Hunt with Umbra 3
Solving Visibility and Streaming in the The Witcher 3: Wild Hunt with Umbra 3Solving Visibility and Streaming in the The Witcher 3: Wild Hunt with Umbra 3
Solving Visibility and Streaming in the The Witcher 3: Wild Hunt with Umbra 3Umbra
 
[Paper introduction] Performance Capture of Interacting Characters with Handh...
[Paper introduction] Performance Capture of Interacting Characters with Handh...[Paper introduction] Performance Capture of Interacting Characters with Handh...
[Paper introduction] Performance Capture of Interacting Characters with Handh...Mitsuru Nakazawa
 
Visibility Optimization for Games
Visibility Optimization for GamesVisibility Optimization for Games
Visibility Optimization for GamesUmbra
 
Siggraph 2011: Occlusion culling in Alan Wake
Siggraph 2011: Occlusion culling in Alan WakeSiggraph 2011: Occlusion culling in Alan Wake
Siggraph 2011: Occlusion culling in Alan WakeUmbra
 

Was ist angesagt? (16)

Kinect
KinectKinect
Kinect
 
Kinect presentation
Kinect presentationKinect presentation
Kinect presentation
 
DIANNE - A distributed deep learning framework on OSGi - Tim Verbelen
DIANNE - A distributed deep learning framework on OSGi - Tim VerbelenDIANNE - A distributed deep learning framework on OSGi - Tim Verbelen
DIANNE - A distributed deep learning framework on OSGi - Tim Verbelen
 
GDC2019 - SEED - Towards Deep Generative Models in Game Development
GDC2019 - SEED - Towards Deep Generative Models in Game DevelopmentGDC2019 - SEED - Towards Deep Generative Models in Game Development
GDC2019 - SEED - Towards Deep Generative Models in Game Development
 
The power of Kinect in 10 minutes
The power of Kinect in 10 minutesThe power of Kinect in 10 minutes
The power of Kinect in 10 minutes
 
Multiview Imaging HW Overview
Multiview Imaging HW OverviewMultiview Imaging HW Overview
Multiview Imaging HW Overview
 
Kinect for Xbox 360: the world's first viral 3D technology
Kinect for Xbox 360: the world's first viral 3D technologyKinect for Xbox 360: the world's first viral 3D technology
Kinect for Xbox 360: the world's first viral 3D technology
 
Xbox 360 Kinect
Xbox 360 Kinect  Xbox 360 Kinect
Xbox 360 Kinect
 
The Nature of Code via Cinder - Modeling the Natural World in C++
The Nature of Code via Cinder - Modeling the Natural World in C++The Nature of Code via Cinder - Modeling the Natural World in C++
The Nature of Code via Cinder - Modeling the Natural World in C++
 
Connect your Android to the real world with Bluetooth Low Energy
Connect your Android to the real world with Bluetooth Low EnergyConnect your Android to the real world with Bluetooth Low Energy
Connect your Android to the real world with Bluetooth Low Energy
 
SIGGRAPH 2018 - Full Rays Ahead! From Raster to Real-Time Raytracing
SIGGRAPH 2018 - Full Rays Ahead! From Raster to Real-Time RaytracingSIGGRAPH 2018 - Full Rays Ahead! From Raster to Real-Time Raytracing
SIGGRAPH 2018 - Full Rays Ahead! From Raster to Real-Time Raytracing
 
Solving Visibility and Streaming in the The Witcher 3: Wild Hunt with Umbra 3
Solving Visibility and Streaming in the The Witcher 3: Wild Hunt with Umbra 3Solving Visibility and Streaming in the The Witcher 3: Wild Hunt with Umbra 3
Solving Visibility and Streaming in the The Witcher 3: Wild Hunt with Umbra 3
 
[Paper introduction] Performance Capture of Interacting Characters with Handh...
[Paper introduction] Performance Capture of Interacting Characters with Handh...[Paper introduction] Performance Capture of Interacting Characters with Handh...
[Paper introduction] Performance Capture of Interacting Characters with Handh...
 
Visibility Optimization for Games
Visibility Optimization for GamesVisibility Optimization for Games
Visibility Optimization for Games
 
Siggraph 2011: Occlusion culling in Alan Wake
Siggraph 2011: Occlusion culling in Alan WakeSiggraph 2011: Occlusion culling in Alan Wake
Siggraph 2011: Occlusion culling in Alan Wake
 
GPU - how can we use it?
GPU - how can we use it?GPU - how can we use it?
GPU - how can we use it?
 

Ähnlich wie 4 track kinect@Bicocca - skeletal tracking

Lidnug Presentation - Kinect - The How, Were and When of developing with it
Lidnug Presentation - Kinect - The How, Were and When of developing with itLidnug Presentation - Kinect - The How, Were and When of developing with it
Lidnug Presentation - Kinect - The How, Were and When of developing with itPhilip Wheat
 
Using the Kinect for Fun and Profit by Tam Hanna
Using the Kinect for Fun and Profit by Tam HannaUsing the Kinect for Fun and Profit by Tam Hanna
Using the Kinect for Fun and Profit by Tam HannaCodemotion
 
2 track kinect@Bicocca - hardware e funzinamento
2   track kinect@Bicocca - hardware e funzinamento2   track kinect@Bicocca - hardware e funzinamento
2 track kinect@Bicocca - hardware e funzinamentoMatteo Valoriani
 
Oculus Rift DK2 + Leap Motion Tutorial
Oculus Rift DK2 + Leap Motion TutorialOculus Rift DK2 + Leap Motion Tutorial
Oculus Rift DK2 + Leap Motion TutorialChris Zaharia
 
GDC2011 - Implementation and Application of the Real-Time Helper-Joint System
GDC2011 - Implementation and Application of the Real-Time Helper-Joint SystemGDC2011 - Implementation and Application of the Real-Time Helper-Joint System
GDC2011 - Implementation and Application of the Real-Time Helper-Joint SystemJubok Kim
 
Virtual Dance Game Using Kinect and ICP Algorithm
Virtual Dance Game Using Kinect and ICP AlgorithmVirtual Dance Game Using Kinect and ICP Algorithm
Virtual Dance Game Using Kinect and ICP AlgorithmBenjoe Vidal
 
5 track kinect@Bicocca - gesture
5   track kinect@Bicocca - gesture5   track kinect@Bicocca - gesture
5 track kinect@Bicocca - gestureMatteo Valoriani
 
Human action recognition with kinect using a joint motion descriptor
Human action recognition with kinect using a joint motion descriptorHuman action recognition with kinect using a joint motion descriptor
Human action recognition with kinect using a joint motion descriptorSoma Boubou
 
Game development with Cocos2d
Game development with Cocos2dGame development with Cocos2d
Game development with Cocos2dVinsol
 
KinectArms cscw2013
KinectArms cscw2013KinectArms cscw2013
KinectArms cscw2013Aaron Genest
 
Enhance your world with ARKit. UA Mobile 2017.
Enhance your world with ARKit. UA Mobile 2017.Enhance your world with ARKit. UA Mobile 2017.
Enhance your world with ARKit. UA Mobile 2017.UA Mobile
 
Human Action Recognition Based on Spacio-temporal features-Poster
Human Action Recognition Based on Spacio-temporal features-PosterHuman Action Recognition Based on Spacio-temporal features-Poster
Human Action Recognition Based on Spacio-temporal features-Posternikhilus85
 
Object tracking by dtcwt feature vectors 2-3-4
Object tracking by dtcwt feature vectors 2-3-4Object tracking by dtcwt feature vectors 2-3-4
Object tracking by dtcwt feature vectors 2-3-4IAEME Publication
 
EE660_Report_YaxinLiu_8448347171
EE660_Report_YaxinLiu_8448347171EE660_Report_YaxinLiu_8448347171
EE660_Report_YaxinLiu_8448347171Yaxin Liu
 

Ähnlich wie 4 track kinect@Bicocca - skeletal tracking (20)

Lidnug Presentation - Kinect - The How, Were and When of developing with it
Lidnug Presentation - Kinect - The How, Were and When of developing with itLidnug Presentation - Kinect - The How, Were and When of developing with it
Lidnug Presentation - Kinect - The How, Were and When of developing with it
 
Smart Room Gesture Control
Smart Room Gesture ControlSmart Room Gesture Control
Smart Room Gesture Control
 
Using the Kinect for Fun and Profit by Tam Hanna
Using the Kinect for Fun and Profit by Tam HannaUsing the Kinect for Fun and Profit by Tam Hanna
Using the Kinect for Fun and Profit by Tam Hanna
 
2 track kinect@Bicocca - hardware e funzinamento
2   track kinect@Bicocca - hardware e funzinamento2   track kinect@Bicocca - hardware e funzinamento
2 track kinect@Bicocca - hardware e funzinamento
 
Oculus Rift DK2 + Leap Motion Tutorial
Oculus Rift DK2 + Leap Motion TutorialOculus Rift DK2 + Leap Motion Tutorial
Oculus Rift DK2 + Leap Motion Tutorial
 
GDC2011 - Implementation and Application of the Real-Time Helper-Joint System
GDC2011 - Implementation and Application of the Real-Time Helper-Joint SystemGDC2011 - Implementation and Application of the Real-Time Helper-Joint System
GDC2011 - Implementation and Application of the Real-Time Helper-Joint System
 
Virtual Dance Game Using Kinect and ICP Algorithm
Virtual Dance Game Using Kinect and ICP AlgorithmVirtual Dance Game Using Kinect and ICP Algorithm
Virtual Dance Game Using Kinect and ICP Algorithm
 
Communityday2013
Communityday2013Communityday2013
Communityday2013
 
5 track kinect@Bicocca - gesture
5   track kinect@Bicocca - gesture5   track kinect@Bicocca - gesture
5 track kinect@Bicocca - gesture
 
First kinectslides
First kinectslidesFirst kinectslides
First kinectslides
 
cs247 slides
cs247 slidescs247 slides
cs247 slides
 
Human action recognition with kinect using a joint motion descriptor
Human action recognition with kinect using a joint motion descriptorHuman action recognition with kinect using a joint motion descriptor
Human action recognition with kinect using a joint motion descriptor
 
Isvc08
Isvc08Isvc08
Isvc08
 
Game development with Cocos2d
Game development with Cocos2dGame development with Cocos2d
Game development with Cocos2d
 
KinectArms cscw2013
KinectArms cscw2013KinectArms cscw2013
KinectArms cscw2013
 
Enhance your world with ARKit. UA Mobile 2017.
Enhance your world with ARKit. UA Mobile 2017.Enhance your world with ARKit. UA Mobile 2017.
Enhance your world with ARKit. UA Mobile 2017.
 
Human Action Recognition Based on Spacio-temporal features-Poster
Human Action Recognition Based on Spacio-temporal features-PosterHuman Action Recognition Based on Spacio-temporal features-Poster
Human Action Recognition Based on Spacio-temporal features-Poster
 
Road to react hooks
Road to react hooksRoad to react hooks
Road to react hooks
 
Object tracking by dtcwt feature vectors 2-3-4
Object tracking by dtcwt feature vectors 2-3-4Object tracking by dtcwt feature vectors 2-3-4
Object tracking by dtcwt feature vectors 2-3-4
 
EE660_Report_YaxinLiu_8448347171
EE660_Report_YaxinLiu_8448347171EE660_Report_YaxinLiu_8448347171
EE660_Report_YaxinLiu_8448347171
 

Mehr von Matteo Valoriani

Immerge yourself in a new Reality
Immerge yourself in a new RealityImmerge yourself in a new Reality
Immerge yourself in a new RealityMatteo Valoriani
 
Debug, Analyze and Optimize Games with Intel Tools
Debug, Analyze and Optimize Games with Intel Tools Debug, Analyze and Optimize Games with Intel Tools
Debug, Analyze and Optimize Games with Intel Tools Matteo Valoriani
 
More Personal Computing: Windows 10, Kinect and Wearables
More Personal Computing: Windows 10, Kinect and WearablesMore Personal Computing: Windows 10, Kinect and Wearables
More Personal Computing: Windows 10, Kinect and WearablesMatteo Valoriani
 
Introduction to development
Introduction to developmentIntroduction to development
Introduction to developmentMatteo Valoriani
 
Etna dev 2016 - Deep Dive Holographic Applications
Etna dev 2016 - Deep Dive Holographic ApplicationsEtna dev 2016 - Deep Dive Holographic Applications
Etna dev 2016 - Deep Dive Holographic ApplicationsMatteo Valoriani
 
Etna dev 2016 - Introduction to Holographic Development
Etna dev 2016 - Introduction to Holographic DevelopmentEtna dev 2016 - Introduction to Holographic Development
Etna dev 2016 - Introduction to Holographic DevelopmentMatteo Valoriani
 
Etna dev 2016 - Introduction to Mixed Reality with HoloLens
Etna dev 2016 - Introduction to Mixed Reality with HoloLensEtna dev 2016 - Introduction to Mixed Reality with HoloLens
Etna dev 2016 - Introduction to Mixed Reality with HoloLensMatteo Valoriani
 
Mixed Reality from demo to product
Mixed Reality from demo to productMixed Reality from demo to product
Mixed Reality from demo to productMatteo Valoriani
 
Intel RealSense Hands-on Lab - Rome
Intel RealSense Hands-on Lab - RomeIntel RealSense Hands-on Lab - Rome
Intel RealSense Hands-on Lab - RomeMatteo Valoriani
 
Develop store apps with kinect for windows v2
Develop store apps with kinect for windows v2Develop store apps with kinect for windows v2
Develop store apps with kinect for windows v2Matteo Valoriani
 
Programming with kinect v2
Programming with kinect v2Programming with kinect v2
Programming with kinect v2Matteo Valoriani
 
Programming with RealSense using .NET
Programming with RealSense using .NETProgramming with RealSense using .NET
Programming with RealSense using .NETMatteo Valoriani
 
Tecnologie e Startup: ICT è solo una commodity?
Tecnologie e Startup: ICT è solo una commodity? Tecnologie e Startup: ICT è solo una commodity?
Tecnologie e Startup: ICT è solo una commodity? Matteo Valoriani
 
Corso pratico di C# - 2013
Corso pratico di C# - 2013Corso pratico di C# - 2013
Corso pratico di C# - 2013Matteo Valoriani
 
Introduction to Kinect - Update v 1.8
Introduction to Kinect - Update v 1.8Introduction to Kinect - Update v 1.8
Introduction to Kinect - Update v 1.8Matteo Valoriani
 

Mehr von Matteo Valoriani (20)

Immerge yourself in a new Reality
Immerge yourself in a new RealityImmerge yourself in a new Reality
Immerge yourself in a new Reality
 
Hour ofcode
Hour ofcodeHour ofcode
Hour ofcode
 
Debug, Analyze and Optimize Games with Intel Tools
Debug, Analyze and Optimize Games with Intel Tools Debug, Analyze and Optimize Games with Intel Tools
Debug, Analyze and Optimize Games with Intel Tools
 
More Personal Computing: Windows 10, Kinect and Wearables
More Personal Computing: Windows 10, Kinect and WearablesMore Personal Computing: Windows 10, Kinect and Wearables
More Personal Computing: Windows 10, Kinect and Wearables
 
Introduction to development
Introduction to developmentIntroduction to development
Introduction to development
 
Etna dev 2016 - Deep Dive Holographic Applications
Etna dev 2016 - Deep Dive Holographic ApplicationsEtna dev 2016 - Deep Dive Holographic Applications
Etna dev 2016 - Deep Dive Holographic Applications
 
Etna dev 2016 - Introduction to Holographic Development
Etna dev 2016 - Introduction to Holographic DevelopmentEtna dev 2016 - Introduction to Holographic Development
Etna dev 2016 - Introduction to Holographic Development
 
Etna dev 2016 - Introduction to Mixed Reality with HoloLens
Etna dev 2016 - Introduction to Mixed Reality with HoloLensEtna dev 2016 - Introduction to Mixed Reality with HoloLens
Etna dev 2016 - Introduction to Mixed Reality with HoloLens
 
Mixed Reality from demo to product
Mixed Reality from demo to productMixed Reality from demo to product
Mixed Reality from demo to product
 
Intel RealSense Hands-on Lab - Rome
Intel RealSense Hands-on Lab - RomeIntel RealSense Hands-on Lab - Rome
Intel RealSense Hands-on Lab - Rome
 
Develop store apps with kinect for windows v2
Develop store apps with kinect for windows v2Develop store apps with kinect for windows v2
Develop store apps with kinect for windows v2
 
Programming with kinect v2
Programming with kinect v2Programming with kinect v2
Programming with kinect v2
 
Programming with RealSense using .NET
Programming with RealSense using .NETProgramming with RealSense using .NET
Programming with RealSense using .NET
 
Face recognition
Face recognitionFace recognition
Face recognition
 
Communitydays2015
Communitydays2015Communitydays2015
Communitydays2015
 
Tecnologie e Startup: ICT è solo una commodity?
Tecnologie e Startup: ICT è solo una commodity? Tecnologie e Startup: ICT è solo una commodity?
Tecnologie e Startup: ICT è solo una commodity?
 
Intel real sense handson
Intel real sense handsonIntel real sense handson
Intel real sense handson
 
Communitydays2014
Communitydays2014Communitydays2014
Communitydays2014
 
Corso pratico di C# - 2013
Corso pratico di C# - 2013Corso pratico di C# - 2013
Corso pratico di C# - 2013
 
Introduction to Kinect - Update v 1.8
Introduction to Kinect - Update v 1.8Introduction to Kinect - Update v 1.8
Introduction to Kinect - Update v 1.8
 

Kürzlich hochgeladen

Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Alan Dix
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...gurkirankumar98700
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxOnBoard
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhisoniya singh
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 

Kürzlich hochgeladen (20)

Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptx
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 

4 track kinect@Bicocca - skeletal tracking

  • 1. Ing. Matteo Valoriani matteo.valoriani@studentpartner.com KINECT Programming
  • 2. Skeletal Tracking History • First experiments started over 4 years ago • Rapid iteration exploration • Started with tracking just hands • Then head and hands • Then added shoulders and elbows • Then built “heavy duty” pipeline • To today’s pipeline that tracks 20 joints and runs fast KINECT Programming
  • 3. PIPELINE ARCHITECTURE Player Background Skeletal Finding Removal Tracking KINECT Programming
  • 4. The SkeletonStream object model AllFramesReady and SkeletonFrameReady Events return a SkeletonFrame which contain skeleton data KINECT Programming
  • 5. SKELETON DATA • Maximum two players tracked at once • Six player proposals per Kinect • 20 joints in standard mode • Not supported in near mode with version 1.0 KINECT Programming
  • 6. SKELETON DATA KINECT Programming
  • 7. The Skeleton object model Each skeleton has a unique identifier - TrackingID Each joint has a Position, which is of type SkeletonPoint that reports the X, Y, and Z of the joint. KINECT Programming
  • 8. SkeletonTrakingState SkeletonTrakingState What it means NotTracked Skeleton object does not represent a tracked user. The Position field of the Skeleton and every Joint in the joints collection is a zero point (SkeletonPoint where the X, Y and Z values all equal zero) PositionOnly The skeleton is detected, but is not actively being tracked. The Position field has a non-zero point, but the position of each Joint in the joints collection is a zero point. Tracked The skeleton is actively being tracked. The Position field and all Joint objects in the joints collection have non-zero points. KINECT Programming
  • 9. JointsTrakingState JointsTrakingState What it means Inferred Occluded, clipped, or low confidence joints. The skeleton engine cannot see the joint in the depth frame pixels, but has made a calculated determination of the position of the joint. NotTracked The position of the joint is indeterminable. The Position value is a zero point. Tracked The joint is detected and actively followed. Use TransformSmoothParameters to smooth joint data to reduce jitter KINECT Programming
  • 11. private KinectSensor _KinectDevice; private readonly Brush[] _SkeletonBrushes = { Brushes.Black, Brushes.Crimson, Brushes.Indigo, Brushes.DodgerBlue, Brushes.Purple, Brushes.Pink }; private Skeleton[] _FrameSkeletons; #endregion Member Variables private void InitializeKinect() { this._KinectDevice.SkeletonStream.Enable(); this._FrameSkeletons = new Skeleton[this._KinectDevice.SkeletonStream.FrameSkeletonArrayLength]; this.KinectDevice.SkeletonFrameReady += KinectDevice_SkeletonFrameReady; this._KinectDevice.Start(); } private void UninitializeKinect() { this._KinectDevice.Stop(); this._KinectDevice.SkeletonFrameReady -= KinectDevice_SkeletonFrameReady; this._KinectDevice.SkeletonStream.Disable(); this._FrameSkeletons = null; } KINECT Programming
  • 12. private void KinectDevice_SkeletonFrameReady(object sender, SkeletonFrameReadyEventArgs e) { using (SkeletonFrame frame = e.OpenSkeletonFrame()) { if (frame != null) { Skeleton skeleton; Brush userBrush; Copy SkeletonsData in local variable LayoutRoot.Children.Clear(); frame.CopySkeletonDataTo(this._FrameSkeletons); for (int i = 0; i < this._FrameSkeletons.Length; i++) { skeleton = this._FrameSkeletons[i]; Actually, Length is 6 if (skeleton.TrackingState != SkeletonTrackingState.NotTracked) { Point p = GetJointPoint(skeleton.Position); Ellipse ell = new Ellipse(); ell.Height = ell.Width = 30; userBrush = this._SkeletonBrushes[i % this._SkeletonBrushes.Length]; ell.Fill = userBrush; Scale Position LayoutRoot.Children.Add(ell); Canvas.SetTop(ell, p.Y - ell.Height / 2); Canvas.SetLeft(ell, p.X - ell.Width / 2); } } } } } KINECT Programming
  • 13. private Point GetJointPoint(SkeletonPoint skPoint) Mapping different { Coordinate systems // Change System 3D ->2 D DepthImagePoint point = this.KinectDevice.MapSkeletonPointToDepth(skPoint, this.KinectDevice.DepthStream.Format); // Scale point to actual dimension of container point.X = point.X * (int)this.LayoutRoot.ActualWidth / this.KinectDevice.DepthStream.FrameWidth; point.Y = point.Y * (int)this.LayoutRoot.ActualHeight / this.KinectDevice.DepthStream.FrameHeight; return new Point(point.X, point.Y); } KINECT Programming
  • 14. Smoothing TransformSmoothParameters What it means Correction A float ranging from 0 to 1.0. The lower the number, the more correction is applied. JitterRadius Sets the radius of correction. If a joint position “jitters” outside of the set radius, it is corrected to be at the radius. Float value measured in meters. MaxDeviationRadius Used this setting in conjunction with the JitterRadius setting to determine the outer bounds of the jitter radius. Any point that falls outside of this radius is not considered a jitter, but a valid new position. Float value measured in meters. Prediction Sets the number of frames predicted. Smoothing Determines the amount of smoothing applied while processing skeletal frames. It is a float type with a range of 0 to 1.0. The higher the value, the more smoothing applied. A zero value does not alter the skeleton data. KINECT Programming
  • 16. private void InitializeKinect() { var parameters = new TransformSmoothParameters { Smoothing = 0.3f, Correction = 0.0f, Prediction = 0.0f, JitterRadius = 1.0f, MaxDeviationRadius = 0.5f }; _KinectDevice.SkeletonStream.Enable(parameters); this._KinectDevice.SkeletonStream.Enable(); this._FrameSkeletons = new Skeleton[this._KinectDevice.SkeletonStream.FrameSkeletonArrayLength]; this.KinectDevice.SkeletonFrameReady += KinectDevice_SkeletonFrameReady; this._KinectDevice.Start(); } KINECT Programming
  • 17. private void KinectDevice_SkeletonFrameReady(object sender, SkeletonFrameReadyEventArgs e) { using (SkeletonFrame frame = e.OpenSkeletonFrame()) { if (frame != null) { Skeleton skeleton; Brush userBrush; LayoutRoot.Children.Clear(); frame.CopySkeletonDataTo(this._FrameSkeletons); for (int i = 0; i < this._FrameSkeletons.Length; i++) { skeleton = this._FrameSkeletons[i]; if (skeleton.TrackingState != SkeletonTrackingState.NotTracked) { Point p = GetJointPoint(skeleton.Position); Ellipse ell = new Ellipse(); ell.Height = ell.Width = 30; userBrush = this._SkeletonBrushes[i % this._SkeletonBrushes.Length]; ell.Fill = userBrush; LayoutRoot.Children.Add(ell); Canvas.SetTop(ell, p.Y - ell.Height / 2); Canvas.SetLeft(ell, p.X - ell.Width / 2); if (skeleton.TrackingState == SkeletonTrackingState.Tracked) { DrawSkeleton(skeleton, userBrush); } } } } } } KINECT Programming
  • 18. private void DrawSkeleton(Skeleton skeleton, Brush userBrush) { //Draws the skeleton’s head and torso joints = new[] { JointType.Head, JointType.ShoulderCenter, JointType.ShoulderLeft, JointType.Spine, JointType.ShoulderRight, JointType.ShoulderCenter, JointType.HipCenter, JointType.HipLeft, JointType.Spine, JointType.HipRight, JointType.HipCenter }; LayoutRoot.Children.Add(CreateFigure(skeleton, userBrush, joints)); //Draws the skeleton’s left leg joints = new[] { JointType.HipLeft, JointType.KneeLeft, JointType.AnkleLeft, JointType.FootLeft }; LayoutRoot.Children.Add(CreateFigure(skeleton, userBrush, joints)); //Draws the skeleton’s right leg joints = new[] { JointType.HipRight, JointType.KneeRight, JointType.AnkleRight, JointType.FootRight }; LayoutRoot.Children.Add(CreateFigure(skeleton, userBrush, joints)); //Draws the skeleton’s left arm joints = new[] { JointType.ShoulderLeft, JointType.ElbowLeft, JointType.WristLeft, JointType.HandLeft }; LayoutRoot.Children.Add(CreateFigure(skeleton, userBrush, joints)); //Draws the skeleton’s right arm joints = new[] { JointType.ShoulderRight, JointType.ElbowRight, JointType.WristRight, JointType.HandRight }; LayoutRoot.Children.Add(CreateFigure(skeleton, userBrush, joints)); } KINECT Programming
  • 19. private Polyline CreateFigure(Skeleton skeleton, Brush brush, JointType[] joints) { Polyline figure = new Polyline(); figure.StrokeThickness = 4; figure.Stroke = brush; for (int i = 0; i < joints.Length; i++) { figure.Points.Add(GetJointPoint(skeleton.Joints[joints[i]].Position)); } return figure; } KINECT Programming
  • 21. private void InitializeKinect() { var parameters = new TransformSmoothParameters{ Smoothing = 0.3f, Correction = 0.0f, Prediction = 0.0f, JitterRadius = 1.0f, MaxDeviationRadius = 0.5f }; _KinectDevice.SkeletonStream.Enable(parameters); this._KinectDevice.SkeletonStream.Enable(); this._FrameSkeletons = new Skeleton[this._KinectDevice.SkeletonStream.FrameSkeletonArrayLength]; this.KinectDevice.SkeletonFrameReady += KinectDevice_SkeletonFrameReady; this._KinectDevice.ColorStream.Enable(ColorImageFormat.RgbResolution640x480Fps30); this._KinectDevice.ColorFrameReady += new EventHandler<ColorImageFrameReadyEventArgs>(_KinectDevice_ColorFrameReady); this._ColorImageBitmap = new WriteableBitmap(_KinectDevice.ColorStream.FrameWidth, _KinectDevice.ColorStream.FrameHeight, 96, 96, PixelFormats.Bgr32, null); this._ColorImageBitmapRect = new Int32Rect(0, 0, _KinectDevice.ColorStream.FrameWidth, _KinectDevice.ColorStream.FrameHeight); this._ColorImageStride = _KinectDevice.ColorStream.FrameWidth * _KinectDevice.ColorStream.FrameBytesPerPixel; ColorImage.Source = this._ColorImageBitmap; this._KinectDevice.Start(); } Video Stream initialization KINECT Programming
  • 22. private Point GetJointPoint(SkeletonPoint skPoint) { // Change System 3D ->2D Mapping on Color this.KinectDevice.DepthStream.Format); Coordinate system ColorImagePoint point = this.KinectDevice.MapSkeletonPointToColor(skPoint, this.KinectDevice.ColorStream.Format); // Scale point to actual dimension of container point.X = point.X * (int)this.LayoutRoot.ActualWidth / this.KinectDevice.DepthStream.FrameWidth; point.Y = point.Y * (int)this.LayoutRoot.ActualHeight / this.KinectDevice.DepthStream.FrameHeight; return new Point(point.X, point.Y); } KINECT Programming
  • 23. Choosing Skeletons Using the AppChoosesSkeletons property and ChooseSkeletons method is possible select which skeletons to track: AppChoosesSkeletons What it means False(default) The skeleton engine chooses the first two skeletons available for tracking (selection process is unpredictable) True To manually select which skeletons to track call the ChooseSkeletons method passing in the TrackingIDs of the skeletons you want to track. The ChooseSkeletons method accepts one, two, or no TrackingIDs. The skeleton engine stops tracking all skeletons when the ChooseSkeletons method is passed no parameters. KINECT Programming
  • 24. Choosing Skeletons(2) • Call ChooseSkeletons when AppChoosesSkeletons==false throws an InvalidOperationException. • If AppChoosesSkeletons is set to true before the SkeletonStream is enabled, no skeletons are actively tracked until call ChooseSkeletons. • Skeletons automatically selected for tracking before setting AppChoosesSkeletons is set to true continue to be actively tracked until the skeleton leaves the scene or is manually replaced. If the automatically selected skeleton leaves the scene, it is not automatically replaced. • Any skeletons manually chosen for tracking continue to be tracked after AppChoosesSkeletons is set to false until the skeleton leaves the scene. KINECT Programming