Pumping iron with Kinect for Windows

No, you aren’t going to clean and jerk the Kinect sensor—and given its compact size, that wouldn’t be much of an exercise anyway. What you can do, with the tutorial provided by Vangos Pterneas (a Microsoft Kinect Most Valuable Professional), is build a Kinect for Windows application that will recognize your barbell and measure how far you’ve raised it from the floor.

[embed]https://www.youtube.com/watch?v=R0LygrFHoEE[/embed]

While this application can be useful for weightlifters, letting them track their progress day after day, the real beauty of Pterneas’s tutorial is that it shows developers how to use the Kinect for Xbox One sensor to recognize and track a physical object—in this case, a barbell. As Pterneas notes, “Kinect can recognize human body joints out-of-the-box. Body tracking is built into the SDK. However, there is no built-in way to recognize physical objects.”

Rather than rely on tracking objects by processing RGB color images, Pterneas uses the Kinect sensor’s depth detecting capabilities to create a 512 x 424 point cloud, complete with the horizontal distance between each point and the sensor plane. He then uses the sensor’s body tracking capabilities and the Kinect for Windows SDK’s BodyIndexFrames feature to identify the weightlifter’s hand positions in three-dimensional space, and from those data he can determine the depth points that make up the barbell. After a few more refinements—like excluding depth points that belong to the weightlifter’s body—Pterneas’ app processes the barbell points to calculate the distance, height, and angle of the bar.

Want to see the code? It’s on GitHub, so go take a look. And while you work your way through the tutorial, keep in mind how you could adapt this approach to create other applications that measure the position of physical objects as they are moved by Kinect-recognized body parts.

The Kinect for Windows Team

Key links