public static Bitmap ToBitmap(this Microsoft.Kinect.DepthFrame image, System.Drawing.Imaging.PixelFormat format)
 {
     if (image == null || image.FrameDescription.LengthInPixels == 0)
     {
         return(null);
     }
     ushort[] data = new ushort[image.FrameDescription.LengthInPixels];
     image.CopyFrameDataToArray(data);
     return(data.ToBitmap(image.FrameDescription.Width, image.FrameDescription.Height, format));
 }
Exemplo n.º 2
0
        public DepthFrame(Microsoft.Kinect.DepthFrame df)
        {
            Type = FrameType.Depth;
            this.underlyingDepthFrame = df;
            // Set Dimensions of the depth frame
            Width  = df.DepthFrameSource.FrameDescription.Width;
            Height = df.DepthFrameSource.FrameDescription.Height;

            // Reserve memory for storing depth data
            if (depthData == null)
            {
                depthData = new ushort[Width * Height];
            }

            // Copy depth data to memory reserved earlier
            df.CopyFrameDataToArray(this.depthData);
        }
 public DepthFrame(Microsoft.Kinect.DepthFrame depthFrame)
 {
     _depthFrame = depthFrame ?? throw new ArgumentNullException(nameof(depthFrame));
 }
Exemplo n.º 4
0
 public LHDepthFrame(Microsoft.Kinect.DepthFrame df, ClosestBodyFrame cbf) : base(df, cbf)
 {
     Type = FrameType.LHDepth;
 }