【问题标题】:How can I define the font type for tesseract to use in recognition (not in training)?如何定义 tesseract 用于识别(而不是训练)的字体类型?
【发布时间】:2014-06-18 17:43:51
【问题描述】:

对于可下载的英文数据集我做

cat tessdata/eng.* | egrep -o ".*ttf" | sort -u

并获取在英语语言训练中使用的所有字体的列表

Andale_Mono.ttf
Arial_Black.ttf
Arial_Bold.ttf
Arial.ttf
buttf
Comic_Sans_MS_Bold.ttf
Comic_Sans_MS.ttf
Courier_New_Bold.ttf
Courier_New.ttf
Georgia_Bold.ttf
Georgia.ttf
Gottf
Impact.ttf
Times_New_Roman_Bold.ttf
Times_New_Roman.ttf
Trebuchet_MS_Bold.ttf
Trebuchet_MS.ttf
ttf
Verdana_Bold.ttf
Verdana.ttf

现在我想识别我已经知道字体类型的文本,所以我想限制识别。我试过了:

api.SetVariable("classify_font_name", "Arial_Bold.ttf");

但我没有看到更好的结果。有人可以告诉我该怎么做,或者是否有可能?

【问题讨论】:

    标签: c++ fonts ocr tesseract truetype


    【解决方案1】:

    您可以使用LTRResultIterator 类及其WordFontAttributes 方法来获取单词或字符级别的结果的字体信息。获得字体属性后,您可以根据特定的字体名称标准过滤输出文本。见Tesseract API examples

    【讨论】:

    猜你喜欢
    • 2013-11-08
    • 1970-01-01
    • 2022-01-11
    • 1970-01-01
    • 2012-01-05
    • 2019-01-06
    • 1970-01-01
    • 2017-05-08
    相关资源
    最近更新 更多