AmitGorvadiya / tesseract-ocr

Automatically exported from code.google.com/p/tesseract-ocr
Other
0 stars 0 forks source link

Error while running tesseract #340

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Installed libleptonica,libleptonica-dev, libtiff4 and libtiff4-dev from the 
repositary in Ubuntu 10.04
2.Compiled tesseract 3.00 from source code and installed
3. Ran teserract ./trial.tiff ./trial.txt

What is the expected output? What do you see instead?
Expected tesseract to produce the OCR result.  Got the following errors
Tesseract Open Source OCR Engine with Leptonica
Error in findTiffCompression: function not present
Error in tiffGetCount: function not present
Error reading file ./trial.tiff!

What version of the product are you using? On what operating system?
tesseract 3.00 on Ubuntu Linux 10.04 on i686

Please provide any additional information below.

Original issue reported on code.google.com by sreejith...@gmail.com on 29 Jul 2010 at 9:26

GoogleCodeExporter commented 9 years ago
run 'which tesseract' - to find out location of your tesseract (you will see 
something like '/usr/local/bin/tesseract').

Than run & post output from: 'ldd your_location_of_tesseract (e.g. 'ldd 
/usr/local/bin/tesseract')

Original comment by zdpos...@gmail.com on 19 Oct 2010 at 7:41

GoogleCodeExporter commented 9 years ago
I have the same exact problem. I did 'ldd your_location_of_tesseract' and 
following is the output :
        linux-vdso.so.1 =>  (0x00007fff674f3000)
        libtesseract_api.so.3 => /usr/local/lib/libtesseract_api.so.3 (0x00007fd86a5d4000)
        libtesseract_main.so.3 => /usr/local/lib/libtesseract_main.so.3 (0x00007fd86a237000)
        libtesseract_textord.so.3 => /usr/local/lib/libtesseract_textord.so.3 (0x00007fd869e53000)
        libtesseract_wordrec.so.3 => /usr/local/lib/libtesseract_wordrec.so.3 (0x00007fd869c2e000)
        libtesseract_classify.so.3 => /usr/local/lib/libtesseract_classify.so.3 (0x00007fd869919000)
        libtesseract_dict.so.3 => /usr/local/lib/libtesseract_dict.so.3 (0x00007fd8696f1000)
        libtesseract_ccstruct.so.3 => /usr/local/lib/libtesseract_ccstruct.so.3 (0x00007fd8694a1000)
        libtesseract_image.so.3 => /usr/local/lib/libtesseract_image.so.3 (0x00007fd869183000)
        libtesseract_cutil.so.3 => /usr/local/lib/libtesseract_cutil.so.3 (0x00007fd868f78000)
        libtesseract_viewer.so.3 => /usr/local/lib/libtesseract_viewer.so.3 (0x00007fd868c5c000)
        libtesseract_ccutil.so.3 => /usr/local/lib/libtesseract_ccutil.so.3 (0x00007fd868a32000)
        libtiff.so.3 => /usr/lib64/libtiff.so.3 (0x0000003530000000)
        libpthread.so.0 => /lib64/libpthread.so.0 (0x000000393fa00000)
        libjpeg.so.62 => /usr/lib64/libjpeg.so.62 (0x000000394fe00000)
        libpng12.so.0 => /usr/lib64/libpng12.so.0 (0x0000003943e00000)
        libz.so.1 => /lib64/libz.so.1 (0x0000003940200000)
        libstdc++.so.6 => /usr/lib64/libstdc++.so.6 (0x0000003152c00000)
        libm.so.6 => /lib64/libm.so.6 (0x000000393f600000)
        libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x000000394be00000)
        libc.so.6 => /lib64/libc.so.6 (0x000000393f200000)
        /lib64/ld-linux-x86-64.so.2 (0x000000393ee00000)

Original comment by sourasis...@gmail.com on 26 Oct 2010 at 10:23

GoogleCodeExporter commented 9 years ago
I have just installed tesseract on my apple and I have the same problem.

I have a mac OSX 10.4.11, I have installed tessaract 3 and leptonlib-1.67

the output is using the mac equivalent of the ldd function is:

/usr/local/bin/tesseract:
        /usr/local/lib/libtesseract_api.3.dylib (compatibility version 4.0.0, current version 4.0.0)
        /usr/local/lib/libtesseract_main.3.dylib (compatibility version 4.0.0, current version 4.0.0)
        /usr/local/lib/libtesseract_textord.3.dylib (compatibility version 4.0.0, current version 4.0.0)
        /usr/local/lib/libtesseract_classify.3.dylib (compatibility version 4.0.0, current version 4.0.0)
        /usr/local/lib/libtesseract_dict.3.dylib (compatibility version 4.0.0, current version 4.0.0)
        /usr/local/lib/libtesseract_ccstruct.3.dylib (compatibility version 4.0.0, current version 4.0.0)
        /usr/local/lib/libtesseract_image.3.dylib (compatibility version 4.0.0, current version 4.0.0)
        /usr/local/lib/libtesseract_cutil.3.dylib (compatibility version 4.0.0, current version 4.0.0)
        /usr/local/lib/libtesseract_viewer.3.dylib (compatibility version 4.0.0, current version 4.0.0)
        /usr/local/lib/libtesseract_ccutil.3.dylib (compatibility version 4.0.0, current version 4.0.0)
        /usr/local/lib/libtesseract_wordrec.3.dylib (compatibility version 4.0.0, current version 4.0.0)
        /sw/lib/libpng.3.dylib (compatibility version 3.0.0, current version 3.0.0)
        /usr/local/lib/liblept.0.dylib (compatibility version 1.0.0, current version 1.0.0)
        /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 88.3.11)
        /opt/local/lib/libjpeg.8.dylib (compatibility version 9.0.0, current version 9.2.0)
        /usr/lib/libz.1.dylib (compatibility version 1.0.0, current version 1.2.3)
        /usr/lib/libstdc++.6.dylib (compatibility version 7.0.0, current version 7.4.0)
        /usr/lib/libgcc_s.1.dylib (compatibility version 1.0.0, current version 1.0.0)

Hope you can help me

Original comment by Oduss...@gmail.com on 3 Jan 2011 at 9:30

GoogleCodeExporter commented 9 years ago
Please compile mtifftest program from leptonica progs directory and run it. 
This should be the test if leptonica works corretly.

Please also post image file you try to use.

Original comment by zde...@gmail.com on 4 Jan 2011 at 8:09

GoogleCodeExporter commented 9 years ago
I've just run mtifftest with three different images and I've got always the 
same result:

Error in writeMultipageTiff: function not present
Error in pixaReadMultipageTiff: function not present
Error in pixaDisplayTiledInRows: pixa not defined
Error in pixDisplayWithTitle: pixs not defined
Error in pixaDisplayTiledInRows: pixa not defined
Error in pixDisplayWithTitle: pixs not defined
Error in pixaDisplayTiledInRows: pixa not defined
Error in pixDisplayWithTitle: pixs not defined

Original comment by Oduss...@gmail.com on 4 Jan 2011 at 9:07

GoogleCodeExporter commented 9 years ago
here the images I used:

1)

Original comment by Oduss...@gmail.com on 4 Jan 2011 at 9:08

Attachments:

GoogleCodeExporter commented 9 years ago
2)

Original comment by Oduss...@gmail.com on 4 Jan 2011 at 9:08

Attachments:

GoogleCodeExporter commented 9 years ago
I can ocr your examples without problem (on Windows XP).

Your comment 5 indicate you have problem in leptonica build... Please try to 
rebuild/reinstall leptonica. If it does not help (e.g. mtifftest produce error) 
than post issue in leptonica project.

If you convert tif to png: ocr/tesseract will work without problem?

Original comment by zde...@gmail.com on 4 Jan 2011 at 11:00

GoogleCodeExporter commented 9 years ago
I've rebuilt/reinstalled leptonica, but it doesn't work.

I've also tried to convert my tif to png, but it doesn't work either.

Here you can find the issue I've just posted in leptonica project:

http://code.google.com/p/leptonica/issues/detail?id=48

Original comment by Oduss...@gmail.com on 4 Jan 2011 at 12:42

GoogleCodeExporter commented 9 years ago
the team of leptonica answered me that it is a problem of tesseract with the 
libtiff library.

I have the libtiff installed, but it is libtiff3, not libtiff4 as indicated in 
the tesseract readme file. Can the problem be there?

Any idea about where can I find libtiff4? because macport has only libtiff3

Original comment by Oduss...@gmail.com on 4 Jan 2011 at 11:17

GoogleCodeExporter commented 9 years ago
This is strange answer for me - if example file from leptonica did not work, 
also tesseract (that use leptonica) could not work... Can you please try some 
leptonica example program that use png?

Unfortunately I have not Mac to make my tests... 

Original comment by zde...@gmail.com on 5 Jan 2011 at 10:55

GoogleCodeExporter commented 9 years ago
I tried the program barcode with a .png file, and it worked but with some 
error..

I tried the same file with tesseract, and I got the following error:

Error in pixReadStreamPng: function not present
Error in pixReadStream: png: no pix returned
Error in pixGetInputFormat: pix not defined
Error in pixRead: image not returned
Error in fopenReadStream: file not found
Error in pixRead: image file not found
 cannot be read!

Original comment by Oduss...@gmail.com on 5 Jan 2011 at 4:56

GoogleCodeExporter commented 9 years ago
ok, I have installed again both leptonica and tesseract from macport, and now 
it works..

I don't know how, but the problem seems to be solved.

Thank you for your help!

Original comment by Oduss...@gmail.com on 5 Jan 2011 at 6:28

GoogleCodeExporter commented 9 years ago

Original comment by zde...@gmail.com on 6 Jan 2011 at 9:15

GoogleCodeExporter commented 9 years ago
The problem here is that the leptonica configure.ac script is mis-written, so 
far as testing for libtiff.  In Leptonica 1.68, it fails to "see" it, at least 
for OS X, and I suspect on any system where libz.a and libjpeg.a aren't in 
/usr/local/lib or /local/lib, and builds a leptonica install without TIFF 
support.  So Tesseract can't read TIFF either, and that's all it knows about.

Incidentally, the Tesseract tests for leptonica in T 3.0.0 don't look at 
LDPATH, and they don't look under ${prefix}/lib/, either.  If it's not in 
/usr/local/lib or /usr/lib, it's not found.

Original comment by Bill.Jan...@gmail.com on 22 Apr 2011 at 1:02

GoogleCodeExporter commented 9 years ago
Topic is already covered by FAQ.

Original comment by zde...@gmail.com on 9 Nov 2012 at 7:53

GoogleCodeExporter commented 9 years ago
Bill.Jan...@gmail.com is correct.

I had the same problem complaining document type is not supported, the root 
cause is that leptonica was configured without tiff/png/jpeg support. So you 
MUST install the tiff/png/jpeg libs installed in advance, then you can do 
configure/make with leptonica.

Original comment by park...@gmail.com on 10 May 2013 at 4:27

GoogleCodeExporter commented 9 years ago
park...@gmail.com is correct
I install:
$ sudo apt-get install libjpeg-dev libpng-dev libtiff4-dev
$ cd leptonica-1.70
$ ./configure && make && sudo make install
$ tesseract -l eng -psm 7 baz.tif foo
Then it don't report this error any more. However, it recognize nothing in 
foo.txt

Original comment by fanlinsh...@gmail.com on 14 Feb 2014 at 6:29

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
Don't know why, but reinstalling leptonica helped for me. Even though it was 
the same version (1.71)

Original comment by marek.ru...@edgenpd.com on 11 Jan 2015 at 9:47

GoogleCodeExporter commented 9 years ago
i've installed tesseract using Macports and its running properly on command 
line. But when I'm trying to use it in my c++ program it gives a linker error 
        ld: symbol(s) not found for architecture x86_64
      clang: error: linker command failed with exit code 1 (use -v to see invocation)
Am i missing something

Original comment by purohith...@gmail.com on 19 Jan 2015 at 1:59

GoogleCodeExporter commented 9 years ago
I noticed that when I was installing leptonica via 'brew install leptonica' it 
included the switch '--without-libtiff'.

I had to uninstall libtiff, then install leptonica with the switch 
'--with-libtiff'.

brew install leptonica --with-libtiff

This resolved the issue for me.

Original comment by br...@indexed.io on 11 Feb 2015 at 10:30