Skip to content

A set of easy-to-use Kinect utilities that will speed-up the development of your projects.

License

Notifications You must be signed in to change notification settings

khushah/Vitruvius

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Vitruvius

Vitruvius is a set of easy-to-use Kinect utilities that will speed-up the development of your projects. Supports gesture detection, skeleton drawing, frame capturing, voice recognition and much more.

Vitruvius works with Kinect SDK version 2 and 1.8.

Features

Body extensions (universal)

  • Joint scaling, proper for on-screen display
  • User height
  • Distance between joints
  • One-line body tracking
  • Angle calculations

WinRT, WPF, & WinForms extensions

  • Project points on screen
  • Easily display color, depth and infrared frames
  • Save Kinect frames as bitmap images
  • One-line skeleton drawing
  • Record color, depth and infrared streams and save into video files (WinRT only)

NUI controls (universal)

  • Kinect Smart Viewer
  • Kinect Angle

Gestures (universal)

  • WaveLeft
  • WaveRight
  • SwipeLeft
  • SwipeRight
  • JoinedHands
  • SwipeUp
  • SwipeDown
  • ZoomIn
  • ZoomOut
  • Menu

Voice recognition & text-to-speech (v1 only)

  • Recognize voice commands
  • Speech synthesis

Prerequisites

Kinect version 2

Kinect version 1

Installation

  • Download project's source code and build the solution that matches the version of your sensor. NuGet packages will be available soon.

Examples

  1. Displaying Kinect color frames:

     void Sensor_ColorFrameReady(object sender, ColorImageFrameReadyEventArgs e)
     {
         using (var frame = e.OpenColorImageFrame())
         {
             if (frame != null)
             {
                 // Display on screen
                 image.Source = frame.ToBitmap();
                 
                 // Save the JPEG file
                 frame.Save("C:\\ColorFrame.jpg");
             }
         }
     }
    
  2. Displaying Kinect depth frames:

     void Sensor_DepthFrameReady(object sender, DepthImageFrameReadyEventArgs e)
     {
         using (var frame = e.OpenDepthImageFrame())
         {
             if (frame != null)
             {
                 // Display on screen
                 image.Source = frame.ToBitmap();
                 
                 // Save the JPEG file
                 frame.Save("C:\\DepthFrame.jpg");
             }
         }
     }
    
  3. Getting the height of a body:

     void Sensor_SkeletonFrameReady(object sender, SkeletonFrameReadyEventArgs e)
     {
         using (var frame = e.OpenSkeletonFrame())
         {
             if (frame != null)
             {
                 canvas.ClearSkeletons();
                 
                 var skeletons = frame.Skeletons().Where(s => s.TrackingState == SkeletonTrackingState.Tracked);
                 
                 foreach (var skeleton in skeletons)
                 {
                     if (skeleton != null)
                     {
                         // Get the skeleton height.
                         double height = skeleton.Height();
                     }
                 }
             }
         }
     }
    
  4. Detecting gestures:

     GestureController gestureController = new GestureController();
     gestureController.GestureRecognized += GestureController_GestureRecognized;
     
     // ...
     
     void Sensor_SkeletonFrameReady(object sender, SkeletonFrameReadyEventArgs e)
     {
         using (var frame = e.OpenSkeletonFrame())
         {
             if (frame != null)
             {
                 var skeletons = frame.Skeletons().Where(s => s.TrackingState == SkeletonTrackingState.Tracked);
                 
                 foreach (var skeleton in skeletons)
                 {
                     if (skeleton != null)
                     {
                         // Update skeleton gestures.
                         gestureController.Update(skeleton);
                     }
                 }
             }
         }
     }
     
     // ...
     
     void GestureController_GestureRecognized(object sender, GestureEventArgs e)
     {
         // Display the recognized gesture's name.
         Debug.WriteLine(e.GestureType);
     }
    
  5. Recognizing and synthesizing voice:

     VoiceController voiceController = new VoiceController();
     voiceController.SpeechRecognized += VoiceController_SpeechRecognized;
     
     KinectSensor sensor = SensorExtensions.Default();
     List<string> phrases = new List<string> { "Hello", "Goodbye" };
     
     voiceController.StartRecognition(sensor, phrases);
     
     // ...
     
     void VoiceController_SpeechRecognized(object sender, Microsoft.Speech.Recognition.SpeechRecognizedEventArgs e)
     {
         string text = e.Result.Text;
         
         voiceController.Speak("I recognized the words: " + text);
     }
    

Contributors

License

You are free to use these libraries in personal and commercial projects by attributing the original creator of Vitruvius. Licensed under Apache v2 License.

About

A set of easy-to-use Kinect utilities that will speed-up the development of your projects.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C# 85.2%
  • XML 14.0%
  • Other 0.8%