LaneIn - Check card info then do recognize plate. ApiController: CardValidation IsValid change type.
This commit is contained in:
parent
44eb7c3ee7
commit
b8e88aaafe
|
@ -195,7 +195,7 @@ namespace AIParkingApplication
|
||||||
public class CardValidation
|
public class CardValidation
|
||||||
{
|
{
|
||||||
[JsonProperty("status")]
|
[JsonProperty("status")]
|
||||||
public string IsValid { get; set; }
|
public bool IsValid { get; set; }
|
||||||
|
|
||||||
[JsonProperty("type")]
|
[JsonProperty("type")]
|
||||||
public string Direction { get; set; }
|
public string Direction { get; set; }
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
using System;
|
using System;
|
||||||
|
using System.Drawing;
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using System.Windows.Forms;
|
using System.Windows.Forms;
|
||||||
|
@ -62,9 +63,10 @@ namespace AIParkingApplication
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void C3Device_OnNewCardReceived(int doorId, string cardNumber)
|
private async void C3Device_OnNewCardReceived(int doorId, string cardNumber)
|
||||||
{
|
{
|
||||||
Task.Factory.StartNew(async () =>
|
var cardInfoResult = await apiController.CheckCard(cardNumber);
|
||||||
|
if (cardInfoResult.IsValid)
|
||||||
{
|
{
|
||||||
plateCamera.RequestCaptureOneFrame();
|
plateCamera.RequestCaptureOneFrame();
|
||||||
await Task.Delay(500);
|
await Task.Delay(500);
|
||||||
|
@ -88,7 +90,15 @@ namespace AIParkingApplication
|
||||||
c3Device.OpenDoor(doorId);
|
c3Device.OpenDoor(doorId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
lblRecogizePlateStatus.Invoke(new Action(() =>
|
||||||
|
{
|
||||||
|
lblRecogizePlateStatus.BackColor = Color.Purple;
|
||||||
|
lblRecogizePlateStatus.Text = "THẺ KHÔNG HỢP LỆ";
|
||||||
|
}));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void PlateCamera_OnOpenVideoStreamFailed(Mat videoFrame)
|
private void PlateCamera_OnOpenVideoStreamFailed(Mat videoFrame)
|
||||||
|
@ -130,7 +140,7 @@ namespace AIParkingApplication
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
//TODO: check size before resizing
|
//TODO: check size before resizing
|
||||||
Cv2.Resize(frame, frame, new Size(1280, 720));
|
Cv2.Resize(frame, frame, new OpenCvSharp.Size(1280, 720));
|
||||||
FinalPlateResult finalPlateResult = await plateProcessor.ProcessPlate(frame);
|
FinalPlateResult finalPlateResult = await plateProcessor.ProcessPlate(frame);
|
||||||
|
|
||||||
if (isRetryMode && !plateProcessor.IsPlateStringValid(finalPlateResult.PlateString))
|
if (isRetryMode && !plateProcessor.IsPlateStringValid(finalPlateResult.PlateString))
|
||||||
|
|
Loading…
Reference in New Issue
Block a user