Coder Social home page Coder Social logo

vishal1999-33 / detection-and-recognition-of-words Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 1.2 MB

Project on Optical Character Recognition with the help of Tesseract-ocr.

Jupyter Notebook 100.00%
tesseract-ocr word-detection word-recognition pytesseract python ocr-recognition

detection-and-recognition-of-words's Introduction

About

The purpose of this project was to detect and recognize words from the text images. For this purpose Tesseract-ocr was used. The input images and their outputs can be obtained in the ORC Images and Outputs folders.

What is Tesseract-ocr

Tesseract — is an optical character recognition engine with open-source code, this is the most popular and qualitative OCR-library. OCR uses artificial intelligence for text search and its recognition on images. Tesseract is finding templates in pixels, letters, words and sentences. It uses two-step approach that calls adaptive recognition. It requires one data stage for character recognition, then the second stage to fulfil any letters, it wasn’t insured in, by letters that can match the word or sentence context.

To get the installer for Tesseract, click on the following link:-

Install Tesseract

Choose the installer according to your bit system. Once Tesseract in installed, you need to install pytesseract module. For this open the anaconda prompt and give the following command:-

pip install pytesseract

While working on project you may get the following error even if you imported the pytesseract module :-

Screenshot (255)

To solve this problem make sure you run the following commands:-

Screenshot (256)

The input image is processed and observed so as to get the text with highest accuracy. But it is observed that in most of the times the original image gives the maximum accuracy.

Screenshot (257)

Output will be as follow:-

Screenshot (258)

Instructions

Install all the required modules mentioned in the requirement.txt file. Make sure to include the path where you installed Tesseract-ocr. Then read the image with following command:-

Screenshot (259)

Now we can pre-process the input image into different modes. Each mode have special characteristics. They are:-

  1. GrayScale Image:-A grayscale image is simply one in which the only colors are shades of gray. The reason for differentiating such images from any other sort of color image is that less information needs to be provided for each pixel. In fact a gray color is one in which the red, green and blue components all have equal intensity in RGB space.

  2. Thresh Image :- It contains the image which is thresholding techique. Image thresholding is a simple, yet effective, way of partitioning an image into a foreground and background. This image analysis technique is a type of image segmentation that isolates objects by converting grayscale images into binary images.

  3. Opening Image :- Opening removes small objects from the foreground (usually taken as the bright pixels) of an image, placing them in the background, while closing removes small holes in the foreground, changing small islands of background into foreground.

  4. Canny Image :- This image is processed by a technique which extract useful structural information from different vision objects and dramatically reduce the amount of data to be processed.

The output of the image can be obtained with the following command:-

Screenshot (260)

Make sure to make .txt files in the directory you are working on. You can then save the output of the image by editing the .txt file with the help of write function in python. To know more about this function follow the link:-

Python File Handling

detection-and-recognition-of-words's People

Contributors

vishal1999-33 avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.