Detect a weight-lifting bar using Kinect for Windows version 2.
- Kinect for XBOX v2 sensor with an adapter (or Kinect for Windows v2 sensor)
- Kinect for Windows v2 SDK
- Windows 8.1 or higher
- Visual Studio 2013 or higher
- A dedicated USB 3 port
Read the tutorial on Vangos Pterneas Blog
// 1) Initialization
var barDetectionEngine = new BarDetectionEngine(
sensor.CoordinateMapper,
colorWidth,
colorHeight,
depthWidth,
depthHeight);
barDetectionEngine.BarDetected += BarDetectionEngine_BarDetected;
// 2) Update
barDetectionEngine.Update(depthData, bodyIndexData, body);
// 3) Event handling
private void BarDetectionEngine_BarDetected(object sender, BarDetectionResult e)
{
if (e != null)
{
var center = e.Trail;
var height = e.BarHeight;
var length = e.barLength;
var left = e.Minimum;
var right = e.maximum;
}
}
- Vangos Pterneas from LightBuzz
You are free to use these libraries in personal and commercial projects by attributing the original creator of the project. View full License.