使用python pytesseract从图像中提取文本
这是我第一次使用OCR。我有一个图像,想从图像中提取数据。我的图像如下所示: 我有500个这样的图像,必须记录参数和相应的值。我想通过代码来完成,而不是手工完成 我已经尝试使用python py-tesseract和PIL库。如果图像中包含一些简单的文本,它们的性能就很好使用python pytesseract从图像中提取文本,python,image-processing,ocr,image-recognition,python-tesseract,Python,Image Processing,Ocr,Image Recognition,Python Tesseract,这是我第一次使用OCR。我有一个图像,想从图像中提取数据。我的图像如下所示: 我有500个这样的图像,必须记录参数和相应的值。我想通过代码来完成,而不是手工完成 我已经尝试使用python py-tesseract和PIL库。如果图像中包含一些简单的文本,它们的性能就很好 from PIL import Image, ImageEnhance, ImageFilter from pytesseract import image_to_string from pytesseract imp
from PIL import Image, ImageEnhance, ImageFilter
from pytesseract import image_to_string
from pytesseract import image_to_boxes
im = Image.open("AHU.png")
im = im.filter(ImageFilter.MedianFilter())
enhancer = ImageEnhance.Contrast(im)
im = enhancer.enhance(2)
im = im.convert('1')
im.save('temp2.jpg')
text = image_to_string(Image.open('temp2.jpg'))
print(text)
在有多个参数的情况下该怎么办?我所有的图像在值的位置上都是相似的。这是个好问题。为什么没有回答?