C++ 如何定义tesseract在识别(非培训)中使用的字体类型?

C++ 如何定义tesseract在识别(非培训)中使用的字体类型?,c++,fonts,ocr,tesseract,truetype,C++,Fonts,Ocr,Tesseract,Truetype,对于可下载的英语数据集,我有 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 Georgi

对于可下载的英语数据集,我有

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");

但我没有看到更好的结果。有人能告诉我怎么做吗?如果可能的话?

您可以使用
LTRResultIterator
类及其
WordFontAttributes
方法在word或字符级别获取结果的字体信息。获得字体属性后,可以根据特定的字体名称条件过滤输出文本。请参阅。

问题是如何选择一种特定的字体进行识别,并且只使用该单一字体的训练数据。我误解了这个问题。看见