OCR(Optical Character Recognition) + Flask.

JUDE EZEH
3 min readJul 25, 2022

--

Introduction

Optical character recognition, also known as OCR, recognizes text within digital images. It is generally used to identify text in scanned documents and images. Also, OCR can be used as a physical paper document or an image into an accessible electronic version with text.

credit: Toward datascience

What is Flask?

Flask is a small lightweight python web framework that provides useful tools and features that make creating a web application in python easier. It gives developers flexibility and more accessibility to new developers since you can build a web application quickly only on a single python file.

Hence, the major use of flask is to develop web applications in python, implemented on werkzeug and jinja. One of the major advantages of flask is a fast debugger and an inbuilt server.

Overview of the project.

This project focuses on deploying the tesseract OCR model on the flask web framework for character recognition.

What is Tesseract OCR?

Tesseract is an optical character recognition engine for various operating systems. It is open-source software under the Apache license. Originally developed by Hewlett-Packard as proprietary software in the 1980s, it was released as an open source in 2005 and development has been sponsored by Google since 2006.

The web application was built using HTML, CSS, and Javascript. The HTML files are saved in a template folder, whereas the Javascript and CSS files are saved in the static folder.

The code snippet above shows the deployment of the tesseract OCR model deployment to the flask python framework.

Test Image

Output:

An image file with the text “<Hello World>” was sent to the OCR model, and the OCR model returns the text in form of a string.

Conclusion

In conclusion, Optical character recognition software has been used by many sectors such as banks to scan documents and signatures, postal services, and schools to help scan through a large number of files such as image files, pdf documents, and tiff files.

References

You can check on the link below to learn about the history and operation of optical character recognition.

Link to GitHub repository:

Thanks for reading! if you like the article make sure to connect with me on Linkedin, follow me on Medium, and follow Zummit Africa on Linkedin to stay updated with new articles and AI technology.

--

--