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

Leave a comment

Discover more from El Bruno

Subscribe now to keep reading and get access to the full archive.

Continue reading