This project is read-only.

Learning machine-How to start?

Sep 23, 2011 at 2:54 PM


Can anyone inform as to how to record a gesture using the leaning machine(recorded path) and then how to detect that gesture.I especially dont know how to pass the real time tracked skeleton data to the match function in recordpath class to compare to the already recorded gesture for example in a replay file.

Any suggestion would be really helpful or examples regarding this task.

Thanks in advance,


Sep 23, 2011 at 3:40 PM

Have you look the gesture viewer project?

Sep 26, 2011 at 10:56 AM


Yes I had a look at the current gesture viewer project and learning machine classes but I dont know how we can use them to accomplish the above mentioned tasks.

Sep 26, 2011 at 12:52 PM

Perhaps I don't understand your question but it is the behavior of the gesture project : It records a reference gesture and try to detect it

Sep 26, 2011 at 2:02 PM


For example when i use the code shown below for recording the gesture(which is saved in a file hello.replay produced using gestureviewer) using the TemplatedGestureDetector Class , it shows the nullrefernceexeption in the learing machine class at line "paths = (List<RecordedPath>)formatter.Deserialize(kbStream);"

Code for Saving the state of the recorded gesture:

Stream stream=File.OpenRead("C:\\Users/asrinivas/Desktop/hello.replay");
                   BinaryReader reader = new BinaryReader(stream);
                   td = new TemplatedGestureDetector("hello", stream, 60);

Then for recognizing in the skeletal framready code i added:

 foreach (SkeletonData data in skeletonFrame.Skeletons)
                if (SkeletonTrackingState.Tracked == data.TrackingState)

                    foreach (Joint joint in data.Joints)
                        td.Add(joint.Position, nui.SkeletonEngine);



Can you please inform is this the correct way to record and detect the gesture.


Thanks in advance,


Sep 26, 2011 at 6:42 PM

You have to filter the jointID in order to recognize gesture for a selected joint only. In your code, you seems to give all positions of ALL joints


Sep 26, 2011 at 6:58 PM


But still i dont understand why it is showing nullreferenceexception at the line "paths = (List<RecordedPath>)formatter.Deserialize(kbStream);" in the learning machine class , eventough the stream is read from the recorded file(hello.replay).

Sep 29, 2011 at 2:07 PM

Send me your project on davca[at]microsoft[dot]com. I will check what is going wrong^^

Oct 14, 2011 at 1:40 PM

Hello David,

How can we record a new file using capture circle button and use it for gesture detection.Capture Circle Button has no code ,how can we implement this code?

I want to know how to generate the .save file so that it can be used for gesture detection.

Thanks in advance ,