Example #1
0
        private void UpdateVideoImage()
        {
            if (droneControl.IsConnected)
            {
                if ((Bitmap)droneControl.BitmapImage == null)
                {
                    return;
                }
                Bitmap newImage = (Bitmap)droneControl.BitmapImage.Clone();

                if (newImage != null)
                {
                    Image <Bgr, byte> image = new Image <Bgr, byte>(newImage);
                    opticalFlow.addFrame(image);
                    frameCountSinceLastCapture++;

                    if (videoRecorder.IsVideoCaptureRunning)
                    {
                        videoRecorder.AddFrame((System.Drawing.Bitmap)newImage.Clone());
                    }
                    if (opticalFlow._prevOpticalFlowFrame != null)
                    {
                        UpdateVisualImage(opticalFlow._prevOpticalFlowFrame.Bitmap);
                    }
                    //UpdateVisualImage(newImage);

                    //PerformStopSignDetection(newImage);
                }
            }
        }