From 2de7ff574556d32bb7f639175cc362516682cae2 Mon Sep 17 00:00:00 2001 From: DucDangAnh Date: Mon, 29 Jun 2020 09:35:05 +0700 Subject: [PATCH] LaneIn - capture one video frame then show UI. C3Device_OnNewCardReceived --- AIParkingApplication/LaneIn.cs | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/AIParkingApplication/LaneIn.cs b/AIParkingApplication/LaneIn.cs index ae4510a..96d3a32 100644 --- a/AIParkingApplication/LaneIn.cs +++ b/AIParkingApplication/LaneIn.cs @@ -65,10 +65,19 @@ namespace AIParkingApplication if (cardInfoResult.IsValid) { plateCamera.RequestCaptureOneFrame(); - await Task.Delay(500); - var videoFrame = plateCamera.CurrentFrame; + overviewCamera.RequestCaptureOneFrame(); + await Task.Delay(200); + var plateVideoFrame = plateCamera.CurrentFrame; + var overviewVideoFrame = overviewCamera.CurrentFrame; + + pictureBoxOverviewImage.Invoke(new Action(() => + { + pictureBoxOverviewImage.Image?.Dispose(); + pictureBoxOverviewImage.Image = overviewVideoFrame.ToBitmap(); + })); + + FinalPlateResult result = await ProcessFrameImage(plateProcessor, plateVideoFrame, isRetryMode); - FinalPlateResult result = await ProcessFrameImage(plateProcessor, videoFrame, isRetryMode); pictureBoxPlateImage.Invoke(new Action(() => { pictureBoxPlateImage.Image?.Dispose();