tesseract under windows and paths

8,422 views
Skip to first unread message

simon.ei...@vol.at

unread,
Feb 23, 2012, 1:59:01 AM2/23/12
to tesser...@googlegroups.com
Hi all,

i successfully compiled tesseract svn r 679 under windows using cygwin
and figured out that tesseract looks in the following directory for
.traineddata files: %programfilesdir%\tesseract-ocr\tessdata.
I would point that path to the working dir of the executable and then
in the tessdata subdir. cause then it would be possible to copy
tesseract for example on a USB stick and use it from there or copy it
to a different directory without to change variables or other things.

greetings,
Simon

zdenko podobny

unread,
Feb 23, 2012, 2:28:49 AM2/23/12
to tesser...@googlegroups.com
can you sent result of:
 echo %TESSDATA_PREFIX%

Zd.



--
You received this message because you are subscribed to the Google
Groups "tesseract-ocr" group.
To post to this group, send email to tesser...@googlegroups.com
To unsubscribe from this group, send email to
tesseract-ocr+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/tesseract-ocr?hl=en

simon.ei...@vol.at

unread,
Feb 23, 2012, 3:03:24 AM2/23/12
to tesser...@googlegroups.com
hi zdenko,

here on a german windows its:
C:\Programme\Tesseract-OCR\

on a english windows it would be:
C:\Program files\Tesseract-OCR\


but i would recommend getting the path of the executable and going
into the tessdata dir which makes it easier across windows systems and
usb sticks and what not i guess.


the program files dir is saved in the variable %programfiles% on
windows which is autonmatically made available by the OS.
But i wouldn't use that method cause of above reasons with USB sticks
or different installations.

greetings,
simon

On Thu, 23 Feb 2012 08:28:49 +0100
zdenko podobny <zde...@gmail.com> wrote:
> can you sent result of:
> echo %TESSDATA_PREFIX%
>
> Zd.
>
> On Thu, Feb 23, 2012 at 7:59 AM, <simon.ei...@vol.at> wrote:
>
>> Hi all,
>>
>> i successfully compiled tesseract svn r 679 under windows using
>>cygwin and
>> figured out that tesseract looks in the following directory for

>> .traineddata files: %programfilesdir%\tesseract-**ocr\tessdata.


>> I would point that path to the working dir of the executable and
>>then in
>> the tessdata subdir. cause then it would be possible to copy
>>tesseract for
>> example on a USB stick and use it from there or copy it to a
>>different
>> directory without to change variables or other things.
>>
>> greetings,
>> Simon
>>
>> --
>> You received this message because you are subscribed to the Google
>> Groups "tesseract-ocr" group.
>> To post to this group, send email to tesser...@googlegroups.com
>> To unsubscribe from this group, send email to

>> tesseract-ocr+unsubscribe@**googlegroups.com<tesseract-ocr%2Bunsu...@googlegroups.com>


>> For more options, visit this group at

>> http://groups.google.com/**group/tesseract-ocr?hl=en<http://groups.google.com/group/tesseract-ocr?hl=en>


>>
>
> --
> You received this message because you are subscribed to the Google
> Groups "tesseract-ocr" group.
> To post to this group, send email to tesser...@googlegroups.com
> To unsubscribe from this group, send email to

> tesseract-oc...@googlegroups.com


>For more options, visit this group at
> http://groups.google.com/group/tesseract-ocr?hl=en

--
Simon Eigeldinger
simon.ei...@vol.at

zdenko podobny

unread,
Feb 23, 2012, 5:56:28 AM2/23/12
to tesser...@googlegroups.com
simon,

you did get the point - if environment variable TESSDATA_PREFIX is set, than it rule over other rules (for tesseract executable)!  If  enviroment variable is not setup, than it check if  TESSDATA_PREFIX was defined during compilation (this should be true for platform that use autotools e.g. cygwin). If  TESSDATA_PREFIX was not defined and there is no  environment variable TESSDATA_PREFIX than path of executable/library is consider as TESSDATA_PREFIX. See  [1].

If you need portable version (in term how you present it), just download  tesseract-ocr-3.01-win32-portable.zip that works exactly as you described (anyway TESSDATA_PREFIX Environment variable overrules everything ) .It is a static build.

For more options, visit this group at
http://groups.google.com/group/tesseract-ocr?hl=en

--
Simon Eigeldinger
simon.ei...@vol.at


--
You received this message because you are subscribed to the Google
Groups "tesseract-ocr" group.
To post to this group, send email to tesser...@googlegroups.com
To unsubscribe from this group, send email to

simon.ei...@vol.at

unread,
Feb 23, 2012, 7:07:45 AM2/23/12
to tesser...@googlegroups.com
hi zdenko,

thanks. i found my problem. i had a variable from a setup program
which used tesseract and it had the variable set wrong.
removed it now and it works well now.

now about compiling tesseract:
when i specify a path to the tessdata dir during compiling can i tell
it to use a relative path to the program executable for example
--tessdataprefix=tessdata
I guess then it might look in the subdir of the executable and it
should work?

greetings,
simon

On Thu, 23 Feb 2012 11:56:28 +0100
zdenko podobny <zde...@gmail.com> wrote:
> simon,
>
> you did get the point - if environment variable TESSDATA_PREFIX is
>set,
> than it rule over other rules (for tesseract executable)! If
> enviroment variable is not setup, than it check if TESSDATA_PREFIX
>was
> defined during compilation (this should be true for platform that
>use
> autotools e.g. cygwin). If TESSDATA_PREFIX was not defined and
>there is
> no environment variable TESSDATA_PREFIX than path of
>executable/library is
> consider as TESSDATA_PREFIX. See [1].
>
> If you need portable version (in term how you present it), just
>download

> tesseract-ocr-3.01-win32-portable.zip<http://code.google.com/p/tesseract-ocr/downloads/detail?name=tesseract-ocr-3.01-win32-portable.zip>

>>>> .traineddata files: %programfilesdir%\tesseract-****ocr\tessdata.


>>>>
>>>> I would point that path to the working dir of the executable and
>>>>then in
>>>> the tessdata subdir. cause then it would be possible to copy
>>>>tesseract
>>>> for
>>>> example on a USB stick and use it from there or copy it to a
>>>>different
>>>> directory without to change variables or other things.
>>>>
>>>> greetings,
>>>> Simon
>>>>
>>>> --
>>>> You received this message because you are subscribed to the Google
>>>> Groups "tesseract-ocr" group.
>>>> To post to this group, send email to tesser...@googlegroups.com
>>>> To unsubscribe from this group, send email to

>>>> tesseract-ocr+unsubscribe@**go**oglegroups.com
>>>><http://googlegroups.com>
>>>> <tesseract-ocr%**2Bunsu...@googlegroups.com<tesseract-ocr%252Buns...@googlegroups.com>
>>>> **>


>>>>
>>>> For more options, visit this group at

>>>> http://groups.google.com/****group/tesseract-ocr?hl=en<http://groups.google.com/**group/tesseract-ocr?hl=en>
>>>> <http**://groups.google.com/group/**tesseract-ocr?hl=en<http://groups.google.com/group/tesseract-ocr?hl=en>


>>>> >
>>>>
>>>>
>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "tesseract-ocr" group.
>>> To post to this group, send email to tesser...@googlegroups.com
>>> To unsubscribe from this group, send email to
>>> tesseract-ocr+unsubscribe@**googlegroups.com<tesseract-ocr%2Bunsu...@googlegroups.com>
>>> For more options, visit this group at
>>> http://groups.google.com/**group/tesseract-ocr?hl=en<http://groups.google.com/group/tesseract-ocr?hl=en>
>>>
>>
>> --

>> Simon Eigeldinger
>> simon.ei...@vol.at
>>
>>
>> --
>> You received this message because you are subscribed to the Google
>> Groups "tesseract-ocr" group.
>> To post to this group, send email to tesser...@googlegroups.com
>> To unsubscribe from this group, send email to

>> tesseract-ocr+unsubscribe@**googlegroups.com<tesseract-ocr%2Bunsu...@googlegroups.com>
>> For more options, visit this group at
>> http://groups.google.com/**group/tesseract-ocr?hl=en<http://groups.google.com/group/tesseract-ocr?hl=en>
>>
>
> --
> You received this message because you are subscribed to the Google
> Groups "tesseract-ocr" group.
> To post to this group, send email to tesser...@googlegroups.com
> To unsubscribe from this group, send email to

> tesseract-oc...@googlegroups.com

Zdenko Podobný

unread,
Mar 22, 2012, 4:09:05 PM3/22/12
to tesser...@googlegroups.com
Hi Simon,

I implemented "--disable-tessdata-prefix" for configure in revision 708.
Than means if you build tesseract with this option, TESSDATA_PREFIX is
not set during build process to installation directory (usually
/usr/share or /use/local/share on linux).

I tested it in mingw+msys on Windows XP (more tests are need from mingw
users/developers ;-)). When I run tesseract (/usr/bin/tesseract) it
expected to have "language data"/"tessdata directory" in directory where
is placed tesseract executable (in my case:
/usr/bin/tessdata/eng.traineddata).

Zdenko

Pavel Mazniker

unread,
Apr 29, 2012, 5:11:56 AM4/29/12
to tesser...@googlegroups.com, zde...@gmail.com
 Hi,
 
I checked out full  r724 from repository,

I get when running configure in ming+msys system terminal: next

 "checking for pixCreate in -llept... no
  configure: leptonica library missing"

on windows, nevertheless I copied leptonica .dll and .lib files to Windows/System directory,

Can anybody help how to resolve this problem and configure and build tesseract library on Windows ?

Thanks.

Pavel Mazniker

unread,
Apr 29, 2012, 10:10:00 AM4/29/12
to tesser...@googlegroups.com, zde...@gmail.com

 Hi,
 
I checked out full  r724 from repository, - is it tesseract 3.02 version ( latest ) ?

I get when running configure in mingw+msys system terminal: next

 "checking for pixCreate in -llept... no
  configure: leptonica library missing"

that is on windows, nevertheless I copied leptonica .dll and .lib files to Windows/System32 directory,
 
    How to make ./configure to find leptonica on windows when building tesseract usign mingw+msys ?
 

Thanks.

zdenko podobny

unread,
Apr 29, 2012, 11:34:56 AM4/29/12
to Pavel Mazniker, tesser...@googlegroups.com
On Sun, Apr 29, 2012 at 4:10 PM, Pavel Mazniker <pmaz...@gmail.com> wrote:

 Hi,
 
I checked out full  r724 from repository, - is it tesseract 3.02 version ( latest ) ?

I get when running configure in mingw+msys system terminal: next

 "checking for pixCreate in -llept... no
  configure: leptonica library missing"

that is on windows, nevertheless I copied leptonica .dll and .lib files to Windows/System32 directory,

based on you questions I would say you need to sit down and spent some time with learning tools you try to use. 
 
    How to make ./configure to find leptonica on windows when building tesseract usign mingw+msys ?
 

1. to compile and install leptonica from source. see [1] 
2. to instruct configure there is your leptonica installation (in case non standard installation in msys environment). See './configure --help'.

[1]   http://www.sk-spell.sk.cx/compiling-leptonica-and-tesseract-ocr-with-mingwmsys 

--
Zdenko
Reply all
Reply to author
Forward
Message has been deleted
0 new messages