askf
2014-09-10 23:22:46
Hey!
So I have been messing around with OCR/Tesseract.
Could someone please explain to me why it won't work for red text? Furthermore, is there a way to overcome this?
The code below works extremely well for all other colours!
Thanks,
`askf
EDIT:
Intention of the this function is to store all the options into a TSA and then choose an option based on the index. (For example if the text contains "wishes to trade", then choose that option.)
Here is a screenshot of the chatbox:
[ATTACH=CONFIG]24002[/ATTACH]
Here is the output I get (notice the red text is gibberish):
So I have been messing around with OCR/Tesseract.
Could someone please explain to me why it won't work for red text? Furthermore, is there a way to overcome this?
The code below works extremely well for all other colours!
writeln(tesseractGetText(testBox, FILTER_SMALL_CHARS)); Thanks,
`askf
EDIT:
Intention of the this function is to store all the options into a TSA and then choose an option based on the index. (For example if the text contains "wishes to trade", then choose that option.)
function getChat(): TStringArray;
var
bA: TBoxArray;
i: Integer;
sA: TStringArray;
begin
bA := [intToBox(0, 532, 558, 545), intToBox(0, 546, 558, 560), intToBox(0, 560, 558, 575)];
sA := ['', '', ''];
for i := 0 to 2 do
begin
//Debug
smartImage.drawBox(bA[i], false, clLime);
//Store into TSA
sA[i] := tesseractGetText(bA[i], FILTER_SMALL_CHARS);
end;
Result := sA
end; Here is a screenshot of the chatbox:
[ATTACH=CONFIG]24002[/ATTACH]
Here is the output I get (notice the red text is gibberish):
You have correctly entered your PIN.
Sending trade offer...
jrhér p\3‘,‘5' j€:, "£1 W3 15‘
Successfully executed.
