-
Notifications
You must be signed in to change notification settings - Fork 31
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error opening data file /usr/share/tessdata/.traineddata #6
Comments
I have this same issue. I just read the source for this crate on crates.io but I couldn't find where it is set. |
Hello, There is an environment variable There is also a This crate is a wrapper around Tesseract's c api. Do any of the functions there look like they might help? If so, I'll expose them. |
Thanks for the reply, I'll mess with your suggestions and see what happens. |
To recognise text, you first neeed to call initialize because it is the only way of getting a TesseractInitialized object. This avoids a situation where tesseract quits your program because you forgot to initialize it. Possibly the extra options will help with #6. I do plan on supporting all the options of https://fossies.org/dox/tesseract-4.1.1/classtesseract_1_1TessBaseAPI.html#a96899e8e5358d96752ab1cfc3bc09f3e in time. #16
This was done by initializing on the call to new. This was suggested by the pull request #20 by @hdevalence. This may address #6, as we now expose datapath.
* Move unsafe handling code to plumbing module This has given me the opportunity to review the safety of the unsafe code - and it was found lacking. But it's fixed in the plumbing module. #16 I've tried to not put naming opinions within the plumbing module. That is, things within it are named to match the c or c++ libraries of leptonica and tesseract as much as possible. This addresses #17 at least within the plumbing module. * Remove wrinkle directory I'm not sure what purpose it served * Use Result type in top level module This gives users a chance to deal with errors, rather than having panics. * Use the builder pattern in the Tesseract struct As pointed out in #18 it makes the API nicer. And I'm breaking the API anyway, in order to return result types, so I may as well make this further change. * Make it impossible not to initialize tesseract This was done by initializing on the call to new. This was suggested by the pull request #20 by @hdevalence. This may address #6, as we now expose datapath.
The environment variable // build.rs in top level folder (not in src folder)
fn main() {
// load testdata file from same folder as executable
println!("cargo:rustc-env=TESSDATA_PREFIX=");
} |
Following example code:
The problem is that I do have tesseract training data installed, but it is named
{language_name}.traineddata
(for example:deu.traineddata
), so this wrapper can't find it. When I manually runtesseract sample.jpg test.txt -l deu
, it works seamlessly.How can I manually change the file naming scheme?
The text was updated successfully, but these errors were encountered: