Code Monkey home page Code Monkey logo

image-to-text-converter's Introduction

Image to text converter in Python

Setup

Install python and tesseract

sudo apt install python python-dev python3.6 python3.6-dev python-tk protobuf-compiler
sudo apt install python-pip python3-pip 
sudo apt-get install tesseract-*

Upgrade setuptools

pip3 install --upgrade setuptools

Install the dependencies

pip3 install pytesseract
pip3 install tesseract
pip3 install pillow

Language

To find your needed language make sure to look here https://github.com/tesseract-ocr/tesseract/wiki/Data-Files

Tips on improving the output

  • remove noise and useless information
  • increase contract
  • choose the right size
  • get the best possible image quality
  • higher text quality (bigger DPI like 1200 DPI)

Usage

Download the app

wget https://raw.githubusercontent.com/BeanGreen247/Image-to-text-converter/master/imagetotextconversion.py

Launch the app

python3.6 imagetotextconversion.py

It will ask for the image file location so make sure to give the full path like shown

Type full path to image you want to convert to text:/home/beangreen247/Pictures/text1.png

Next it will ask for the language used in the document

Type the language of the scanned document (3 letter ID):eng

And lastly it will ask for the output file name

Type output file name:text1-output

The files name will be, in my case, text1-output-eng.txt

Hope you like it.

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.