A Simple Guide to Python Extract Text from Images with Tesseract-OCR – Python Tutorial

By | September 10, 2019

Tesseract-OCR is an open source application, which can help us to extract text from images. In this tutorial, we will introduce how to use Tesseract-OCR to extract text from images using python. You can lean how to do by following our tutorial.

python Extract Text from Images

Preliminary

You should install tesseract ocr firstly, you can read this tutorial to learn how to install.

A Beginner Guide to Use Tesseract OCR to Extract Text From Images on Windows 10 – Tesseract OCR Tutorial

Install pytesseract

pip install pytesseract

Import library

from  PIL import  Image
import pytesseract

Extract text from images

text=pytesseract.image_to_string(Image.open(img_path))
 
print(text)

If you have encountered pytesseract.pytesseract.TesseractNotFoundError, you can refer to this tutorial to learn how to fix.

Fix pytesseract.pytesseract.TesseractNotFoundError for Beginners – Python Tutorial

Leave a Reply

Your email address will not be published. Required fields are marked *