Problem with tessnet init

I need to make an OCR image .jpg. I searched a lot and finally got "tessnet2". The code looks pretty simple, but I have a problem with an example: l

When I try to run ocr, my application exits and returns nothing. Debugging is as follows:

ocr.Init("C:\\Desarrollo\\Prueba\\ConsoleApplication1\\tessdata", "spa", false); 

The first parameter is its path with "tessdata", right? The second way is the lenguage, which I want to use ...

In tessdata, I have 8 files you need.

What am I doing wrong?

I use C # and visual studio 2010. When I try to compile it, I get the .net framework error message (I used 4.0 and it needs 2.0, I am reducing it and now compiling, but I have a problem).

Thanks!

+4
source share
3 answers

I had the same problem, but I found out that I used the language file for Tesseract 3.0 (not 2.0). When I put the files intended for 2.0, it worked.

Since you seem to be using the 2.0 SDK, download the language files for 2.0 (http://code.google.com/p/tesseract-ocr/downloads/list). The files at the top are 3.0. Scroll to the bottom of the list.

+9
source

I also ran into the same problem when the tessnet2.Tesseract ocr = new tessnet2.Tesseract () method; ocr.Init (@ "E: \ QAliber \ qaliber-code-133 \ QAliber Engine \ OCR \" + @ "tessdata \", "eng", false);

Failed to execute Init () method. This did not cause me any error, but the execution just came out with exit code 1. To fix this problem, I downloaded the Russian language files from the correct version (2.0 for me) and deleted all the keys in the registry, where I found the keyword "tesseract". Then I rebooted the machine. The program runs successfully. The only problem now is that I am not getting the correct result (height is negative). I will look at that. But I am happy that at least my program is running.

+1
source

My code works fine on other machines, but not on the same machine. I am using VS2010 and framework 3.5. Management automatically exits from the code below:

ocr.Init (@ "D: \ path", "eng", false);

Here ocr is an instance of Tesseract ().

0
source

All Articles