1, import image error, copy the PiL directory to the Site-packages directory, perform from PIL import image, you can
2. From pytesser import *, error, execute sys.path.append ("D:/software/15/python-packet/pytesser"), OK, then execute from pytesser import *, The error can not find the image module, modify the first sentence of the d:/software/15/python-packet/pytesser/pytesser.py to change from PIL import Image,ok
3, the error of the _imaging C module is not installed, install Pil-1.1.7.win32-py2.5,ok
4, installation Tesseract-ocr-setup-3.02.02.exe as if you can identify, directly run Tesseract-l Eng v4.jpg result, in the current directory result.txt can see the number of v4.jpg
5, the test under the Win7 success. Used to test the code picture file for v4.jpg, test program getverify.py, two files stored in the directory for D:\testcode\pythoncode, after the installation of successful Tesseract-ocr-setup-3.02.02.exe, Can see the directory tessdata, copy this directory to D:\testcode\pythoncode, test program getverify.py source code as follows
Import Tesseract
API = Tesseract. Tessbaseapi ()
Api. Init (".", "Eng", Tesseract. Oem_default)
Api. SetVariable ("Tessedit_char_whitelist", "0123456789abcdefghijklmnopqrstuvwxyz")
Api. Setpagesegmode (tesseract. Psm_auto)
Mimgfile = "V4.jpg"
Mbuffer=open (Mimgfile, "RB"). Read ()
result = Tesseract. Processpagesbuffer (Mbuffer,len (mbuffer), API)
print ' result (processpagesbuffer) = ', result
Run command D:\testcode\pythoncode>d:\python27\python.exe getverify.py can see the numbers in V4.jpg
These two pictures can be named V4.jpg to experiment