Пример #1
0
        private void NetworkClient_DepthFrameArrived(object sender, DepthFramePacket e)
        {
            var subscribers = FrameArrived;

            if (subscribers != null)
            {
                Sensor.GetCoordinateMapper().DepthToColor = e.DepthToColorTransform;
                var depthArgs =
                    new DepthFrameArrivedEventArgs(
                        this,
                        e.Bitmap,
                        e.CameraIntrinsics);

                subscribers(this, depthArgs);
            }
        }
Пример #2
0
        private void DepthReader_FrameArrived(MediaFrameReader sender, MediaFrameArrivedEventArgs args)
        {
            var subscribers = FrameArrived;

            if (subscribers != null)
            {
                var frame = sender.TryAcquireLatestFrame();
                if (frame != null)
                {
                    Sensor.GetCoordinateMapper().UpdateFromDepth(frame.CoordinateSystem);
                    var depthArgs =
                        new DepthFrameArrivedEventArgs(
                            this,
                            frame.VideoMediaFrame.SoftwareBitmap,
                            new CameraIntrinsics(frame.VideoMediaFrame.CameraIntrinsics));

                    subscribers(this, depthArgs);
                }
            }
        }