Skip to content
This repository has been archived by the owner on Jan 29, 2023. It is now read-only.

This project contains extension methods to ease the use of the Kinect V2 SDK with the help of Rx.

Notifications You must be signed in to change notification settings

NickDarvey/Kinect.ReactiveV2

 
 

Repository files navigation

Kinect.ReactiveV2

This project contains extension methods to ease the use of the Kinect for Windows V2 SDK with the help of Rx.

“This is preliminary software and/or hardware and APIs are preliminary and subject to change”

##NuGet Installation PM> Install-Package Kinect.ReactiveV2

PM> Install-Package Kinect.ReactiveV2.Input

##Unity Installation ###Dependencies

###Adding to your Unity project Drag and drop the *.cs files from the Unity folder into your Plugins folder.

##Samples

###Kinect.ReactiveV2 ####SceneChanges

using System;
using System.Linq;
using System.Reactive;
using Microsoft.Kinect;
using Kinect.ReactiveV2;

var sensor = KinectSensor.Default;
sensor.Open();

sensor.SceneChanges()
      .Subscribe(_ =>
      {
            if (_.SceneChangedType is PersonEnteredScene)
            {
                  Console.WriteLine("Person {0} entered scene", _.SceneChangedType.TrackingId);
            }
            else if (_.SceneChangedType is PersonLeftScene)
            {
                  Console.WriteLine("Person {0} left scene", _.SceneChangedType.TrackingId);
            }
      });

####BodyIndexFrameArrivedObservable

using System.Linq;
using System.Reactive;
using Microsoft.Kinect;
using Kinect.ReactiveV2;

var sensor = KinectSensor.Default;
sensor.Open();

var bodyIndexFrameDescription = sensor.BodyIndexFrameSource.FrameDescription;
var bodyIndexData = new byte[bodyIndexFrameDescription.LengthInPixels];

sensor.BodyIndexFrameArrivedObservable()
      .SelectBodyIndexData(bodyIndexData)
      .Subscribe(data => someBitmap.WritePixels(rect, data, stride, 0));

###Kinect.ReactiveV2.Input

About

This project contains extension methods to ease the use of the Kinect V2 SDK with the help of Rx.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C# 98.9%
  • PowerShell 1.1%