Paulinakhew / open_cv

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

open_cv

Setup

  • Clone (or download) the repository:
git clone git@github.com:Paulinakhew/open_cv.git
  • Download all the necessary packages:
  • MacOS Users
$ pip3 install -r requirements.txt
$ brew install tesseract
  • Ubuntu Users
$ pip install -r requirements.txt
$ sudo apt-get install tesseract-ocr

Testing Pytesseract on Clean Example Files

The Pytesseract that we are testing below is the one downloaded using homebrew/sudo apt-get install and not the one from pip. The results will be printed to the terminal.

Example 1

Clean Example 1

$ tesseract tesseract_inputs/example_01.png stdout

This should output Testing Tesseract OCR

Example 2

Clean Example 2

$ tesseract tesseract_inputs/example_02.png stdout

This should output PyImageSearch

Example 3

Clean Example 3

$ tesseract tesseract_inputs/example_03.png stdout

This should output 650 3428

Testing Pytesseract on Noisy Example Files

The results will be printed to the terminal.

Noisy Example 1

Tesseract ocr.py file
Run $ tesseract images/example_01.png stdout $ python3 ocr.py --image images/example_01.png
Result Noisyimage
to test
Tesseract OCR
Noisy image
to test
Tesseract OCR

Noisy Example 2

Tesseract ocr.py file
Run $ tesseract images/example_02.png stdout $ python3 ocr.py --image images/example_02.png --preprocess blur
Result _ Tesseract Will
Fail With Noisy
_ Backgrounds —
Tesseract Will
Fail With Noisy
Backgrounds

Noisy Example 3

Tesseract ocr.py file
Run $ tesseract images/example_03.png stdout $ python3 ocr.py --image images/example_03.png
Result In order to make the most of this, you will need to have
alittle bit of programming experience. All examples in this
book are in the Python programming language. Familiarity
with Python or other scripting languages is suggested, but
not required.

You'll also need to know some basic mathematics. This
book is hands-on and example driven: lots of examples and
lots of code, so even if your math skills are not up to par,
do not worry! The examples are very detailed and heavily
documented to help you follow along.
In order to make the most of this, you will need to have
alittle bit of programming experience. All examples in this
book are in the Python programming language. Familiarity
with Python or other scripting languages is suggested, but
not required.

You'll also need to know some basic mathematics. This
book is hands-on and example driven: lots of examples and
lots of code, so even if your math skills are not up to par,
do not worry! The examples are very detailed and heavily
documented to help you follow along.

About


Languages

Language:Python 100.0%