ocr for recognizing text on computer screen
Project description
# ocrscreen
ocr for recognizing text on computer screen
## Install ` pip install ocrscreen `
## Use
To create recognition database you need to create few (tens to hundreds) training samples in form of file pairs: png image file containing image of one line of text, and text file containing same line of text. Image and text should have same name except extension: .png for image and .gt.txt for text. Each character you want to recognize should be present in at least three samples.
If you have samples you can convert it into database with this command:
` ocrscreen-learn path/to/samples -o path/to/database `
Recognintion database is a list of directories, each directory contains .png files (one or many) representing character and .id file with text containing character (to avoid filesystem limitations). Directory name and file name does not matter. This form allows easy tuning and troubleshooting recognition problems.
When you have database you can run ocr on image
` ocrscreen-recognize -d path/to/database -i path/to/image `
or on screen ` ocrscreen-recognize -d path/to/database --screen `
or on portion of screen with –rect x y w h
` ocrscreen-recognize -d path/to/database --screen --rect 10 10 640 480 `
Inspect samples and database directory in the sources to get better understanding of data format.
## Notes
This ocr uses black and white bitmaps as search pattern to search on binarized image and only perfect equality counts as match. It doesn’t use dpi and neural networks, it cannot recognize scanned text or text in photo images, it is only for recognizing perfect digital text.
If you have linux and wayland you need to install pyscreenshot package. ` pip install pyscreenshot `
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
File details
Details for the file ocrscreen-0.0.3.tar.gz
.
File metadata
- Download URL: ocrscreen-0.0.3.tar.gz
- Upload date:
- Size: 10.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | da07c9041fe74740e8a166597becda7730fbe1c633875573c17bef228bb09580 |
|
MD5 | c100a1483aea2240cb564ec2b08b520d |
|
BLAKE2b-256 | 71df3d7713b7bbf72a1c71bfc29fececb3d3f364c74aa45dbd4638304f77512c |
File details
Details for the file ocrscreen-0.0.3-cp311-cp311-win_amd64.whl
.
File metadata
- Download URL: ocrscreen-0.0.3-cp311-cp311-win_amd64.whl
- Upload date:
- Size: 83.3 kB
- Tags: CPython 3.11, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f3ff350485b42b072e595662d8e5753c6c7c0885918a75ee08702e6b5fa062d8 |
|
MD5 | 5e5391ddd935d0e8fc4c365078d2a39e |
|
BLAKE2b-256 | 7bab4584077c59ac0d61913e4a33680251df11a8a28630bde701f768276c7b05 |
File details
Details for the file ocrscreen-0.0.3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl
.
File metadata
- Download URL: ocrscreen-0.0.3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl
- Upload date:
- Size: 556.4 kB
- Tags: CPython 3.11, manylinux: glibc 2.17+ x86-64, manylinux: glibc 2.28+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 26072391a756245a36b012dfdc7eb53d68ecb44d6efde81793de0e139afe01bf |
|
MD5 | 1923f5d8c3af1d9eb79b1a21c603c905 |
|
BLAKE2b-256 | c23d726b3d43be408dc914ec35abefa03c07128823b45ab7025c9fb1ea4035f6 |
File details
Details for the file ocrscreen-0.0.3-cp310-cp310-win_amd64.whl
.
File metadata
- Download URL: ocrscreen-0.0.3-cp310-cp310-win_amd64.whl
- Upload date:
- Size: 84.1 kB
- Tags: CPython 3.10, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 09258f1a85a3ea134e89792f3cfff5a94b74f95ab5f3c21f28704f06059c0ee2 |
|
MD5 | ea5a00e554122c44e7b9e8b9a440ae08 |
|
BLAKE2b-256 | fe98e58b7ab823d40ebc641433afd417633f2d17054cfcd4cb7abb1b7af0d0c0 |
File details
Details for the file ocrscreen-0.0.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl
.
File metadata
- Download URL: ocrscreen-0.0.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl
- Upload date:
- Size: 528.3 kB
- Tags: CPython 3.10, manylinux: glibc 2.17+ x86-64, manylinux: glibc 2.28+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f3e3e6a8e5fe2d381b1f758a2f7453985606d11f020f932c22df9ba4e4b7db40 |
|
MD5 | 4323bf24440b06f644c29bc02ae35337 |
|
BLAKE2b-256 | 6d7aa1426f6c709b34c84e38e2bd5e50c330190cda04266feb0ffbb034d54e68 |
File details
Details for the file ocrscreen-0.0.3-cp39-cp39-win_amd64.whl
.
File metadata
- Download URL: ocrscreen-0.0.3-cp39-cp39-win_amd64.whl
- Upload date:
- Size: 95.6 kB
- Tags: CPython 3.9, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.13
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b3c75fec76902dc8335ad38574e270256ae9b5f469f57f6346edd8dc33781bab |
|
MD5 | 187aada1516ca31eac7d6213b6312d1e |
|
BLAKE2b-256 | a3ca6af58f7e31104333d5029c5d1038bedab8d890777b1338b35a6a17f378ba |
File details
Details for the file ocrscreen-0.0.3-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl
.
File metadata
- Download URL: ocrscreen-0.0.3-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl
- Upload date:
- Size: 537.3 kB
- Tags: CPython 3.9, manylinux: glibc 2.17+ x86-64, manylinux: glibc 2.28+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a1812f5b50258c0bce802495c19e803d16933a14ea311fd49a69c688cc819a8b |
|
MD5 | 7dc91675ebc5a74169ae6ea2558612fc |
|
BLAKE2b-256 | b98cc11f9505853f3083c77c284650bc3119751d97340909897d007640d87c16 |