Good,
After the post yesterday where I showed as a painting on a Canvas a skeleton from the data provided to us by Kinect, I have received a couple of questions where you ask me as paint 2 skeletons.
As well to achieve something similar to the following images, all we need to change on the code of yesterday is the routine where Kinect tells us that it has detected a Skeleton. In this routine us encargábamos of painting it, because well we now do it this way:
1: void KinectSkeletonFrameReady(object sender, SkeletonFrameReadyEventArgs e)
2: {
3: var skeletonId = 0;
4: Skeleton.Children.Clear();
5: foreach (var skeleton in e.SkeletonFrame.Skeletons.Where
6: (skeleton =>
7: SkeletonTrackingState.Tracked == skeleton.TrackingState))
8: {
9: PaintBones(skeleton, KinectCanvas.SkeletonColors[skeletonId]);
10: PaintJoints(skeleton);
11: skeletonId++;
12: }
13: }
The big difference is that for each Skeleton import a static color from a dictionary. Yellow and green for my taste.
1: public static Dictionary<int, Color> SkeletonColors
2: = new Dictionary<int, Color>
3: {
4: {0, Colors.Yellow},
5: {1, Colors.Green}
6: };
At this point we can already have a skeleton tracker to help us show a static pose:
Or a jump from a 2.
Previous images we can see how the Valentino me comes to her knees and the points of the Skeleton show detail interesting.
The example to download from
Greetings @ Home
The Bruno

Leave a reply to [#KINECT] My posts for #KinectSdk | El Bruno Cancel reply