Python verification code identified by Pytesser

Source: Internet
Author: User

Python installation package:

There are two main packages to install: PIL and pytesser ,tesseract

(1), Installation pil::http://www.pythonware.com/products/pil/

After the download is an EXE program, directly double-click the installation

(2), pytesser::http://code.google.com/p/pytesser/

Installation of the Pytesser module:

After downloading to get "Pytesser.zip", is a compressed file, using the method:

1. Create a new folder under the "C:\Python27\Lib\site-packages" Path and name "Pytesser". Extract the files from the "Pytesser.zip" to this directory:

2, renamed "pytesser.py" to "__init__.py".

3. Open "__init__.py" file, modify: Tesseract_exe_name = ' c:\\python27\\lib\\site-packages\\pytesser\\tesseract ' # Name of Executable to being called at command line

4, Pytesser module depends on the PIL module, if the above method to install PIL, you need to "init.py" file "import image" changed to "from PIL import image."

Download decompression directly put C:\Python27\Lib\site-packages, at the same time, a new pytesser.pth, the content is written, note that the content here must and pytesser this folder the same name, meaning is Pytesser folder, Pytesser.pth, and the content must be the same!

(3), tesseract OCR engine Download: http://code.google.com/p/tesseract-ocr/

After downloading, unzip, Tessdata folder, use it to replace the Pytesser extracted Tessdata folder. (On the Pytesser folder above)

The code is as follows:

1 #-*-coding:utf-8-*-2 __author__="Carry"3  fromPILImportImage4  fromPytesserImport*5 6Image = Image.open ('xx.jpg')7 PrintImage_to_string (image)

Python verification code identified by Pytesser

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.