限制字符tesseract寻找 [英] Limit characters tesseract is looking for
问题描述
是否可以限制 tesseract 寻找的字符集(例如,仅搜索字母az)?那会大大改善我的结果.
Is it possible to limit the set of characters that tesseract is looking for (e.g. search only for letters a-z)? That would improve my results greatly.
推荐答案
在tessdata/configs目录中创建配置文件(例如字母")-通常为/usr/share/tesseract/tessdata/configs
或
/usr/share/tesseract-ocr/tessdata/configs
Create a config file (e.g "letters") in tessdata/configs directory - usually /usr/share/tesseract/tessdata/configs
or
/usr/share/tesseract-ocr/tessdata/configs
并将此行添加到配置文件:
And add this line to the config file:
tessedit_char_whitelist abcdefghijklmnopqrstuvwxyz
...或者也许[a-z]起作用.. dunno :-)
然后调用类似于以下内容的tesseract:
...or maybe [a-z] works.. dunno :-)
Then call tesseract similar to this:
tesseract input.tif output nobatch letters
这将限制tesseract只识别所需的字符
That will limit tesseract to recognize only the wanted characters
这篇关于限制字符tesseract寻找的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!