Failed loading language 'eng'

180 views
Skip to first unread message

sanogo sy

unread,
Nov 25, 2023, 5:07:12 AM11/25/23
to tesseract-ocr
Hi every one. I got an error with tesseract. When I try to use it in my app, I got an error like "Failed loading language eng".
I installed tesseract 5 with leptonica 1.79

To solve the problem I tried  that command :
export TESSDATA_PREFIX=/usr/share/tesseract-ocr/4/tessdata/
I cloned from git repo tesseract tessdata:
Then I moved files in /usr/share/tesseract-ocr/4/tessdat/ folder.
But it still not working.

I really need help, please. I've been working for 3 days.

Zdenko Podobny

unread,
Nov 25, 2023, 5:31:49 AM11/25/23
to tesser...@googlegroups.com
Does tesseract (executable) has the same problem?
If yes, that check the content of /usr/share/tesseract-ocr/4/tessdata/
If not follow code of tesseract executable.


Zdenko


so 25. 11. 2023 o 11:07 'sanogo sy' via tesseract-ocr <tesser...@googlegroups.com> napísal(a):
--
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 tesseract-oc...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/tesseract-ocr/3ac7cbbe-6481-46da-b14f-7c933f499414n%40googlegroups.com.

sanogo sy

unread,
Nov 25, 2023, 7:07:51 AM11/25/23
to tesseract-ocr
I forgot to mentione that I use Centos 7.
I tried that command : tesseract img.jpg out

As result I got a message like:

Estimating resolution as 181
Error in boxClipToRectangle: box outside rectangle
Error in pixScanForForeground: invalide box

Zdenko Podobny

unread,
Nov 25, 2023, 8:09:33 AM11/25/23
to tesser...@googlegroups.com
And the result is?


Zdenko


so 25. 11. 2023 o 13:07 'sanogo sy' via tesseract-ocr <tesser...@googlegroups.com> napísal(a):

sanogo sy

unread,
Nov 25, 2023, 8:25:39 AM11/25/23
to tesseract-ocr
If I well understood, you mean by tesseract (executable) to run tesseract command on purpose to check how it works.
I just run command: tesseract  path_of_my_image.jpg  output.txt
My output file is empty. It seems that it doesn't work because I got in my command line message :

Estimating resolution as 181
Error in boxClipToRectangle: box outside rectangle
Error in pixScanForForeground: invalide box

sanogo sy

unread,
Nov 25, 2023, 9:31:47 AM11/25/23
to tesseract-ocr
But in my app that running in server wildfly 24, I got error say: Failed loading language 'eng'.
In my log file I got:

Failed loading language 'eng'
Cube ERROR (CubeRecoContext::Load): unable to read cube language model params from /tmp/tess4j/tessdata/fra.cube.lm
Cube ERROR (CubeRecoContext::Create): unable to init CubeRecoContext object
init_cube_objects(false, &tessdata_manager):Error:Assert failed:in file tessedit.cpp, line 210
#
# A fatal error has been detected by the Java Runtime Environment:
#
#  SIGSEGV (0xb) at pc=0x00007fb7e88ac249, pid=56208, tid=0x00007fb7ed342700
#
# JRE version: OpenJDK Runtime Environment (8.0_131-b12) (build 1.8.0_131-b12)
# Java VM: OpenJDK 64-Bit Server VM (25.131-b12 mixed mode linux-amd64 compressed oops)
# Problematic frame:
# C  [libtesseract.so+0x239249]  ERRCODE::error(char const*, TessErrorLogCode, char const*, ...) const+0x129

Zdenko Podobny

unread,
Nov 25, 2023, 11:30:46 AM11/25/23
to tesser...@googlegroups.com
you used an old unsupported version of your tools (not sure if the problem is in the used/installed wrapper or Tesseract library...)  - the cube engine was removed from Tesseract several years ago...


Zdenko


so 25. 11. 2023 o 15:31 'sanogo sy' via tesseract-ocr <tesser...@googlegroups.com> napísal(a):

sanogo sy

unread,
Nov 25, 2023, 11:48:34 AM11/25/23
to tesseract-ocr
Too stupid, my bad! 
Could someone give me some advice to install required version. 
I use tess4j 5.4.0.jar in my application. In local on windows OS, I tried another version of tess4j but it didn't work, so I kept tess4j 5.4.0.
Now I had to make it run in linux Centos 7.

I tried many documentation like:

I also tried like that:

wget http://www.leptonica.org/source/leptonica-1.79.0.tar.gz
wget https://github.com/tesseract-ocr/tesseract/archive/5.3.0.tar.gz

Configure, compile, install libs:

tar xzvf leptonica-1.79.0.tar.gz      
cd leptonica-1.79.0    
./configure
make
make install

cd ..


tar xzf 5.3.0.tar.gz
cd tesseract-5.3.0
./autogen.sh
./configure
make
sudo make install
sudo ldconfig


I tried also that way:

wget http://www.leptonica.org/source/leptonica-1.69.tar.gz
wget https://tesseract-ocr.googlecode.com/files/tesseract-ocr-3.02.02.tar.gz

tar xzvf leptonica-1.69.tar.gz      
cd leptonica-1.69      
./configure
make
sudo make install

tar xzf tesseract-ocr-3.02.02.tar.gz
cd tesseract-3.01
./autogen.sh
./configure
make
sudo make install
sudo ldconfig

wget http://tesseract-ocr.googlecode.com/files/tesseract-ocr-3.02.eng.tar.gz      
tar xzf tesseract-ocr-3.02.eng.tar.gz      
sudo cp tesseract-ocr/tessdata/* /usr/local/share/tessdata

But I get error like could not initialized tess4j error. 
So, I need help to install right version for making work in linux OS centos 7, with java 8 and tess4j 5.4.0. My application is running on a wildfly server version 24.

Thank's in advance!

Zdenko Podobny

unread,
Nov 25, 2023, 11:59:47 AM11/25/23
to tesser...@googlegroups.com
tesseract 3.x is unsupported.

I am not Java developer, but according https://github.com/nguyenq/tess4j/releases tess4j-5.8.0 should support Tesseract 5.3.2, so I would start from that. 
If there is still a problem have a look at their wiki (https://github.com/nguyenq/tess4j/wiki) and issue tracker.


Zdenko


so 25. 11. 2023 o 17:48 'sanogo sy' via tesseract-ocr <tesser...@googlegroups.com> napísal(a):
Reply all
Reply to author
Forward
0 new messages