Pytesseract - Using user patterns

╄→гoц情女王★ 提交于 2021-02-19 04:18:55

问题


I'm trying to use tesseract's user-patterns with pytesseract but can't seem to get the command working. This seems like it should be fairly straight forward but the documentation is sparse

I'm on tesseract 3.05.01. Doing this doesn't work:

pytesseract.image_to_string(image, config='--oem 0 bazaar --user-patterns ./timestamps.user_patterns')

I have a bazaar file in /usr/local/share/tessdata/configs/bazaar that says this:

load_system_dawg     T
load_freq_dawg       T
user_words_suffix    user-words
user_patterns_suffix user-patterns

I'm trying to detect 4 numbers, so my user patterns file is:

\d\d\d\d

The error I get is:

pytesseract.pytesseract.TesseractError: (1, "read_params_file: Can't open -user-patterns read_params_file: parameter not found: \\d\\d\\d\\d")

来源:https://stackoverflow.com/questions/50847859/pytesseract-using-user-patterns

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!