【发布时间】:2021-08-31 00:58:21
【问题描述】:
我想从下面留下的图像中识别文本。我不知道图书馆为什么会在空白处识别出一些字母。我已经尝试过更改配置参数。
我编写的这个函数返回这个:Legendary X yp
这里是代码
def get_text(image, coord):
im = Image.open(image)
image_cropped = crop_text(im, coord)
text = pytesseract.image_to_string(image_cropped, lang='eng', config='--psm 7')
print(text)
return text
我要从中提取文本的图像:
【问题讨论】:
-
显示的图像是
crop_text的结果还是image输入到get_text的结果?在这种情况下,也需要代码和coord。参考minimal reproducible example。
标签: python image-processing ocr tesseract python-tesseract