• Stars
    star
    126
  • Rank 283,352 (Top 6 %)
  • Language
    C#
  • License
    Apache License 2.0
  • Created over 8 years ago
  • Updated over 8 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

The most accurate way to track fingers using Kinect v2.

Kinect Finger Tracking

The most accurate way to track fingers using Kinect v2. Why is it the best solution out there?

  • Tracks both hands simultaneously.
  • It lets you access the contour of the hand and the positions of the fingertips.
  • You can get the coordinates in the Depth, Color, and Camera space (3D and 2D).
  • Works between 0.5 and 5 meters (1.6 to 16 feet).
  • It is blazingly fast!

Video

Watch on YouTube

Finger tracking with Kinect - Vangos Pterneas

Usage

Finger Tracking is under the LightBuzz.Vitruvius.FingerTracking namespace. This namespace should be imported whenever you need to use the figner tracking capabilities.

using LightBuzz.Vitruvius.FingerTracking;

Everything is encapsulated into the HandsController class. To use the HandsController class, first create a new instace:

private HandsController _handsController = new HandsController();

You can specify whether the controller will detect the left hand (DetectLeftHand property), the right hand (DetectRightHand property), or both hands. By default, the controller tracks both hands.

Then, you'll need to subscribe to the HandsDetected event. This event is raised when a new set of hands is detected.

_handsController.HandsDetected += HandsController_HandsDetected;

Then, you have to udpate the HandsController with Depth and Body data. You'll need a DepthReader and a BodyReader (check the sample project for more details).

private void DepthReader_FrameArrived(object sender, DepthFrameArrivedEventArgs e)
{
  using (DepthFrame frame = e.FrameReference.AcquireFrame())
  {
    if (frame != null)
    {
      using (KinectBuffer buffer = frame.LockImageBuffer())
      {
        _handsController.Update(buffer.UnderlyingBuffer, _body);
      }
    }
  }
}

Finally, you can access the finger data by handling the HandsDetected event:

private void HandsController_HandsDetected(object sender, HandCollection e)
{
  if (e.HandLeft != null)
  {
    // Contour in the 2D depth space.
    var depthPoints = e.HandLeft.ContourDepth;
    
    // Contour in the 2D color space.
    var colorPoints = e.HandLeft.ContourColor;
    
    // Contour in the 3D camera space.
    var cameraPoints = e.HandLeft.ContourCamera;

    foreach (var finger in e.HandLeft.Fingers)
    {
      // Finger tip in the 2D depth space.
      var depthPoint = finger.DepthPoint;
      
      // Finger tip in the 2D color space.
      var colorPoint = finger.ColorPoint;
      
      // Finger tip in the 3D camera space.
      var cameraPoint = finger.CameraPoint;
    }
  }

  if (e.HandRight != null)
  {
    // Do something with the data...
  }
}

Contributors

License

You are free to use these libraries in personal and commercial projects by attributing the original creator of the project. View full License.

More Repositories

1

Vitruvius

A set of easy-to-use Kinect utilities that will speed-up the development of your projects.
C#
228
star
2

Speech-Recognition-Unity

Speech recognition in Unity3D.
C#
143
star
3

Body-Tracking-ARKit

Sample use of Unity's ARFoundation and ARKit3 body tracking
C#
108
star
4

Kinect-HTML5

Display Kinect data on an HTML5 canvas using WebSockets
C#
66
star
5

Azure-Unity

The definitive Azure SDK for Unity3D with local SQLite database support.
C#
56
star
6

Archiver-Unity

Compress and decompress files and folders in Unity3D.
C#
40
star
7

Hololens-Pokemon-Go

Pokemon Go Demo in HoloLens
C#
23
star
8

Kinect-Drawing

A simple drawing app using Kinect, C#, and XAML.
C#
23
star
9

Kinect-2-CSV

Save Kinect body data into a CSV file (and view it as an Excel spreadsheet)
C#
21
star
10

SMTP-WinRT

An SMTP client for WinRT. Send emails from within your Windows 8 and Windows Phone app.
C#
21
star
11

Kinect-Weight-Lifting-Bar

Detect a weight-lifting bar using Kinect for Windows version 2.
C#
20
star
12

RealSense

C# utilities for the Intel RealSense D415/435
C#
16
star
13

Kinect-Floor

Floor detection using Kinect v2.
C#
14
star
14

OpenCV

OpenCV for iOS and VisionOS.
C++
11
star
15

Settings-Unity

Settings utility for Unity3D.
C#
9
star
16

Speech-Recognition-Android

Speech (Voice) Recognition using Java and Android.
Java
9
star
17

Kinect-Basketball-Spinner

Basketball Spinner using Kinect v2 and Unity3D. Augmented Reality App.
C#
8
star
18

Unity-Package-Export

Export an existing Unity Package as a tarball (.tgz) file.
C#
5
star
19

Azure-HoloLens

Connects to an Azure App Service and fetches data to a HoloLens application.
C#
4
star
20

Mobile-AR

Showcasing ARFoundation, ARCore and ARKit
C#
4
star
21

Localization-UWP

Explicit Localization in Windows Universal Platform
C#
4
star
22

Encryption-WinRT

A simple encryption provider for WinRT apps. Can be used with SQLite databases.
C#
3
star
23

Unity-Canvas-Scaler

An handy canvas scaler for cross-platform Unity apps and games.
C#
3
star
24

HoloLens-App

Showcasing Microsoft HoloLens features
C#
3
star
25

Archiver-WinRT

Compress and decompress files and folders in WinRT
C#
2
star
26

Settings-WinRT

Settings utility for WinRT
C#
1
star