1

我想从以图像形式存储的一堆表中提取数据-

导入 tesseract 时会提示安装 Qhull(根据文档http://pytesseract.readthedocs.io/en/latest/tutorials.html

代码 -

> import Image 
> from tesseract import image_to_string
> print image_to_string(Image.open('test.png')) print
> image_to_string(Image.open('test-english.jpg'), lang='eng')

我得到以下提示,但我无法正确输入目录 -

Please enter the path to an existing directory where qhull should be installed: 

我尝试在引号中给出目录,也通过变量,但它一直给我无效目录错误

这应该很简单,但我就是不明白。

提前致谢。

4

2 回答 2

0

pytesseract改为使用

pip install pytesseract
于 2017-04-17T04:04:49.313 回答
0
You Need to change some lines of codes in
C:\Python27\Lib\site-packages\tesseract\voro.py file

in line after

    # Qhull installation 
    if config_parser.has_option('qhull','install-dir'):
        _qhulldir = config_parser.get('qhull','install-dir').strip()
    else:
    # Ask user for qhull directory
##    qstr = 'Please enter the path to an existing directory where qhull should be installed: 
        qstr = 'C:/Python27/Lib/site-packages/tesseract'
    ##    _qhulldir = os.path.expanduser(raw_input(qstr).strip())
        _qhulldir = os.path.expanduser(qstr)
于 2017-08-10T09:52:07.880 回答