pytesseract无法识别图像中的文本/字符?

时间:2020-09-25 21:52:13

标签: python python-3.x python-tesseract pytesser

试图检测图像中的文本,但出于某种原因,pytesseract在尝试检测文本时仅返回三(3)条空行,在我的示例中为试图提取“ BNC 116”。 enter image description here

# https://stackabuse.com/pytesseract-simple-python-optical-character-recognition/
from PIL import Image
import pytesseract

def ocr_core(filename):
    text = pytesseract.image_to_string(Image.open(filename))
    return text

directory = 'images/'
print(ocr_core(directory + 'car.png'))

我已经包含了指向代码作者的链接。

0 个答案:

没有答案