[#KINECTSDK] HowTo: Display the Depth Sensor feed with #Vitruvius

Hello!

After the quick post from yesterday about how show camera with Vituvius feed, today a slight variation on it to show the Feed of the depth Sensor.

In this case, the subscription is event DepthFrameReady (line 21) and on line 25 can see how processed the same.

   1: using System.Windows;
   2: using LightBuzz.Vitruvius;
   3: using LightBuzz.Vitruvius.WPF;
   4: using Microsoft.Kinect;
   5:  
   6: namespace WPFAppVit02
   7: {
   8:     public partial class MainWindow : Window
   9:     {
  10:         public MainWindow()
  11:         {
  12:             InitializeComponent();
  13:             Loaded += MainWindow_Loaded;
  14:         }
  15:  
  16:         void MainWindow_Loaded(object sender, RoutedEventArgs e)
  17:         {
  18:             var sensor = SensorExtensions.Default();
  19:             if (sensor == null) return;
  20:             sensor.EnableAllStreams();
  21:             sensor.DepthFrameReady += Sensor_DepthFrameReady;
  22:             sensor.Start();
  23:         }
  24:  
  25:         void Sensor_DepthFrameReady(object sender, DepthImageFrameReadyEventArgs e)
  26:         {
  27:             using (var frame = e.OpenDepthImageFrame())
  28:             {
  29:                 if (frame != null)
  30:                 {
  31:                     ImageDepth.Source = frame.ToBitmap();
  32:                 }
  33:             }
  34:         }
  35:     }
  36: }

Happy Coding!

Saludos @ Home

El Bruno

image image image Google

[#KINECTSDK] HowTo: Mostrar el feed del Depth Sensor con #Vitruvius

Hola!

Después del quick post de ayer sobre cómo mostrar el feed de la camára con Vituvius, hoy una pequeña variación sobre el mismo para mostrar el Feed del Sensor de Profundidad.

En este caso, la suscripción es al evento DepthFrameReady (línea 21) y en la línea 25 podemos ver como se procesa el mismo.

   1: using System.Windows;

   2: using LightBuzz.Vitruvius;

   3: using LightBuzz.Vitruvius.WPF;

   4: using Microsoft.Kinect;

   5:  

   6: namespace WPFAppVit02

   7: {

   8:     public partial class MainWindow : Window

   9:     {

  10:         public MainWindow()

  11:         {

  12:             InitializeComponent();

  13:             Loaded += MainWindow_Loaded;

  14:         }

  15:  

  16:         void MainWindow_Loaded(object sender, RoutedEventArgs e)

  17:         {

  18:             var sensor = SensorExtensions.Default();

  19:             if (sensor == null) return;

  20:             sensor.EnableAllStreams();

  21:             sensor.DepthFrameReady += Sensor_DepthFrameReady;

  22:             sensor.Start();

  23:         }

  24:  

  25:         void Sensor_DepthFrameReady(object sender, DepthImageFrameReadyEventArgs e)

  26:         {

  27:             using (var frame = e.OpenDepthImageFrame())

  28:             {

  29:                 if (frame != null)

  30:                 {

  31:                     ImageDepth.Source = frame.ToBitmap();

  32:                 }

  33:             }

  34:         }

  35:     }

  36: }

Happy Coding!

Saludos @ Valencia

El Bruno

image image image Google

[#KINECTSDK] HowTo: Display the camera feed with #Vitruvius

Hello!

A couple of days ago I wrote a post about Vitruvius, and after this I get a couple of questions about this, so I’ll decide to write a couple of posts to describe how to use Vitruvius.

First of all, download the latest version of Vitruvius and build the solution (important: it has references to the Kinect dlls with a fixed path, you will have to fix them).

Once the solution is built, follow these steps.

1. Create a Wpf app project

2 Add external references to the Kinect Dll and also to

-%\Program Files\Microsoft SDKs\Kinect\Developer Toolkit v1.8.0\Assemblies\Microsoft.Kinect.Toolkit.dll

-%\Program Files\Microsoft SDKs\Kinect\Developer Toolkit v1.8.0\Assemblies\Microsoft.Kinect.Toolkit.BackgroundRemoval.dll

4. Add a reference to [LightBuzz.Vitruvius] and [LightBuzz.Vitruvius.WPF].

5. Change the compilation of the project to x86

6. Change the MainWindow.xaml file

   1: <Window x:Class="WpfVit01.MainWindow"

   2:         xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"

   3:         xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"

   4:         Title="El Bruno - Vituvius Camera Feed"

   5:         Height="480"

   6:         Width="640">

   7:     <Grid>

   8:         <Image Name="ImageCamera" />

   9:     </Grid>

  10: </Window>

And then the same code CS

   1: using System.Windows;

   2: using LightBuzz.Vitruvius;

   3: using LightBuzz.Vitruvius.WPF;

   4: using Microsoft.Kinect;

   5:  

   6: namespace WpfVit01

   7: {

   8:     public partial class MainWindow : Window

   9:     {

  10:         public MainWindow()

  11:         {

  12:             InitializeComponent();

  13:             Loaded += MainWindow_Loaded;

  14:         }

  15:  

  16:         void MainWindow_Loaded(object sender, RoutedEventArgs e)

  17:         {

  18:             var sensor = SensorExtensions.Default();

  19:             if (sensor == null) return;

  20:             sensor.EnableAllStreams();

  21:             sensor.ColorFrameReady += Sensor_ColorFrameReady;

  22:             sensor.Start();

  23:         }

  24:         void Sensor_ColorFrameReady(object sender, ColorImageFrameReadyEventArgs e)

  25:         {

  26:             using (var frame = e.OpenColorImageFrame())

  27:             {

  28:                 if (frame == null) return;

  29:                 ImageCamera.Source = frame.ToBitmap();

  30:             }

  31:         }

  32:  

  33:     }

  34: }

7 Run and ready!

image

With about 30 lines we have running our Kinect as a camera.

Saludos @ Valencia

El Bruno

image image image Google

[#KINECTSDK] HowTo: Mostrar el feed de la camara con Vitruvius

Hola!

Hace un par de días escribí un post sobre Vitruvius, y como me entraron 2 preguntas sobre el mismo, voy a dedicarle un par de posts ya que, realmente simplifica el desarrollo con Kinect.

Pues bien, primero lo primero, descargar la última versión de Vitruvius y compilar la misma (detalle, tiene las referencias a las dlls de Kinect en un path fijo, deberás arreglar las mismas).

Una vez compilada la solución, seguimos los siguientes pasos.

1. Creamos un proyecto de tipo WPF app

2. Agregamos referencias externas a la Dll de Kinect y a

- %\Program Files\Microsoft SDKs\Kinect\Developer Toolkit v1.8.0\Assemblies\Microsoft.Kinect.Toolkit.dll

- %\Program Files\Microsoft SDKs\Kinect\Developer Toolkit v1.8.0\Assemblies\Microsoft.Kinect.Toolkit.BackgroundRemoval.dll

4. Agregamos una referencia a [LightBuzz.Vitruvius] y [LightBuzz.Vitruvius.WPF].

5. Cambiamos la compilación del proyecto para que sea X86

6. Modificamos el archivo MainWindow.xaml

   1: <Window x:Class="WpfVit01.MainWindow"

   2:         xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"

   3:         xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"

   4:         Title="El Bruno - Vituvius Camera Feed"

   5:         Height="480"

   6:         Width="640">

   7:     <Grid>

   8:         <Image Name="ImageCamera" />

   9:     </Grid>

  10: </Window>

 

Y luego el código CS del mismo

   1: using System.Windows;

   2: using LightBuzz.Vitruvius;

   3: using LightBuzz.Vitruvius.WPF;

   4: using Microsoft.Kinect;

   5:  

   6: namespace WpfVit01

   7: {

   8:     public partial class MainWindow : Window

   9:     {

  10:         public MainWindow()

  11:         {

  12:             InitializeComponent();

  13:             Loaded += MainWindow_Loaded;

  14:         }

  15:  

  16:         void MainWindow_Loaded(object sender, RoutedEventArgs e)

  17:         {

  18:             var sensor = SensorExtensions.Default();

  19:             if (sensor == null) return;

  20:             sensor.EnableAllStreams();

  21:             sensor.ColorFrameReady += Sensor_ColorFrameReady;

  22:             sensor.Start();

  23:         }

  24:         void Sensor_ColorFrameReady(object sender, ColorImageFrameReadyEventArgs e)

  25:         {

  26:             using (var frame = e.OpenColorImageFrame())

  27:             {

  28:                 if (frame == null) return;

  29:                 ImageCamera.Source = frame.ToBitmap();

  30:             }

  31:         }

  32:  

  33:     }

  34: }

7. Run y listo !!!

image

Con poco más de 30 líneas tenemos funcionando nuestro Kinect como una cámara.

 

Saludos @ Home

El Bruno

image image image Google

[#KINECTSDK] Vitruvius, amazing library to create KinectSdk apps

Hello!

I still accommodating old posts and now it’s time to write some lines about this amazin library to work with KinectSDK: Vitruvius. The reference of the name is great so I won’t go into much detail about this. And if you work with Color, Depth or Skeleton Frames this library makes you life much simpler.

A couple of source code examples from the product homepage, are the best possible explanation

Color Frame

   1: void Sensor_ColorFrameReady(object sender, ColorImageFrameReadyEventArgs e)

   2: {

   3:     using (var frame = e.OpenColorImageFrame())

   4:     {

   5:         if (frame != null)

   6:         {

   7:             // Display on screen

   8:             image.Source = frame.ToBitmap();

   9:  

  10:             // Capture JPEG file

  11:             frame.Capture("C:\\ColorFrame.jpg");

  12:         }

  13:     }

  14: }

Gestures

   1: GestureController gestureController = new GestureController(GestureType.All);

   2: gestureController.GestureRecognized += GestureController_GestureRecognized;

   3:  

   4: // ...

   5:  

   6: void Sensor_SkeletonFrameReady(object sender, SkeletonFrameReadyEventArgs e)

   7: {

   8:     using (var frame = e.OpenSkeletonFrame())

   9:     {

  10:         if (frame != null)

  11:         {

  12:             var skeletons = frame.Skeletons().Where(s => s.TrackingState == SkeletonTrackingState.Tracked);

  13:  

  14:             foreach (var skeleton in skeletons)

  15:             {

  16:                 if (skeleton != null)

  17:                 {

  18:                     // Update skeleton gestures.

  19:                     gestureController.Update(skeleton);

  20:                 }

  21:             }

  22:         }

  23:     }

  24: }

  25:  

  26: // ...

  27:  

  28: void GestureController_GestureRecognized(object sender, GestureEventArgs e)

  29: {

  30:     // Display the recognized gesture's name.

  31:     Debug.WriteLine(e.Name);

  32: }

Saludos @ Home

El Bruno

image image image Google

[#KINECTSDK] Vitruvius, impresionante library para KinectSdk

Hola!

Sigo acomodando posts viejos y hoy le toca a esta excelente library para trabajar con KinectSDK: Vitruvius. La referencia es muy básica así que no entraré en detalles sobre el nombre. Eso sí, si trabajas con Color, Depth o Skeleton Frames esta library te hace la vida mucho más simple.

Un par de ejemplos sacados de su homepage, son la mejor explicación posible

Color Frame

   1: void Sensor_ColorFrameReady(object sender, ColorImageFrameReadyEventArgs e)

   2: {

   3:     using (var frame = e.OpenColorImageFrame())

   4:     {

   5:         if (frame != null)

   6:         {

   7:             // Display on screen

   8:             image.Source = frame.ToBitmap();

   9:  

  10:             // Capture JPEG file

  11:             frame.Capture("C:\\ColorFrame.jpg");

  12:         }

  13:     }

  14: }

Gestures

   1: GestureController gestureController = new GestureController(GestureType.All);

   2: gestureController.GestureRecognized += GestureController_GestureRecognized;

   3:  

   4: // ...

   5:  

   6: void Sensor_SkeletonFrameReady(object sender, SkeletonFrameReadyEventArgs e)

   7: {

   8:     using (var frame = e.OpenSkeletonFrame())

   9:     {

  10:         if (frame != null)

  11:         {

  12:             var skeletons = frame.Skeletons().Where(s => s.TrackingState == SkeletonTrackingState.Tracked);

  13:  

  14:             foreach (var skeleton in skeletons)

  15:             {

  16:                 if (skeleton != null)

  17:                 {

  18:                     // Update skeleton gestures.

  19:                     gestureController.Update(skeleton);

  20:                 }

  21:             }

  22:         }

  23:     }

  24: }

  25:  

  26: // ...

  27:  

  28: void GestureController_GestureRecognized(object sender, GestureEventArgs e)

  29: {

  30:     // Display the recognized gesture's name.

  31:     Debug.WriteLine(e.Name);

  32: }

 

HomePage: https://github.com/lightbuzz/vitruvius

Saludos @ La Finca

El Bruno

image image image Google

[#WEBCAST] Materials for the event: Build apps with #KinectSdk

Hello!

today one quick post … the materials of the Kinect event

Source Code: http://1drv.ms/1eyEhTc (don’t expect much that is based on Kinect Toolkit and the internet in Germany I gave more problems than a jealous girlfriend)

Greetings @ Munich

El Bruno

imageimageimageGoogle

[#WEBCAST] Materiales del evento construyendo aplicaciones con #KinectSdk

Hola!

uno rapidito hoy .. los materiales del evento sobre Kinect

Source Code: http://1drv.ms/1eyEhTc (no esperes mucho que está basado en Kinect Toolkit y la conexión de internet en Alemania me dió mas problemas que una novia celosa)

Saludos @ Munich

El Bruno

image image image Google

[#EVENT] WebCast: Building applications with #KinectSDK

Hello!

My friends from MSDN Latin America reminds me, that next Wednesday afternoon I will host a webcast about development of applications with KinectSDK. Obviously I will take this opportunity to also show something of the new Kinect SDK v2 and the new Kinect One. For Europe will be at the 1000 PM and I hope to have a good connection, because I will be in Munich watching, among other things, the amazing Car Museum!

See you! and that good memories…


 

Registro: https://msevents.microsoft.com/CUI/EventDetail.aspx?EventID=1032577903&Culture=es-AR&community=0

Saludos @ Home

El Bruno

image    image    image    Google

[#EVENT] WebCast: Construyendo Aplicaciones con #KinectSDK

Hola!

apunten amigos de MSDN Latinoamérica, el próximo miércoles por la tarde participaré en un webcast sobre el desarrollo de applicaciones con KinectSDK. Obviamente aprovecharé la oportunidad para mostrar también algo del nuevo Kinect SDK v2 y la nueva Kinect. Para Europa será a las 1000PM y espero tener una buena conexión, porque estaré en Munich viendo, entre otras cosas, el increíble museo del automóvil!

Nos vemos! y que buenos recuerdos …

image

 

Registro: https://msevents.microsoft.com/CUI/EventDetail.aspx?EventID=1032577903&Culture=es-AR&community=0

Saludos @ Home

El Bruno

image image image Google