private void SetNewVideoImage() { if (droneControl.IsConnected) { System.Drawing.Image image = droneControl.BitmapImage; if (image != null) { frameCountSinceLastCapture++; if (videoRecorder.IsVideoCaptureRunning) { videoRecorder.AddFrame((System.Drawing.Bitmap)image.Clone()); } } ImageSource imageSource = droneControl.ImageSourceImage; if (imageSource != null && (droneControl.CurrentCameraType == DroneCameraMode.FrontCamera || droneControl.CurrentCameraType == DroneCameraMode.PictureInPictureFront)) { ImageSource resultingSource = hudInterface.DrawHud((BitmapSource)imageSource); imageVideo.Source = resultingSource; } else { imageVideo.Source = imageSource; } } }
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); } } }
private void SetNewVideoImage() { if (arDroneControl.IsConnected) { System.Drawing.Image newImage = arDroneControl.GetDisplayedImage(); if (newImage != null) { frameCountSinceLastCapture++; if (videoRecorder.IsVideoCaptureRunning) { videoRecorder.AddFrame((System.Drawing.Bitmap)newImage.Clone()); } pictureBoxVideo.Image = newImage; } } }
private void SetNewVideoImage() { if (arDroneControl.IsConnected) { System.Drawing.Image newImage = arDroneControl.GetDisplayedImage(); if (newImage != null) { frameCountSinceLastCapture++; if (videoRecorder.IsVideoCaptureRunning) { videoRecorder.AddFrame((System.Drawing.Bitmap)newImage.Clone()); } BitmapImage newBitmapImage = Utility.CreateBitmapImageFromImage(newImage); imageVideo.Source = newBitmapImage; } } }