【发布时间】:2021-03-05 12:09:02
【问题描述】:
我试图使用pytesseract 来查找图像中每个字母的框位置。我尝试使用image,并使用 Pillow 对其进行裁剪,但效果很好,但是当我尝试使用较小字符大小的图像 (example) 时,程序可能会识别字符,但使用框坐标裁剪图像会给出我的图像像this。我还尝试将原始图像的大小加倍,但没有任何改变。
img = Image.open('imgtest.png')
data=pytesseract.image_to_boxes(img)
dati= data.splitlines()
corde=[]
for i in dati[0].split()[1:5]: #just trying with the first character
corde.append(int(i))
im=img.crop(tuple(corde))
im.save('cimg.png')
【问题讨论】:
标签: python-3.x python-imaging-library python-tesseract