Added the framework for the recognition and partial implement of name recognition

This commit is contained in:
2023-04-04 13:45:10 +02:00
parent f3bb302ac9
commit beec16f9d6
13 changed files with 79 additions and 26 deletions
+5 -2
View File
@@ -10,6 +10,7 @@ namespace OCR_Decode
{
internal class DriverNameWindow : Window
{
public static Random rnd = new Random();
public DriverNameWindow(Bitmap image, Rectangle bounds) : base(image, bounds)
{
Name = "Name";
@@ -18,7 +19,8 @@ namespace OCR_Decode
{
string result = "";
Image rawData = WindowImage;
Image rawData = Image;
rawData.Save(Reader.DEBUG_DUMP_FOLDER + Name + "_Before" + ".png");
TesseractEngine engine = new TesseractEngine(TESS_DATA_FOLDER.FullName, "eng", EngineMode.Default);
var tessImage = Pix.LoadFromMemory(ImageToByte(WindowImage));
@@ -35,7 +37,8 @@ namespace OCR_Decode
result += iter.GetText(PageIteratorLevel.Word);
} while (iter.Next(PageIteratorLevel.Word));
}
//REMOVE !!!
//result += rnd.Next(0,100);
return result;
}
}