大家好,我要做的是让python识别这张图片just the number 96 in a white background。给我看一个“96”字串,仅此而已。在
为此,我使用命令提示符(pip install pytesseract)将pytesseract安装到python中,我还安装了Pil(现在是pillow,也使用命令提示符安装),Tesseract OCR engine也安装在我的计算机上,我下载并安装了它,在我的环境变量中(在命令提示符中键入path命令,它会显示Tesseract OCR),最后我还下载了pytesser,将文件解压缩到目录:C:\Python27\Lib。差点忘了提一下,我的python版本是2.7.12,安装的OpenCV版本是3.1.0。
我所做的是运行以下脚本:from PIL import Image
import pytesseract
img=Image.open('E:\Alex2016\Python OpenCV\Scripts\imagenFinal.jpg')
a=pytesseract.image_to_string(img)
print(a)
img.show()
它只显示图像,但没有“96”字符串。即使我不知道这是一个强大的引擎,我也不知道。我在pythonshell中运行脚本。我还必须指出,我不能让pytesser工作,因为当我尝试“import pytesser”或执行“from pytesser import*”时,我得到了这个错误
import pytesser
ImportError: No module named pytesser
我认为这张图片是可以理解的,而且没有噪音,所以各位,如果你们能告诉我如何用这些工具来检测数字,或者如果有任何其他工具可以做到这一点,非常感谢你们的时间,伙计们,我是这方面的新手,但我对这个科学领域,计算机视觉技术非常感兴趣。在