PlateProcessor - Add Try Catch In Method DetectPlateAndDoOcrEngineAsync
This commit is contained in:
@@ -32,7 +32,6 @@ namespace AIParkingApplication
|
||||
|
||||
private async Task<FinalPlateResult> DetectPlateAndDoOcrEngineAsync(PlateType plateType, Mat frame)
|
||||
{
|
||||
//TODO: check size before resizing
|
||||
Mat plateDetected = plateType == PlateType.Square ? squarePlateDetector.DetectPlate(frame) : longPlateDetector.DetectPlate(frame);
|
||||
|
||||
//TODO: check size before resizing
|
||||
@@ -62,6 +61,8 @@ namespace AIParkingApplication
|
||||
}
|
||||
|
||||
public async Task<FinalPlateResult> ProcessPlate(Mat frame)
|
||||
{
|
||||
try
|
||||
{
|
||||
//TODO: check size before resizing
|
||||
Cv2.Resize(frame, frame, new OpenCvSharp.Size(1280, 720));
|
||||
@@ -83,6 +84,12 @@ namespace AIParkingApplication
|
||||
|
||||
return plateResult;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Console.WriteLine($"{Util.GetCurrentMethodName()}\texMessage: {ex.Message}");
|
||||
return new FinalPlateResult();
|
||||
}
|
||||
}
|
||||
|
||||
//TODO: Complete this
|
||||
private string NormalizePlateString(string plateString)
|
||||
|
||||
Reference in New Issue
Block a user