Pytesser Image text recognition

Source: Internet
Author: User
Python image text recognition uses tools such as PiL and Pytesser. Because they use a lot of Python library files, in order to avoid the installation of a tool, it is recommended to use PYTHONXY, this tool can refer to the introduction of Baidu. Pytesser is a module of the Google OCR Open source project, which is imported into Python to convert the text in the image into text. Pytesser called the tesseract. When calling the Pytesser module in Python, Pytesser also uses tesseract to identify the text in the picture. Pytesser Use the following steps:
First, install the Python2.7 version, this version is relatively stable, it is recommended to use this version. Second, install the PYTHONCV. Then, install the PiL tool, download the address is: Http://www.pythonware.com/products/pil/,pytesser use requires PIL library support. Then download Pytesser, download the address is: Http://code.google.com/p/pytesser/downloads/list Finally, will pytesser decompression, this is free installation, The extracted files can be cut to the Python installation directory lib\site-packages under the direct use, such as my installation directory is: C:\Python27\Lib\site-packages, but also add this directory to the environment variables . Once you have completed the above steps, you can write a Python script for image text recognition. The reference script is as follows: from Pytesser import *import imageenhance image =image.open (' D:\\xiehao\\workspace\\python\\5.png ') # Use Imageenhance to enhance the image recognition rate enhancer = imageenhance.contrast (image) Image_enhancer = enhancer.enhance (4) Print Image_to_ String (image_enhancer)

Pytesser Image text recognition

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.