Hi,
I am trying to do winth win8, s 2012, no environment variable is set.
api = new tesseract::TessBaseAPI();
int i =
api->Init("C:\\tesseract-ocr-3.02\\tessdata\\","hin",tesseract::OEM_DEFAULT);
if(i)
{
MessageBox(L"Could not initialize tesseract.", L"Illusssion",MB_OK);
exit(1);
}
Every time I compile it comes with -1 result
On Friday, 30 November 2012 14:26:22 UTC+5:30, zdenop wrote:
>
> I guess there is problem to find deu.traineddata.
>
> I would suggest to run your program in console, so you can see possible
> error message (something like "Error opening data file C:\Program
> Files\Tesseract-OCR\tessdata/deu.traineddata").
>
> Another option is to init tesseract and set variables in more steps to
> check for errors. Something like this:
>
> const char* configs = "myconfig";
>
> TessBaseAPI *tess = new TessBaseAPI();
>
> if (tess->Init(NULL, "deu", OEM_DEFAULT)) {
>
> fprintf(stderr, "Could not initialize tesseract.\n");
>
> exit(1);
>
> }
>
> // write messages to tesseract.log instead of stderr...
>
> if (!tess->SetVariable("debug_file", "tesseract.log")) {
>
> fprintf(stderr, "Could not set variable 'debug_file'.\n");
>
> }
>
> tess->ReadConfigFile(configs);
>
>
>
> --
> Zdenko
>
> On Thu, Nov 29, 2012 at 5:15 PM, Matthias Hillert <[email protected]
> <javascript:>> wrote:
>
>> Hi,
>>
>> I am trying to include a custom word directory with a custom
>> configuration file and the user_words_suffix property.
>> My code looks like this:
>>
>> TessBaseAPI tess;
>> char *configs[]={"myconfig"};
>> int configs_size = 1;
>> tess.Init(NULL, "deu", OEM_DEFAULT, configs, configs_size, NULL, NULL,
>> false );
>>
>> My config file looks like this:
>>
>> user_words_suffix user-words
>>
>> The Problem is that my program exits with code 1 after the init call.
>> I tried both a simple deu.user-words file with one word in every line and
>> also converted the file into a dawg file. Nothing worked.
>> If I remove the user_words_suffix line in the config file everything
>> works.
>>
>> I am using Tesseract 3.02, Windows 8 and Visual Studio 2012.
>>
>> I would really appreciate some help.
>>
>>
>>
>>
>> --
>> You received this message because you are subscribed to the Google
>> Groups "tesseract-ocr" group.
>> To post to this group, send email to [email protected]
>> <javascript:>
>> To unsubscribe from this group, send email to
>> [email protected] <javascript:>
>> For more options, visit this group at
>> http://groups.google.com/group/tesseract-ocr?hl=en
>>
>
>
--
You received this message because you are subscribed to the Google Groups
"tesseract-ocr" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/tesseract-ocr.
To view this discussion on the web visit
https://groups.google.com/d/msgid/tesseract-ocr/7b23d0a8-7cb2-4139-9877-9c57bf7c000a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.