Lap times are fucked once again
This commit is contained in:
@@ -59,10 +59,11 @@ namespace OCR_Decode
|
||||
}
|
||||
public static int GetTimeFromPng(Bitmap wImage)
|
||||
{
|
||||
//returns milliseconds
|
||||
string rawResult = "";
|
||||
int result = 0;
|
||||
|
||||
Engine.SetVariable("tessedit_char_whitelist", "0123456789:.");
|
||||
|
||||
Bitmap enhancedImage = new OcrImage(wImage).Enhance();
|
||||
|
||||
var tessImage = Pix.LoadFromMemory(ImageToByte(enhancedImage));
|
||||
@@ -94,10 +95,10 @@ namespace OCR_Decode
|
||||
|
||||
//Removes all non digit chars except for the important ones
|
||||
//We will need to change this when trying to see the Leader and Lap texts
|
||||
string cleanedResult = Regex.Replace(rawResult, "[^0-9.:]", "");
|
||||
//string cleanedResult = Regex.Replace(rawResult, "[^0-9.:]", "");
|
||||
|
||||
//Splits into minuts seconds miliseconds
|
||||
rawNumbers = cleanedResult.Split('.', ':').ToList<string>();
|
||||
rawNumbers = rawResult.Split('.', ':').ToList<string>();
|
||||
//removes any empty cells (tho this usually sign of a really bad OCR implementation tbh will have to be fixed higher in the chian)
|
||||
rawNumbers.RemoveAll(x => ((string)x) == "");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user