Comments (8)
Hi there!
Which version of tess4j and centos are you using?
Am 20.01.2016 um 19:53 schrieb lukiant-dev [email protected]:
Hello!
Unfortunately I am not able to run tesseract through tess4j on Linux (CentOS).
I think that tesseract is being loaded correctly with JNA, but for some reason he can't find liblept.so.
Is it possible to somehow tell tesseract which is loaded through JNA where he should look for liblept.so?
Or maybe it would be possible to compile tesseract in such way that leptonica shared library wouldn't be needed at execution time?NOTE1: I can't set LD_LIBRARY_PATH environment variable. It solves the problem but cannot be done on my system.
NOTE2: Leptonica is not installed on local machine.
NOTE3: I have compiled Tesseract from the source (tried github master branch and 3.02 from sourceforge).—
Reply to this email directly or view it on GitHub.
from tess4j.
tess4j src from master branch
CentOS 6.7 x64
from tess4j.
Hi, I am having the same issue.
Using Tess4j-2.0.1.jar which comes with Tesseract 3.03 and Leptonica 1.7.
It works fine on Tomcat under Windows but Linux won't work.
I have compiled Tesseract and Leptonica on my Linux Servers and taken the libtesseract.so file and it recognizes it. So far so good. However the liblept.so.4 is not recognized anywhere.
I have tried the following:
- gave full permission (chmod 777 liblept.so.4)
- placed the liblept.so.4 under user/local
- placed the liblept.so.4 under user/local/share
- added the liplept.so.4 to the tess4j JAR (together with libtesseract.so) under /linux-x86-64
- placed the liblept.so.4 under TOMCAT_HOME/lib and set the path in the wrapper of tomcat.config
(wrapper.java.additional.4=-Djna.library.path=%TOMCAT_HOME%/lib) - tried to work with LD_LIBRARY_PATH
- Placed it under WEB-INF/classes
Always the same error:
UnsatisfiedLinkError: liblept.so.4: cannot open shared object file: No such file or directory
from tess4j.
Had the same problem, solved it for me by loading liblept.so in the static-block in LoadLibs. So leptonica.so is loaded before tesseract is loaded by calling getTessAPIInstance.
from tess4j.
Very smart approach. I will try it. Did you use the static function?
System.loadLibrary("liblept");
from tess4j.
Yes, I packed liblept.so.4 with tess4j, extracted it to the tempdir like tess4j does with tesseract and called
System.load(targetTempFolder + "/liblept.so.4");
from tess4j.
People, mhinters rules! Thanks. It worked.
Please note:
- Using System.loadLibrary("liblept") did not work although the file was present in the java.library.path (Tesseract tries to load from a different place)
- We have also tried renaming "liblept.so.4" to "liblept.so" which did not work
The only thing was to give the real full path of "liblept.so.4" to the static function and calling it before Tesseract does, like this:
System.load("/opt/tomcat7/project/liblept.so.4") ;
mhinters, thanks again.
PS: Make sure the file has the right permissions
from tess4j.
You can also create a symlink.
from tess4j.
Related Issues (20)
- error: Error looking up function 'TessBaseAPIInit5': dlsym(0x7fe46b6d06a0, TessBaseAPIInit5): symbol not found HOT 1
- Tesseract.doOCR() failing on Windows from cmd line for Java 17, works in eclipse HOT 2
- JVM crash on M1 / MacOS with tess4j HOT 4
- Can tess4j be used to convert a pdf with images as content to a searchable pd HOT 2
- doOCR() vs. createDocuments() / createDocumentsWithResults() HOT 4
- meanTextConfidence is 0 for doc with empty last page but non-empty others in createDocumentsWithResults method HOT 2
- java.lang.UnsatisfiedLinkError HOT 4
- TIFF to PDF (text_only==false) recognition (or conversion) failed. HOT 3
- Tess4j not work on Mac M1 even with new JNA5.12.1 HOT 2
- linux
- Memory leak when using tess4j for parallel processing in docker environment HOT 1
- Tess4j does not correctly handle images with alpha channel HOT 8
- java.lang.UnsatisfiedLinkError : Error Looking Up function TessBaseAPICreate : The specified procedure can not be found. Tess4j 5.8.0 HOT 5
- LoadLibs copies files into wrong directory when a custom value for jna.library.path is set HOT 5
- Unable to set non-English datapath in Tess4J HOT 2
- Remove hardcoded support for TIFF from `jai-imageio` HOT 1
- Error: tesseract::Tesseract::recog_all_words
- Tesseract1.doOCR method doesn't take into account the stride of the image HOT 6
- TessBaseAPIInit1 calls fail with "Invalid memory access" on Windows 10 with included Tesseract Windows 32-bit DLL HOT 6
- tesseract-ocr and tess result are different HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tess4j.