- 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
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.
$ tesseract tesseract_inputs/example_01.png stdout
This should output Testing Tesseract OCR
$ tesseract tesseract_inputs/example_02.png stdout
This should output PyImageSearch
$ tesseract tesseract_inputs/example_03.png stdout
This should output 650 3428
The results will be printed to the terminal.
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 |
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 |
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. |