Tesseract 训练 - text2image 每次都在 Ubuntu 上返回分段错误

Tesseract training - text2image returning Segmentation Fault every time on Ubuntu

我正在尝试按照 oficial turorial 训练一门新语言,但我无法执行 "Generate Training Images and Box Files/Prepare a text file" 上的步骤。我已经创建了我的文本文件,但每次我 运行 命令 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 中使用的那个)以及我选择的每种字体,它们存在于 运行ning text2image --text=training_text.txt --outputbase=eng --fonts_dir=/usr/share/fonts --find_fonts --min_coverage=1.0 --render_per_font=false 显示的列表中。

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

谢谢!

搜索这个问题几个小时后,我发现发生的事情是命令中使用的 字体 无法被 OS 和cpp 程序不会验证这种情况,因此会出现 Segmentation Fault

使用有效字体后,一切运行顺利。