限制pytesseract中检测到的字符数

时间:2020-02-19 10:34:57

标签: python ocr tesseract captcha python-tesseract

所以我有一个验证码图片,我正在尝试使用pytesseract进行解码。我已经使用opencv完成了所有预处理,然后我的当前图像是-

enter image description here

现在,当我使用pytesseract时,它会给我输出:

print(pytesseract.image_to_string(image, config = '--psm 7'))

gTKYWS5

有一种方法可以限制检测到的非关闭字符,因为我知道我所有的图像都将有6个字符。

0 个答案:

没有答案