• Stars
    star
    178
  • Rank 214,989 (Top 5 %)
  • Language
    Python
  • Created over 12 years ago
  • Updated about 7 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Python wrapper for the tesseract OCR engine. The module is based on OpenCV

Pytesser

Python wrapper for the tesseract OCR engine. The module is based on OpenCV.

Informations

There is already multiples tesseract python modules, but none of them satisfied me. This one is different on the following point:

  • All the classes are put in the same file and all inessential class are removed
  • Use OpenCV instead of PIL (to really an advantage because PIL as far more widespread, but better fit my needs ;))
  • Use subprocess.communicate instead of subprocess.wait to avoid any output in the shell or in the programs that use the module.
  • Management of the differents languages via the option '-l' because the original pytesser use the default language which is english. By this way the detection of french for instance is totally inacurrate.
  • Management of of the pagesegmode, which allow to modify the behavior of tesseract if we want for instance to detect only one character, a word or a line.
  • The code is far more straightforward (my opinion)

Installation

sudo apt-get install tesseract tesseract-ocr-all
sudo pip install opencv-python

How to use it ?

There is to ways to use it. Either you give it a filename, either directly an image. For a filename you can do:

import pytesser
txt = pytesser.image_file_to_string("myimage.jpg")
#By default language is eng, and page seg mode auto

#To give specifify parameters:
txt = pytesser.image_to_string("myimage.jpg","fra",pytesser.PSM_SINGLE_WORD) #Analyse image as a single french word

Or you can directly give it an OpenCV image like this:

image = cv2.imread("myimage.jpg")
txt = pytesser.image_to_string(image) 

More Repositories

1

LSB-Steganography

Python program to steganography files into images using the Least Significant Bit.
Python
879
star
2

Motion-detection-OpenCV

Python/OpenCV script that detect motion on webcam and allow record it to a file
Python
256
star
3

idasec

IDA plugin for reverse-engineering and dynamic interactions with the Binsec platform
Python
115
star
4

pydes

Basic but pure DES implementation in Python
Python
67
star
5

pyADS

Python module to manipulate NTFS Alternate Data Stream (ADS) in Python
Python
55
star
6

Captcha-basic-recognition

Python module that intent to crack basic captcha engines using OpenCV and Pytesser
Python
39
star
7

OpenCV-tutorials

Contain the hole source code of my OpenCV tutorial
Python
33
star
8

pystack

Pystack, is a python framework that allow to create small TCP/IP stacks in an easy manner in order to obtain a wanted behavior.
Python
27
star
9

checksec

Bash script to test executable properties like (PIE, RELRO, PaX, Canaries, ASLR). (Version derivated from the original one trapkit.de/tools/checksec.html
Shell
20
star
10

Python-programs

Contains various python programs and proof of concept.
Python
10
star
11

pytts

Text-To-Speech multi-platform in python. It uses Google translate as engine.
Python
8
star
12

breach_compilation_utils

BreachCompilation utils for iterating logins and passwords
Python
5
star
13

lsbbrute

Script to bruteforce the LSB of an image to find file signatures (in every channel permutation, rotation etc..)
Python
5
star
14

pydimacs

Python module to manipulate CNF DIMACS formulas (using z3)
Python
4
star
15

LyricsTagger

Python program, that automaticaly tag lyrics in MP3 files.
Python
3
star
16

Cryptoid

ryptoid is a toy app to apply weak ciphers on plain text. (Mostly developped to learn how to develop an app).
Java
2
star
17

RobinDavid.github.io

My Github pages
HTML
2
star
18

Python-samples

Contains few python scripts for everything and nothing
Python
2
star
19

Bash-network-game

This project is a fully working 2 player network game written in bash. It intents to show the possibilities of bash which is not a simple script program.
Shell
2
star
20

RobinDavid

1
star
21

codeql-uboot

CodeQL
1
star