繁体   English   中英

当它只是一个字母时,Pytesseract 无法识别

[英]Pytesseract does not recognize when it's just a letter

我只需要识别一个字母

但是当它只是一个字母时 OCR 无法识别!

在这种情况下,我试图识别字母 H 但什么也没显示!! 我该怎么做才能让他认出来?

from PIL import Image
from pytesseract import *
import cv2
img = cv2.imread('H.png',0)
edges = cv2.Canny(img,100,200)
img_new = Image.fromarray(edges)
text = pytesseract.image_to_string(img_new, lang='eng')
print (text)

请尝试以下操作:

    text = pytesseract.image_to_string(img_new, lang='eng', config='--psm 10')

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM