tags:

views:

497

answers:

1

I am about building an C#-application in which I am trying to read text from an gif-image (OCR) - I am using MODI and the images are a bit like a lotto coupon (random numbers in rows and columns). I now got the following code which read all numbers except single numbers (1, 2, 3...)

MODI.Document objModi = new MODI.Document();
objModi.Create("C:\\image.gif");
objModi.OCR(MODI.MiLANGUAGES.miLANG_DANISH, true, true);
MODI.Image image = (MODI.Image)objModi.Images[0];
MODI.Layout layout = image.Layout;

I cannot change the content of the image but can I do anything with the above code so it can read the single numbers?

A: 

string reult=""; foreach(MODI.Word worditems in imag.Layout.Words) { result+=worditems.Text+','; }

Bill Lee
Sorry for the late response. I know how to loop trough the words MODI finds, the problem is that it misses e.g. 3, 5 and 8 but reads 38, 72 and 69. For now I have solved this by editing the picture in-memory (adding a letter before and after the single numbers) before MODI reads the content and then removing the letters when I work with the result. If a better solution exists please let me know.
keysersoze