SRL Archive - FAQ

OCR Help


`Divine

2010-12-10 15:56:12

Hello, I'm looking to use basic OCR.

So far I've created the following font set of 2 and 5 for test purposes in a folder (Beta) under the font directory.

The following are my font set. and 2.bmp and 5.bmp respectively.

I've written the following test code

program Test;

var
Line : String;

begin
ActivateClient;
LoadFont('Beta',false);
Line := GetTextAtEx(497,169, 535, 188, 0, 10, 0, 45567, 80, 'Beta');
WriteLn(Line);
freefont('Beta');
end.

I'm looking to return the text 25 from 25,000,000 in the below image. The defined rectangle is roughly around the 25 with a generous amount of space around it.


It compiles fine but it either gives no output or


I'm not really sure what I'm doing wrong. The font set looks correct and the coords, colors, parameters etc should be correct. Thanks for any help.

noidea

2010-12-10 15:56:56

you need to make font characters.

Gu3st...

2010-12-10 16:33:29

You have to name the characters (inside the folder) after the ASCII table (http://www.cs.utk.edu/~pham/ascii_table.jpg)

so 2 would be 50 and 5 would be 53 (50.bmp and 53.bmp)

`Divine

2010-12-10 16:42:24

Geez that was careless lol. Thanks alot.

Err now I get


Instead of just 25

also sometimes it would read numbers incorrectly. i.e I have the number 1,500,000. It should return just 5 but it returns 25555555. Would this be remedied if I completed the font set? I choose to do only 2 and 5 because of test purposes.

Gu3st...

2010-12-10 16:48:38

Try adding the , and 0 too;

Shuttleu

2010-12-10 16:55:09

if you were to have a complete font set then it would probably work perfectly fine
follow the tutorial in my sig to find out how to make fonts and what to name them

~shut

EDIT: ah, you posted on there, so you already know about it