Text extraction from Images

Text extraction from Images

Overview

  • Optical Character Recognition (OCR) is a widely used system in the computer vision space
  • Application in real world case like pdf scanner and other projects .

Introduction

The days when you had to fill in the dots of the right answer during an exam? The Olympiads and multiple-choice tests where universities and organizations used an Optical Character Recognition (OCR) system to grade the answer sheets in droves.

OCR has applications in a broad range of industries and functions. So, everything from scanning documents – bank statements, receipts, handwritten documents, coupons, etc.,?to reading street signs in autonomous vehicles – this all falls under the OCR .

OCR systems used to be quite expensive and cumbersome to build a couple of decades ago. But advances in the computer vision and deep learning field mean we can build our own OCR system .

For starters, it is filled with problems like different fonts in images, poor contrast, multiple objects in an image, etc.

No alt text provided for this image

Table of Contents

  1. What is Optical Character Recognition (OCR)?
  2. Popular OCR Applications in the Real World
  3. Text Recognition with Tesseract OCR
  4. The Different Ways for Text Detection

What is Optical Character Recognition (OCR)?

OCR, or Optical Character Recognition, is a process of recognizing text inside images and converting it into an electronic form. These images could be of handwritten text, printed text like documents, receipts, name cards, etc., or even a natural scene photograph.


OCR has two parts to it. The first part is?text detection?where the textual part within the image is determined. This localization of text within the image is important for the second part of OCR,?text recognition, where the text is extracted from the image. Using these techniques together is how you can extract text from any image.

No alt text provided for this image

But nothing is perfect and OCR is no exception. With the advent of deep learning, it has become possible to get better and more generalized solutions to this problem.

Let’s take a look at some of the popular applications of OCR.


Popular OCR Applications in the Real World

OCR has widespread applications across industries (primarily with the aim of reducing manual human effort). It has been incorporated in our everyday life to an extent that we hardly ever notice it . But they surely strive to bring a better user experience.

OCR is used for?handwriting recognition tasks?to extract information. A lot of work is going on in this field and we have made some really significant advancements. Microsoft has come up with an awesome?mathematical application?that takes as input a handwritten mathematical equation and generates the solution along with a step-by-step explanation of the working.

OCR is increasingly being used for?digitization?by various industries to cut down manual workload. This makes it very easy and efficient to extract and store information from business documents, receipts, invoices, passports, etc. Also, when you upload your documents for KYC (Know Your Customer), OCR is used to extract information from these documents and store them for future reference.

OCR is also used for?book scanning?where it turns raw images into a digital text format. Many large scale projects like the Gutenberg project, Million Book Project, and Google Books use OCR to scan and digitize books and store the works as an archive.

The banking?industry is also increasingly using OCR to archive client-related paperwork, like onboarding material, to easily create a client repository. This significantly reduces the onboarding time and thereby improves the user experience. Also, banks use OCR to extract information like account number, amount, cheque number from cheques for faster processing.

No alt text provided for this image

The applications of OCR are incomplete without mentioning their use in?self-driving cars. Autonomous cars rely extensively on OCR to read signposts and traffic signs. An effective understanding of these signs makes autonomous cars safe for pedestrians and other vehicles that ply on the roads.

No alt text provided for this image

There are definitely many more applications of OCR like vehicle number plate recognition, converting scanned documents into editable word documents, and many more. I would love to hear your experience of using OCR – let me know in the comments section below.

The digitization using OCR obviously has widespread advantages like easy storage and manipulation of the text, not to mention the unfathomable amount of analytics that you can apply to this data! OCR is definitely one of the most important fields of Computer Vision.

Text Recognition with Tesseract OCR

Tesseract?is an open-source OCR engine originally developed as proprietary software by HP (Hewlett-Packard) but was later made open source in 2005. Google has since then adopted the project and sponsored its development.

No alt text provided for this image

As of today, Tesseract can detect over 100 languages and can process even right-to-left text such as Arabic or Hebrew! No wonder it is used by Google for text detection on mobile devices, in videos, and in Gmail’s image spam detection algorithm.

From version 4 onwards, Google has given a significant boost to this OCR engine. Tesseract 4.0 has added a new OCR engine that uses a neural network system based on?LSTM?(Long Short-term Memory), one of the most effective solutions for sequence prediction problems. Although its previous OCR engine using pattern matching is still available as legacy code.

What are the Challenges with Tesseract?

It’s no secret that Tesseract is not perfect. It performs poorly when the image has a lot of noise or when the font of the language is one on which Tesseract OCR is not trained. Other conditions like brightness or skewness of text will also affect the performance of Tesseract. Nevertheless, it is a good starting point for text recognition with low efforts and high outputs.

?

The Different Ways for Text Detection

Tesseract assumes that the input text image is fairly clean. Unfortunately, many input images will contain a plethora of objects and not just a clean preprocessed text. Therefore, it becomes imperative to have a good text detection system that can detect text which can then be easily extracted.

There are a fair few ways for text detection:

  • Traditional way of using OpenCV
  • Contemporary way of using Deep Learning models, and
  • Building your very own custom model

End Notes

In this article, we covered the problems in OCR and the various approaches that can be used to solve the problem related text extraction .

Thank you ..

要查看或添加评论,请登录

社区洞察

其他会员也浏览了