Pytesseract无法检测到连字符,而是显示7

时间:2020-09-20 15:01:00

标签: python computer-vision tesseract python-tesseract

我有一个图像,其中包含我需要提取的字符串。图片如下:

enter image description here

我需要输入文字=>'2145-3'

我的代码如下:

main.py

import pytesseract
import os

pytesseract.pytesseract.tesseract_cmd = r'C:\Program Files (x86)\Tesseract-OCR\tesseract'
directory = './images'
for filename in os.listdir(directory):
    if filename.endswith((".jpg", ".JPG")):
        txt = pytesseract.image_to_string(directory+'/'+filename, lang='eng')
        print(txt)

输出:

Dhs. 90.00/ Dzn

214573
151 ADVENTURE STORIES

48 PCS / CTN

我已经在线检查了,大多数的不满都重定向到了图像的分辨率或形状。我确实更改了它们,但是结果还是一样。目录中存在的所有其他图像也会发生相同的问题。

0 个答案:

没有答案