Re: [tesseract-ocr] Proper Use of Text2Image?

428 views
Skip to first unread message
Message has been deleted

ShreeDevi Kumar

unread,
Apr 17, 2016, 12:40:21 PM4/17/16
to tesser...@googlegroups.com

Please use the font name instead of the TTF file name. It may be 'Bradley Hand ITC'

- sent from my phone. excuse the brevity.

On 17-Apr-2016 8:38 pm, "John Timuty" <dharn...@gmail.com> wrote:
Hi there! ^_^
I didn't know how to compile so I had to download Cygwin because only there i got a compiled text2image.exe..
But now i have it and tried to use it. This is what i get when i execute command.

John@John-PC /cygdrive/c/cygwin/training
$ text2image --text=C:\Users\John\Desktop\12345.txt --outputbase=ENG.BradleyHandITC.exp0 --font='BradleyHandITC' 
--fonts_dir=C:\Users\John\Desktop\fnt
----------------------------------------------------------------------------------------------------------------
FcInitiReinitialize failed!!
Could not find font named BradleyHandITC. Pango suggested font
Please correct --font arg.:Error:Assert failed:in file /cygdrive/e/cyg_pub/devel/tesseract/tesseract-ocr-3.04.01-1.i686/src/tesseract-3.04.01/training/text2image.cpp, line 437
Segmentation fault (core dumped)
----------------------------------------------------------------------------------------------------------------
Seriously, what does that mean?
In the font's dir, there is a BradleyHandITC.TTF (TRUETYPE)
I don't know what wrong i am doing? Do i need a BradleyHandITC.OTF too? (OPENTYPE) to work properly?
I have successfully trained a font before but i want to add more pages to increase the accuracy.
Please Help. I am very close to start training 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 tesseract-oc...@googlegroups.com.
To post to this group, send email to tesser...@googlegroups.com.
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/b57563e6-1502-4a29-96a1-612c61814e44%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Marco Atzeri

unread,
Apr 17, 2016, 1:50:40 PM4/17/16
to tesser...@googlegroups.com
On 17/04/2016 14:45, John Timuty wrote:
> Hi there! ^_^
> I didn't know how to compile so I had to download Cygwin because only
> there i got a compiled text2image.exe..
> But now i have it and tried to use it. This is what i get when i execute
> command.
>
> John@John-PC /cygdrive/c/cygwin/training
> $ *text2image --text=C:\Users\John\Desktop\12345.txt
> --outputbase=ENG.BradleyHandITC.exp0 --font='BradleyHandITC' *
> *--fonts_dir=C:\Users\John\Desktop\fnt*
> ----------------------------------------------------------------------------------------------------------------
> FcInitiReinitialize failed!!
> Could not find font named BradleyHandITC. Pango suggested font
> Please correct --font arg.:Error:Assert failed:in file
> /cygdrive/e/cyg_pub/devel/tesseract/tesseract-ocr-3.04.01-1.i686/src/tesseract-3.04.01/training/text2image.cpp,
> line 437
> Segmentation fault (core dumped)
> ----------------------------------------------------------------------------------------------------------------
> Seriously, what does that mean?
> In the font's dir, there is a BradleyHandITC*.TTF* (TRUETYPE)
> I don't know what wrong i am doing? Do i need
> a BradleyHandITC.*OTF* too? (OPENTYPE) to work properly?
> I have successfully trained a font before but i want to add more pages
> to increase the accuracy.
> Please Help. I am very close to start training tesseract.
>


As you are using cygwin,
paths must use the POSIX convention so replace

C:\Users\John\Desktop\12345.txt with
/cygdrive/c/Users/John/Desktop/12345.txt

C:\Users\John\Desktop\fnt with
cygdrive/c/Users/John/Desktop/fnt

I suspect the segfault is coming from this problem.

About the font the best way to add it to the cygwin fonts is to
copy the BradleyHandITC*.TTF to /usr/share/fonts/TTF
and rebuild the font cache. So

cp cygdrive/c/Users/John/Desktop/fnt/*.TTF /usr/share/fonts/TTF
rm /usr/share/fonts/TTF/fonts.dir
fc-cache -f /usr/share/fonts/TTF

after that with
fc-list |grep TTF

You can see your new installed fonts with their canonical names.

Regards
Marco


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