其实页头有写,这里复述一遍: a. Microsoft Windows [版本 10.0.14393](Win 10 x64 Pro 1607 14393.1480) b. Python 2.7.13 (v2.7.13:a06454b1afa1, Dec 17 2016, 20:53:40) [MSC v.1500 64 bit (AMD64)] on win32 c. JetBrains Pycharm 2017.1.5 x64 Professional
An unofficial installer for windows for Tesseract 3.05-dev and Tesseract 4.00-dev is available from Tesseract at UB Mannheim. This includes the training tools.
An installer for the old version 3.02 is available for Windows from our download page. This includes the English training data. If you want to use another language, download the appropriate training data, unpack it using 7-zip, and copy the .traineddata file into the ‘tessdata’ directory, probably C:\Program Files\Tesseract OCR\tessdata.
a replacement for PIL, the Python Image Library, which provides image processing functionality and supports many file formats. Use from PIL import Image instead of import Image.
This occurs under windows (at least in tesseract version 3.05) when the current directory is on a different drive from where tesseract is installed.
Something in tesseract is expecting data files to be in \Program Files… (rather than C:\Program Files, say). So if you’re not on the same drive letter as tesseract, it will fail. It would be great if we could work around it by temporarily changing drives (under windows only) to the tesseract installation drive before executing tesseract, and changing back after.
Please try to use the config option with pytesseract like this:
tessdata_dir_config = ‘–tessdata-dir ““‘ Example config: ‘–tessdata-dir “C:\Program Files (x86)\Tesseract-OCR\tessdata”‘ It’s important to include double quotes around the dir path.
pytesseract.image_to_string(image, lang=’chi_sim’, config=tessdata_dir_config) If this workaround works for you, I will include the snippet to the README file.
▼ General Request URL:http://jwc.sut.edu.cn/ACTIONLOGON.APPPROCESS?mode=4 Request Method:POST Status Code:200 OK Remote Address:202.199.96.30:80 Referrer Policy:no-referrer-when-downgrade