【发布时间】:2021-10-23 06:12:08
【问题描述】:
我正在尝试阅读的图片正在输出“ones”。我不知道它是怎么得到的。我的代码:
left = 980
right = 1000
top = 237
bottom = 265
CroppedImage = cropimage.crop((left,top,right,bottom))
if os.path.isfile("Price.png"):
os.remove("Price.png")
CroppedImage.save('Price.png', 'PNG')
Check_Price = pytesseract.image_to_string(Image.open('Price.png'), lang='eng')
Check_Price = Check_Price[:-2]
if len(Check_Price) == 4:
Found_Price = True
print(Check_Price)
我已经正确安装了 pytesseract 和 PIL。这一切都适用于我拥有的另外 2 个,但它只是不会阅读此文本。
【问题讨论】:
标签: python python-3.x python-tesseract