delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2015/09/22/08:19:40

X-Recipient: archive-cygwin AT delorie DOT com
DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:from:to:subject:date:message-id:references
:in-reply-to:content-type:content-transfer-encoding
:mime-version; q=dns; s=default; b=DSA+J4QUrBa6B022jA/5KXmQWRKIp
BPqw10Plea5L97+dLkRtmgyV3F3PoMnWYmRXkLaiixRWCDsJ9PQJ+BJYYRDX87a3
A2DtWrNR61PFzT0AJ3krSDkyb5ruVh3e/9BECDvAmfXw8av5baaj7hefDjqlBhZy
UrYg5+jh4oUIDM=
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:from:to:subject:date:message-id:references
:in-reply-to:content-type:content-transfer-encoding
:mime-version; s=default; bh=SUWQdF4fujRU3lfv55jXqP03GYs=; b=rfV
R60/cPQenuse0sIt4nuWbMC6ijJ+sMtVYac1RPp8OUJDkDDA6kFvm51wltw9400P
64wGGIyH+y/0d12Xe4jKIbRBMK1zRzwK0YzS6GaZ2WyUKr0CK1fBrg/sP4M7clL0
Gw+RKOD+SwmUGlyvLrBrBV0CCdKg/G2/rgeVcAd8=
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Authentication-Results: sourceware.org; auth=none
X-Virus-Found: No
X-Spam-SWARE-Status: No, score=4.8 required=5.0 tests=AWL,BAYES_50,CYGWIN_OWNER_BODY,KAM_LAZY_DOMAIN_SECURITY,RCVD_IN_DNSWL_LOW autolearn=no version=3.3.2
X-HELO: mx4.adesso.de
From: "Schmitz, Marco" <marco DOT schmitz AT adesso-mobile DOT de>
To: "Schmitz, Marco" <marco DOT schmitz AT adesso-mobile DOT de>,
Marco Atzeri <marco DOT atzeri AT gmail DOT com>,
"cygwin AT cygwin DOT com" <cygwin AT cygwin DOT com>
Subject: AW: Tesseract 3.04 - Cygwin64 - Windows 8.1 - Can't open makebox
Date: Tue, 22 Sep 2015 12:18:49 +0000
Message-ID: <D347C6895A0AB142BAA2D2F876C96CAA83361900@ex2010-db01>
References: <D347C6895A0AB142BAA2D2F876C96CAA83360F13 AT ex2010-db01> <560010D0 DOT 4010903 AT gmail DOT com> <D347C6895A0AB142BAA2D2F876C96CAA83361896 AT ex2010-db01>
In-Reply-To: <D347C6895A0AB142BAA2D2F876C96CAA83361896@ex2010-db01>
MIME-Version: 1.0
X-IsSubscribed: yes
X-MIME-Autoconverted: from quoted-printable to 8bit by delorie.com id t8MCJZSl023607

Okay, my shell script problem "not finding makebox" was a line ending problem (CR+LF).

But how about TESSDATA_PREFIX ?

-----Ursprüngliche Nachricht-----
Von: cygwin-owner AT cygwin DOT com [mailto:cygwin-owner AT cygwin DOT com] Im Auftrag von Schmitz, Marco
Gesendet: Dienstag, 22. September 2015 13:23
An: Marco Atzeri <marco DOT atzeri AT gmail DOT com>; cygwin AT cygwin DOT com
Betreff: AW: Tesseract 3.04 - Cygwin64 - Windows 8.1 - Can't open makebox

Hi Marco,

without setting TESSDATA_PREFIX (neither Windows environment variables nor .bash_profile) I get:

$ tesseract --list-langs
Error opening data file C:\DEV\tesseract\Tesseract-OCR\tessdata/eng.traineddata
Please make sure the TESSDATA_PREFIX environment variable is set to the parent directory of your "tessdata" directory.
Failed loading language 'eng'
Tesseract couldn't load any languages!
Could not initialize tesseract.


This is my first problem, which I solved defining TESSDATA_PREFIX (in Windows environment). Now I get:

$ tesseract --list-langs
List of available languages (13):
arbeitsunfaehigkeit
deu
deu_frak
eng
fra
ita
ita_old
nld
osd
por
spa
spa_old
vie


Then I try this:

$ tesseract arbeitsunfaehigkeit.hausarzt.exp0.jpg arbeitsunfaehigkeit batch.nochop makebox Tesseract Open Source OCR Engine v3.04.00 with Leptonica


Okay, but originally I wrote this issue because I tried to call it from a shell script. So, this is my box.sh:

#!/usr/bin/env bash
tesseract arbeitsunfaehigkeit.hausarzt.exp0.jpg arbeitsunfaehigkeit batch.nochop makebox

and calling it brings up the original error:

$ ./box.sh
Tesseract Open Source OCR Engine v3.04.00 with Leptonica
read_params_file: Can't open makebox


Best regards,
Marco


-----Ursprüngliche Nachricht-----
Von: cygwin-owner AT cygwin DOT com [mailto:cygwin-owner AT cygwin DOT com] Im Auftrag von Marco Atzeri
Gesendet: Montag, 21. September 2015 16:15
An: cygwin AT cygwin DOT com
Betreff: Re: Tesseract 3.04 - Cygwin64 - Windows 8.1 - Can't open makebox

On 21/09/2015 11:03, Schmitz, Marco wrote:
> I am using Windows 8.1 and Cygwin64 in order to run Tesseract 3.04.
>
> Running the following command:
>
>      tesseract arbeitsunfaehigkeit.hausarzt.exp0.jpg 
> arbeitsunfaehigkeit batch.nochop makebox
>
> results in the following output:
>
>      Tesseract Open Source OCR Engine v3.04.00 with Leptonica
>      read_params_file: Can't open makebox
>
> And this is after I fixed the output:
>
>      Tesseract Open Source OCR Engine v3.04.00 with Leptonica
>      Error opening data file 
> C:\DEV\tesseract\Tesseract-OCR\tessdata/eng.traineddata

Are you defining TESSDATA_PREFIX ? Why ?

>      Please make sure the TESSDATA_PREFIX environment variable is set to the parent directory of your "tessdata" directory.
>      Failed loading language 'eng'
>      Tesseract couldn't load any languages!
>      Could not initialize tesseract.
>
> Using the following line in .bash_profile:
>
>      export TESSDATA_PREFIX="/cygdrive/c/DEV/cygwin64/usr/share/tessdata/"


The default should be

TESSDATA_PREFIX="/usr/share/tessdata/"

Without defining TESSDATA_PREFIX, I have

$ tesseract.exe --list-langs
List of available languages (4):
deu
deu_frak
eng
osd

and the language files are in :

$ ls /usr/share/tessdata/
configs/              eng.cube.fold    eng.cube.size 
osd.traineddata
deu.traineddata       eng.cube.lm      eng.cube.word-freq     pdf.ttf
deu_frak.traineddata  eng.cube.nn      eng.tesseract_cube.nn  tessconfigs/
eng.cube.bigrams      eng.cube.params  eng.traineddata        training/


Regards
Marco




--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple


--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple


--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple


- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019