Added all the files needed for calibration and detection but it now needs to be wired up
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Drawing;
|
||||
|
||||
namespace Test_Merge
|
||||
{
|
||||
public class DriverPositionWindow:Window
|
||||
{
|
||||
public DriverPositionWindow(Bitmap image, Rectangle bounds) : base(image, bounds)
|
||||
{
|
||||
Name = "Position";
|
||||
}
|
||||
/// <summary>
|
||||
/// Decodes the position number using Tesseract OCR
|
||||
/// </summary>
|
||||
/// <returns>The position of the pilot in int</returns>
|
||||
public override async Task<object> DecodePng()
|
||||
{
|
||||
string ocrResult = await GetStringFromPng(WindowImage, Engine, "0123456789");
|
||||
|
||||
int position;
|
||||
try
|
||||
{
|
||||
position = Convert.ToInt32(ocrResult);
|
||||
}
|
||||
catch
|
||||
{
|
||||
position = -1;
|
||||
}
|
||||
return position;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user