Kinect for windows sdk tutorial




















This series will show you how to build a Windows 8. The lessons in this series work the best when completed in order. You can download a master copy of the complete app and all labs and referenced libraries through the github links on the left.

Or if you know a bit about development with the Kinect 2 already, you can skip to a particular lab by navigating to it at the top of the page. The running codebase is available through a link at the bottom of each page, which is complete and runnable as if you have just finished that lab. If you have any suggestions or would like to report any bugs, please leave some feedback on the Kinect Tutorial GitHub Issues page.

Enjoy the labs and have fun! We can now start coding! Here is the whole XAML code for you to look at and think, I will then go through how its done and what each line does. You can either drag and drop items from the toolbar which will automatically generate the code or just type the code in yourself. I have also created a label where the content changes depending on the current status of the Kinect. When the Kinect is connected it will say "Connected". These will have the current coordinate values for both wrists and also their state, whether they are raised or lowered.

Then when the window loads we are going to start the Kinect Chooser to get the Status of the kinect. The the label is updated by KinectSensorChooserKinectChanged, due to the switch we create in this function.

Here also the Skeleton is initialised. Enable ; sensor. Once we a tracking the Skeleton we can look for the X,Y and Z coordinates for specific points on the skeleton. In this example we are after the coordinates of the hands of the user. We show the values as text in the window in our textblocks. We then compare the Z position of the users hip to the Z position of their hand.

If it is over a certain threshold we are going to treat the users arm as being 'raised' and therefore print to the window which arm is up. SkeletonArrayLength]; skeletonFrame. CopySkeletonDataTo skeletons ;.

Tracked ;. WristRight]; XValueRight. ToString CultureInfo. InvariantCulture ; YValueRight. InvariantCulture ; ZValueRight. InvariantCulture ;. WristLeft]; XValueLeft. InvariantCulture ; YValueLeft. InvariantCulture ; ZValueLeft.

You can change the 0. You can see here the Kinect Sensor Chooser is blue showing the kinect is connected plus our label also agrees and says it is. We are also streaming position data from each of our hands and then comparing the Z distance of our hands and hip and if greater than 0. Here you can see the right hand is raised and left lowered. In this basic Hello World you hopefully have learnt how to start a new project, install the Kinect libraries, write some XAML to change how your app looks and then a little bit of C for the brains of the operation.

Now you are tracking the skeleton you can obtain the coordinates for any joint on the body, and by comparing these joints who knows what wonderful ideas you could come up with.

You could possibly make a dance along app where if certain distances between joints are hit you have completed a 'dance move'. Any way that's me over and out! Question 1 year ago on Step 2. Hello Doug, Thank you so much for this instructable. It's helping me a lot in my project. However, I have a question, when I typed the code on VS, it's showing an error in the line: kinectChooser.



0コメント

  • 1000 / 1000