Beispiel #1
0
        // gets the current frame and is triggered every new frame
        private void currentFrame(VideoStream vStream)
        {
            if (vStream.IsValid && vStream.IsFrameAvailable())
            {
                using (OpenNIWrapper.VideoFrameRef frame = vStream.ReadFrame())
                {
                    if (frame.IsValid)
                    {
                        VideoFrameRef.CopyBitmapOptions options = VideoFrameRef.CopyBitmapOptions.None | VideoFrameRef.CopyBitmapOptions.Force24BitRgb;
                        lock (this.m_Bitmap)
                        {
                            try
                            {
                                frame.UpdateBitmap(m_Bitmap, options);
                                Image <Bgra, Byte>  colorFrame = new Image <Bgra, Byte>(m_Bitmap);
                                Image <Gray, Int32> xFrame     = new Image <Gray, float>(m_Bitmap).Convert <Gray, Int32>();

                                CameraManager.Instance.SetImages(colorFrame, colorFrame, xFrame, xFrame);
                            }
                            catch (Exception exception)
                            {
                                Console.WriteLine("Exception occurred while updating frame.");
                                Console.WriteLine(exception.Message);
                            }
                        }
                    }
                }
            }
        }
Beispiel #2
0
        void depthSensor_onNewFrame(VideoStream vStream)
        {
            if (!vStream.isValid || !vStream.isFrameAvailable())
            return;

              VideoFrameRef frame = vStream.readFrame();
              if (!frame.isValid)
            return;

              lock (depthMutex)
              {
            depthFrame = frame;
              }
        }
Beispiel #3
0
        void colorSensor_onNewFrame(VideoStream vStream)
        {
            if (!vStream.isValid || !vStream.isFrameAvailable())
            return;

              VideoFrameRef frame = vStream.readFrame();
              if (!frame.isValid)
            return;

              lock (colorMutex)
              {
            colorFrame = frame;
              }
        }
Beispiel #4
0
        private void ColorSensor_OnNewFrame(VideoStream vStream)
        {
            if (!vStream.IsValid || !vStream.IsFrameAvailable())
                return;

            VideoFrameRef frame = vStream.ReadFrame();
            if (!frame.IsValid)
                return;

            lock (colorMutex)
            {
                colorFrame = frame;
            }
        }