7 Replies Latest reply on Sep 16, 2018 3:33 AM by qajhsieh

    How to modify program to show infrared data in c# wrapper RealSense SDK2 tutorial-3

    qajhsieh

      1.Background:
      (1)My environment included: vs 2015, c#, wpf project, RealSense SDK2.12, D435 device, win 10 OS
      (2)I rebuilt the tutorials 1,2,3 in the c# wrapper SDK2 samples to display depth and color images, that is ok.
      (3)I modified the FrameSet.cs to display the infrared stream, that is ok, the snip code is as following :
      (add in FrameSet.cs)
      public VideoFrame InfraredFrame {
         get {
            foreach (var frame in this) {
              if (frame.Profile.Stream == Stream.Infrared)
                 return frame as VideoFrame;
              frame.Dispose();
            }
            return null;
         }
      }
      (tutorial-2)
      (in UploadImage function)
      PixelFormats.Rgb24-->PixelFormats.Gray8
      (in CaptureWindow function)
      cfg.EnableStream(Stream.Infrared, Format.Y8);
      var infreared_frame = frames.InfraredFrame;
      UploadImage(imgInfrared, infreared_frame);

       

      2.My Question: How to modify program to show infrared data in c# wrapper SDK2 tutorial-3


      I modified the tutorial-3 as the following snip code, but it don't work.
      (in ProcessingWindow function)
      cfg.EnableStream(Stream.Infrared, Format.Y8);
      (in block.Start)
      var infreared_frame = FramesReleaser.ScopedReturn(releaser, frames.InfraredFrame);
      UploadImage(imgInfrared, infreared_frame);