问题
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