text2image: 'could not find font' although it is listed

998 views
Skip to first unread message

Mirko P

unread,
Mar 26, 2015, 3:39:27 PM3/26/15
to tesser...@googlegroups.com
Hi all,

I'm trying to create some training data for the ocr-b font with text2image. Unfortunately when running
training/text2image --text=training_text.txt --outputbase=eng.ocr-b.exp0 --font='ocrb10' --fonts_dir=/path/to/my/fonts

I always get 'Could not find font ocrb10' error. This is the exact output:
...
Could not find font named ocrb10
FLAGS_find_fonts || FontUtils::IsAvailableFont(FLAGS_font.c_str()):Error:Assert failed:in file text2image.cpp, line 417
Segmentation fault (core dumped)

Although when running 'training/text2image --list_available_fonts --fonts_dir=/usr/...' it lists ocrb10:
Initializing fontconfig
0: OCRB Extra-Expanded
1: ocrb10

I have no idea where to go from here since text2image seems to recognize the font but still doesn't. Any help would be highly appreciated!
Mirko

Mirko P

unread,
Mar 27, 2015, 5:28:30 AM3/27/15
to tesser...@googlegroups.com
Btw. I run it on Ubuntu 14 in a virtual box.

Mirko P

unread,
Mar 27, 2015, 6:24:27 AM3/27/15
to tesser...@googlegroups.com
Solved: Running sudo without -H did the trick!

Sriranga(80yrs)

unread,
Mar 27, 2015, 6:30:41 AM3/27/15
to tesser...@googlegroups.com
congratulations!  Will you kindly elaborate little for benefit of users. please
reproduce the actual commandline without -H used in ubuntu.

On Fri, Mar 27, 2015 at 3:54 PM, Mirko P <mirko.p...@gmail.com> wrote:
Solved: Running sudo without -H did the trick!

--
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 http://groups.google.com/group/tesseract-ocr.
To view this discussion on the web visit https://groups.google.com/d/msgid/tesseract-ocr/dd922314-77d7-42da-bed2-3f56c07e71ee%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Mirko P

unread,
Mar 31, 2015, 6:17:21 AM3/31/15
to tesser...@googlegroups.com
I ran 'sudo -s' instead of 'sudo -H -s' to get root access to the directory I was working with. I don't quite get what the -H is doing so I tried both and it worked without. After that I ran the normal training/text2image command as it is documented and everything worked well.
Reply all
Reply to author
Forward
0 new messages