/*
  * Event
  */
 private void HelperReady()
 {
     helper   = KinectHelper.Instance;
     skeleton = helper.GetFixedSkeleton();
     GreenScreen.RenderImageData(helper.DepthImagePixels, helper.ColorPixels);
     Accessories.SetSkeletons(helper.Skeletons);
     KinectHelper.Instance.SetTransform(GreenScreen);
     KinectHelper.Instance.SetTransform(Accessories);
 }
Exemple #2
0
        /*Callback fur ein fertiges Frame vom Kinect-Sensor*/
        private void HelperReady()
        {
            var      helper   = KinectHelper.Instance;
            Skeleton skeleton = helper.GetFixedSkeleton();

            if (skeleton != null)
            {
                RectNavigationControl.GestureRecognition(skeleton);
            }
            GreenScreen.RenderImageData(helper.DepthImagePixels, helper.ColorPixels);
            SetAccessoriesNew(helper);
            KinectHelper.Instance.SetTransform(GreenScreen);
            KinectHelper.Instance.SetTransform(Accessories);
            KinectHelper.Instance.SetTransform(RectNavigationControl);
        }
Exemple #3
0
        /// <summary>
        /// Event handler for Kinect sensor's DepthFrameReady event
        /// </summary>
        /// <param name="sender">object sending the event</param>
        /// <param name="e">event arguments</param>
        private void SensorAllFramesReady(object sender, AllFramesReadyEventArgs e)
        {
            // in the middle of shutting down, so nothing to do
            if (null == this.sensor)
            {
                return;
            }

            bool depthReceived = false;
            bool colorReceived = false;

            using (DepthImageFrame depthFrame = e.OpenDepthImageFrame())
            {
                if (null != depthFrame)
                {
                    // Copy the pixel data from the image to a temporary array
                    depthFrame.CopyDepthImagePixelDataTo(this.depthPixels);

                    depthReceived = true;
                }
            }

            using (ColorImageFrame colorFrame = e.OpenColorImageFrame())
            {
                if (null != colorFrame)
                {
                    // Copy the pixel data from the image to a temporary array
                    colorFrame.CopyPixelDataTo(this.colorPixels);

                    colorReceived = true;
                }
            }

            // do our processing outside of the using block
            // so that we return resources to the kinect as soon as possible


            // do our processing outside of the using block
            // so that we return resources to the kinect as soon as possible
            if (depthReceived && colorReceived)
            {
                GreenScreen.RenderImageData(depthPixels, colorPixels);
            }
        }