-
Notifications
You must be signed in to change notification settings - Fork 224
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
Docs update suggestion: building from sources under linux gives error No OCR is available #698
Comments
@arnwas I'm not a Linux expert at all, but my understanding of using apt-get is that it will install the tesseract program and perhaps some of the program-related language files. Unfortunately this has nothing to do with Audiveris needs.
I know this is a bit confusing to say the least. |
Hi, sorry for confusion, but this was not my point, I had all things, but I was confused that the library itself was not found, and this changed by setting the path for the language files (which are installed by apt-get when selecting the appropriate packages, btw.), not the library. Yours, Arno |
Okay, it is even more confusing. The handbook says, that the tesseract library is provided for while building. |
It fails for not being able to initialize the Tesseract library with the provided arguments (typically the desired legacy mode and the desired languages). The tesseract library is certainly present (thanks to Gradle build). For the time being, setting the TESSDATA_PREFIX variable is the safest policy. Please read this line aloud several times! :-) |
well, error messages telling the problem correctly would certainly help :-) |
Indeed! For Audiveris, Tesseract is an external library. /**
* Instances are now mostly thread-safe and totally independent,
* but some global parameters remain. Basically it is safe to use multiple
* TessBaseAPIs in different threads in parallel, UNLESS:
* you use SetVariable on some of the Params in classify and textord.
* If you do, then the effect will be to change it for all your instances.
*
* Start tesseract. Returns zero on success and -1 on failure.
* NOTE that the only members that may be called before Init are those
* listed above here in the class definition.
*
* The datapath must be the name of the tessdata directory.
* The language is (usually) an ISO 639-3 string or nullptr will default to
* eng. It is entirely safe (and eventually will be efficient too) to call
* Init multiple times on the same instance to change language, or just
* to reset the classifier.
* The language may be a string of the form [~]<lang>[+[~]<lang>]* indicating
* that multiple languages are to be loaded. Eg hin+eng will load Hindi and
* English. Languages may specify internally that they want to be loaded
* with one or more other languages, so the ~ sign is available to override
* that. Eg if hin were set to load eng by default, then hin+~eng would force
* loading only hin. The number of loaded languages is limited only by
* memory, with the caveat that loading additional languages will impact
* both speed and accuracy, as there is more work to do to decide on the
* applicable language, and there is more chance of hallucinating incorrect
* words.
* WARNING: On changing languages, all Tesseract parameters are reset
* back to their default values. (Which may vary between languages.)
* If you have a rare need to set a Variable that controls
* initialization for a second call to Init you should explicitly
* call End() and then use SetVariable before Init. This is only a very
* rare use case, since there are very few uses that require any parameters
* to be set before Init.
*
* If set_only_non_debug_params is true, only params that do not contain
* "debug" in the name will be set.
*/
public native int Init(@Cast("const char*") BytePointer datapath, @Cast("const char*") BytePointer language, @Cast("tesseract::OcrEngineMode") int mode,
@Cast("char**") PointerPointer configs, int configs_size,
@Const StringVector vars_vec,
@Const StringVector vars_values,
@Cast("bool") boolean set_only_non_debug_params);
public native int Init(@Cast("const char*") BytePointer datapath, @Cast("const char*") BytePointer language, @Cast("tesseract::OcrEngineMode") int mode,
@Cast("char**") @ByPtrPtr BytePointer configs, int configs_size,
@Const StringVector vars_vec,
@Const StringVector vars_values,
@Cast("bool") boolean set_only_non_debug_params);
public native int Init(String datapath, String language, @Cast("tesseract::OcrEngineMode") int mode,
@Cast("char**") @ByPtrPtr ByteBuffer configs, int configs_size,
@Const StringVector vars_vec,
@Const StringVector vars_values,
@Cast("bool") boolean set_only_non_debug_params);
public native int Init(@Cast("const char*") BytePointer datapath, @Cast("const char*") BytePointer language, @Cast("tesseract::OcrEngineMode") int mode,
@Cast("char**") @ByPtrPtr byte[] configs, int configs_size,
@Const StringVector vars_vec,
@Const StringVector vars_values,
@Cast("bool") boolean set_only_non_debug_params);
public native int Init(String datapath, String language, @Cast("tesseract::OcrEngineMode") int mode,
@Cast("char**") @ByPtrPtr BytePointer configs, int configs_size,
@Const StringVector vars_vec,
@Const StringVector vars_values,
@Cast("bool") boolean set_only_non_debug_params);
public native int Init(@Cast("const char*") BytePointer datapath, @Cast("const char*") BytePointer language, @Cast("tesseract::OcrEngineMode") int mode,
@Cast("char**") @ByPtrPtr ByteBuffer configs, int configs_size,
@Const StringVector vars_vec,
@Const StringVector vars_values,
@Cast("bool") boolean set_only_non_debug_params);
public native int Init(String datapath, String language, @Cast("tesseract::OcrEngineMode") int mode,
@Cast("char**") @ByPtrPtr byte[] configs, int configs_size,
@Const StringVector vars_vec,
@Const StringVector vars_values,
@Cast("bool") boolean set_only_non_debug_params);
public native int Init(@Cast("const char*") BytePointer datapath, @Cast("const char*") BytePointer language, @Cast("tesseract::OcrEngineMode") int oem);
public native int Init(String datapath, String language, @Cast("tesseract::OcrEngineMode") int oem);
public native int Init(@Cast("const char*") BytePointer datapath, @Cast("const char*") BytePointer language);
public native int Init(String datapath, String language); So, everything is in this line:
Audiveris detected a non-zero returned value. That'all it can say. |
@arnwas, what about just using the flatpak package? |
Hi, just about to give audiveris a try, and for various reasons i am about to build it from sources under linux.
I followed the docs and it says, that "Tesseract libraries are automatically pulled as Gradle dependencies", i need just to provide the language files, which are installed via apt-get. As is tesseract itself, though docs say, audiveris would use its own.
./gradle build does not give any error or hint of a problem.
./gradle run gives "No OCR is available".
Only later i found out that TESSDATA_PREFIX being set manually also makes the OCR itself being found.
Maybe your docs could contain a hint to that?
Cheers, Arno
The text was updated successfully, but these errors were encountered: