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);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-wordsThe 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 tesser...@googlegroups.com
To unsubscribe from this group, send email to
tesseract-oc...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/tesseract-ocr?hl=en
i tried running the program in the console and did get the following error message:Could not open file, C:\tesseract-3.02\tessdata/deu.user-words
The file is definitely there. Maybe it has something to do with the different slashes?Is the user-words file supposed to be a dawg file or a simple text file with one word per line?I also tried settings the datapath of the Init function to "C:/tesseract-3.02/" to get the right slashes but i got the same result.Regarding you option to set the config file after the init call, i read here http://code.google.com/p/tesseract-ocr/wiki/ControlParamsthat you can only set the user_words_suffix param in the init call. Is this correct?
i tried running the program in the console and did get the following error message:Could not open file, C:\tesseract-3.02\tessdata/deu.user-wordsThe file is definitely there. Maybe it has something to do with the different slashes?
Is the user-words file supposed to be a dawg file or a simple text file with one word per line?
I also tried settings the datapath of the Init function to "C:/tesseract-3.02/" to get the right slashes but i got the same result.
Regarding you option to set the config file after the init call, i read here http://code.google.com/p/tesseract-ocr/wiki/ControlParamsthat you can only set the user_words_suffix param in the init call. Is this correct?
Am Freitag, 30. November 2012 09:56:22 UTC+1 schrieb zdenop:
I tried your code and it did not work. I get the error message "Could not open file, C:\tesseract-3.02\tessdata/deu.user-words".I then tried to open the file with fopen. It did not work for the pathC:\tesseract-3.02\tessdata/deu.user-wordsBut it worked for the following paths:C:\\tesseract-3.02\\tessdata\\deu.user-wordsC:/tesseract-3.02/tessdata/deu.user-words
C:\\tesseract-3.02\\tessdata/deu.user-wordsecho %TESSDATA_PREFIX% yieldsC:\tesseract-3.02\I changed this setting manually to C:/tesseract-3.02/ and now i get the error message "Could not open file, C:/tesseract-3.02/tessdata/deu.user-words".I even removed the setting completely so it uses the path supplied with the Init call. Still no luck, same error.Anymore suggestions?
I tried your code and it did not work. I get the error message "Could not open file, C:\tesseract-3.02\tessdata/deu.user-words".I then tried to open the file with fopen. It did not work for the pathC:\tesseract-3.02\tessdata/deu.user-wordsBut it worked for the following paths:
C:\\tesseract-3.02\\tessdata\\deu.user-words
C:/tesseract-3.02/tessdata/deu.user-wordsC:\\tesseract-3.02\\tessdata/deu.user-wordsecho %TESSDATA_PREFIX% yieldsC:\tesseract-3.02\I changed this setting manually to C:/tesseract-3.02/ and now i get the error message "Could not open file, C:/tesseract-3.02/tessdata/deu.user-words".I even removed the setting completely so it uses the path supplied with the Init call. Still no luck, same error.Anymore suggestions?
Am Freitag, 30. November 2012 20:08:19 UTC+1 schrieb zdenop:
To unsubscribe from this group and stop receiving emails from it, send an email to tesseract-oc...@googlegroups.com.
To post to this group, send email to tesser...@googlegroups.com.
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.