Added laptime recognition (not precise enough yet tho)

This commit is contained in:
2023-04-04 17:24:55 +02:00
parent bdb04bdf96
commit d9a0a5e766
4 changed files with 85 additions and 44 deletions
-34
View File
@@ -15,40 +15,6 @@ namespace OCR_Decode
{
Name = "Name";
}
/*
public override object DecodePng()
{
string result = "";
Bitmap rawData = WindowImage;
rawData = Window.ConvertToBlackAndWhite(rawData,150);
TesseractEngine engine = new TesseractEngine(TESS_DATA_FOLDER.FullName, "eng", EngineMode.Default);
var tessImage = Pix.LoadFromMemory(ImageToByte(WindowImage));
Page page = engine.Process(tessImage);
Graphics g = Graphics.FromImage(rawData);
// Get the iterator for the page layout
using (var iter = page.GetIterator())
{
// Loop over the elements of the page layout
iter.Begin();
do
{
Rect boundingBox;
// Get the bounding box for the current element
if (iter.TryGetBoundingBox(PageIteratorLevel.Word, out boundingBox))
{
g.DrawRectangle(Pens.Red, new Rectangle(boundingBox.X1, boundingBox.Y1, boundingBox.Width, boundingBox.Height));
}
// Get the text for the current element
result += iter.GetText(PageIteratorLevel.Word);
} while (iter.Next(PageIteratorLevel.Word));
}
rawData.Save(Reader.DEBUG_DUMP_FOLDER + result + "_Before" + ".png");
return result;
}
*/
public override object DecodePng(List<string> DriverList)
{
string result = "";