PlateProcessor - ProcessPlate: Catch Exception Return Result with frame, Remove Cv2.Resize Frame.
This commit is contained in:
parent
7fcb3cc5c6
commit
f9fcca2902
|
@ -61,6 +61,8 @@ namespace AIParkingApplication
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
//TODO: check size before resizing
|
||||||
|
Cv2.Resize(videoFrame, videoFrame, new Size(1280, 720));
|
||||||
FinalPlateResult finalPlateResult = await plateProcessor.ProcessPlate(videoFrame);
|
FinalPlateResult finalPlateResult = await plateProcessor.ProcessPlate(videoFrame);
|
||||||
|
|
||||||
if (isRetryMode && !plateProcessor.IsPlateStringValid(finalPlateResult.PlateString))
|
if (isRetryMode && !plateProcessor.IsPlateStringValid(finalPlateResult.PlateString))
|
||||||
|
|
|
@ -64,10 +64,7 @@ namespace AIParkingApplication
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
//TODO: check size before resizing
|
|
||||||
Cv2.Resize(frame, frame, new OpenCvSharp.Size(1280, 720));
|
|
||||||
FinalPlateResult plateResult;
|
FinalPlateResult plateResult;
|
||||||
|
|
||||||
if (isSupportLongPlate)
|
if (isSupportLongPlate)
|
||||||
{
|
{
|
||||||
plateResult = await DetectPlateAndDoOcrEngineAsync(PlateType.Long, frame);
|
plateResult = await DetectPlateAndDoOcrEngineAsync(PlateType.Long, frame);
|
||||||
|
@ -87,7 +84,11 @@ namespace AIParkingApplication
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
Console.WriteLine($"{Util.GetCurrentMethodName()}\texMessage: {ex.Message}");
|
Console.WriteLine($"{Util.GetCurrentMethodName()}\texMessage: {ex.Message}");
|
||||||
return new FinalPlateResult();
|
return new FinalPlateResult
|
||||||
|
{
|
||||||
|
PlateString = string.Empty,
|
||||||
|
PlateImage = frame.ToBitmap()
|
||||||
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user