Tesseract培训 - 每次在Ubuntu上返回分段错误的text2image

时间:2016-08-04 15:18:40

标签: ocr tesseract text2image

我正在尝试按照oficial turorial训练新语言,但我无法执行“生成训练图像和文件夹/准备文本文件”的步骤。我已经创建了我的文本文件,但每次运行命令text2image --text=training_text.txt --outputbase=eng.TimesNewRomanBold.exp0 --font='Times New Roman Bold' --fonts_dir=/usr/share/fonts时,结果都是Could not find font named Times New Roman Bold. Pango suggested font FreeSerif Bold Please correct --font arg.:Error:Assert failed:in file text2image.cpp, line 437 Segmentation fault (core dumped)

这发生在给定的例子中(我使用了他们在turorial中使用的那个)以及我选择的每个字体,这些字体存在于运行text2image --text=training_text.txt --outputbase=eng --fonts_dir=/usr/share/fonts --find_fonts --min_coverage=1.0 --render_per_font=false 所示的列表中。

有人可以帮我吗?由于这个原因,我无法继续学习本教程......

谢谢!

1 个答案:

答案 0 :(得分:0)

经过几个小时搜索这个问题后,我发现发生的情况是操作系统无法识别命令中使用的字体,并且cpp程序无法验证这种情况,因此发生Segmentation Fault

使用有效字体后,所有字体都可以顺利运行。