Giter VIP home page Giter VIP logo

image-processor-for-text-extraction's Introduction

Image-Processor-For-Text-Extraction

Aim : The Aim of the project is to develop a image processor whose output could be used by neural networks for text extraction from the input image.
Input : Image with single black text paragraph on white background as shown in sample
Output : Bounding rectange of each charactor in the input. But for representation purpose the output is an binary image with every charactor highlighted by enclosing it in a white rectangle.

Pre-requisites :
Modules - cv2, numpy and sys (you can download these using pip)
Python - Basic syntax, functions :str(), len(), range(), sum() (you can read about these functions here) and handling command line arguments in python.
OpenCV - imread(), dilate(), findContours(), contourArea(), Canny(), adaptiveThreshold(), erode(), bitwise_and(), minAreaRect(), getRotationMatrix2D(), warpAffine(), rectangle(), resize(), imwrite(), waitKey() and destroyAllWindows() (you can read about these functions here)
Numpy - ones(), where(), column_stack() (you can read about these functions here)

Brief algorithm:
1)Read the input image in Grayscale format.
2)Converted the image to binary format.
3)Cropped the image to minimize non-text region.
4)Removed any tilt from the text.
5)Determined the y-indices of the top and the bottom of each line of text (line segmentation).
6)In each line determined the x-indices of the beginning and the end of each charactor (charactor segmentation).
7)The bounding rectangle of each charactor is found by its x-indices and the y-indices of the line containing the charactor.
(for complete working of the project you can refer to docs)

Result - The bounding rectangle of a each charactor could be fed to a neural network to covert the charctor from optical to text format.

image-processor-for-text-extraction's People

Contributors

manthanchauhan avatar

Stargazers

 avatar  avatar

Watchers

 avatar  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.