As per your message above
The files are in   /usr/local/share/tessdata/
but program is looking for them at /usr/local/share/

you can set TESSDATA_PREFIX and try

OR

specify the directory as part of the command line. I have found that to be
the easiest way, specially when using/comparing diff kinds of traineddata
(fast, best, legacy ...)

example script below

-------

#!/bin/bash
img_files=$(ls ./Cap*.png)
for img_file in ${img_files}; do
  echo "****************************" ${img_file}
"**********************************"
    time tesseract --tessdata-dir /mnt/c/Users/User/shree/tessdata_best/
 ${img_file} ${img_file%.*}-eng-best  --oem 1 --psm 6 -l eng
    time tesseract --tessdata-dir /mnt/c/Users/User/shree/tessdata_fast/
 ${img_file} ${img_file%.*}-eng-fast  --oem 1 --psm 6 -l eng
    time tesseract --tessdata-dir /mnt/c/Users/User/shree/tessdata/
 ${img_file} ${img_file%.*}-engplus  --oem 1 --psm 6 -l engplus
done





ShreeDevi
____________________________________________________________
भजन - कीर्तन - आरती @ http://bhajans.ramparivar.com

On Wed, Dec 20, 2017 at 8:49 PM, Sasha Ostrikov <
[email protected]> wrote:

> *Yes tried that. this is the output - same sh*t :(*
>
> sasha@ds:~/dev/ext/dsnotebooks/text_extraction/images$ ll
> /usr/local/share/tessdata/
> total 148
> drwxr-xr-x  4 root root  4096 Dec 20 15:15 ./
> drwxr-xr-x 10 root root  4096 Dec 20 15:14 ../
> drwxr-xr-x  2 root root  4096 Dec 20 15:15 configs/
> -rwxr-xr-x  1 root root 32291 Dec 20 15:15 eng.traineddata*
> -rwxr-xr-x  1 root root 32292 Dec 20 15:15 fra.traineddata*
> -rwxr-xr-x  1 root root 32324 Dec 20 15:15 Hebrew.traineddata*
> -rwxr-xr-x  1 root root 31001 Dec 20 15:15 heb.traineddata*
> -rwxr-xr-x  1 root root   572 Dec 20 15:15 pdf.ttf*
> drwxr-xr-x  2 root root  4096 Dec 20 15:15 tessconfigs/
> sasha@ds:~/dev/ext/dsnotebooks/text_extraction/images$
> sasha@ds:~/dev/ext/dsnotebooks/text_extraction/images$
> sasha@ds:~/dev/ext/dsnotebooks/text_extraction/images$
> sasha@ds:~/dev/ext/dsnotebooks/text_extraction/images$ $TESSDATA_PREFIX
> bash: /usr/local/share/tessdata: Is a directory
> sasha@ds:~/dev/ext/dsnotebooks/text_extraction/images$
> sasha@ds:~/dev/ext/dsnotebooks/text_extraction/images$
> sasha@ds:~/dev/ext/dsnotebooks/text_extraction/images$
> sasha@ds:~/dev/ext/dsnotebooks/text_extraction/images$ tesseract
> text2.png t1.txt -l eng --oem 0
> Error opening data file /usr/local/share/eng.traineddata
> Please make sure the TESSDATA_PREFIX environment variable is set to your
> "tessdata" directory.
> Failed loading language 'eng'
> Tesseract couldn't load any languages!
> Could not initialize tesseract.
> sasha@ds:~/dev/ext/dsnotebooks/text_extraction/images$ tesseract
> text2.png t1.txt -l eng --oem 1
> Error opening data file /usr/local/share/eng.traineddata
> Please make sure the TESSDATA_PREFIX environment variable is set to your
> "tessdata" directory.
> Failed loading language 'eng'
> Tesseract couldn't load any languages!
> Could not initialize tesseract.
> sasha@ds:~/dev/ext/dsnotebooks/text_extraction/images$ tesseract
> text2.png t1.txt -l eng --oem 2
> Error opening data file /usr/local/share/eng.traineddata
> Please make sure the TESSDATA_PREFIX environment variable is set to your
> "tessdata" directory.
> Failed loading language 'eng'
> Tesseract couldn't load any languages!
> Could not initialize tesseract.
> sasha@ds:~/dev/ext/dsnotebooks/text_extraction/images$ tesseract
> text2.png t1.txt -l eng --oem 3
> Error opening data file /usr/local/share/eng.traineddata
> Please make sure the TESSDATA_PREFIX environment variable is set to your
> "tessdata" directory.
> Failed loading language 'eng'
> Tesseract couldn't load any languages!
> Could not initialize tesseract.
>
> --
> 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 [email protected].
> To post to this group, send email to [email protected].
> Visit this group at https://groups.google.com/group/tesseract-ocr.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/tesseract-ocr/c11d3337-48dc-4d1d-a621-c903573ca76d%
> 40googlegroups.com
> <https://groups.google.com/d/msgid/tesseract-ocr/c11d3337-48dc-4d1d-a621-c903573ca76d%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/tesseract-ocr.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tesseract-ocr/CAG2NduU1ijWUXgZJsiRdbSzBEaBFuFAZh6o%3DumGRGv-h%3DwUJ4g%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to