Skip to main content

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

ocrscreen-0.0.4.tar.gz (135.7 kB view details)

Uploaded Source

Built Distributions

ocrscreen-0.0.4-cp311-cp311-win_amd64.whl (83.3 kB view details)

Uploaded CPython 3.11 Windows x86-64

ocrscreen-0.0.4-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl (556.4 kB view details)

Uploaded CPython 3.11 manylinux: glibc 2.17+ x86-64 manylinux: glibc 2.28+ x86-64

ocrscreen-0.0.4-cp310-cp310-win_amd64.whl (84.1 kB view details)

Uploaded CPython 3.10 Windows x86-64

ocrscreen-0.0.4-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl (528.2 kB view details)

Uploaded CPython 3.10 manylinux: glibc 2.17+ x86-64 manylinux: glibc 2.28+ x86-64

ocrscreen-0.0.4-cp39-cp39-win_amd64.whl (95.5 kB view details)

Uploaded CPython 3.9 Windows x86-64

ocrscreen-0.0.4-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl (537.3 kB view details)

Uploaded CPython 3.9 manylinux: glibc 2.17+ x86-64 manylinux: glibc 2.28+ x86-64

File details

Details for the file ocrscreen-0.0.4.tar.gz.

File metadata

  • Download URL: ocrscreen-0.0.4.tar.gz
  • Upload date:
  • Size: 135.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.1

File hashes

Hashes for ocrscreen-0.0.4.tar.gz
Algorithm Hash digest
SHA256 fd3db44074dd78aaa50733968862fdc5dba67955f589b31fba0ffb4e85b28e2d
MD5 16dffc2624021825ab35101543e6b2f7
BLAKE2b-256 cc472619b737dbce2cb369353e1ef34a571be895eebb3b01d4a40341815d9478

See more details on using hashes here.

File details

Details for the file ocrscreen-0.0.4-cp311-cp311-win_amd64.whl.

File metadata

File hashes

Hashes for ocrscreen-0.0.4-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 ec2516d5c4904c63997e9a76097c8b2e711c5e0c4aa6f4e5d2cfca70c217b87f
MD5 96804297d47d4fd62e01901b19f8840b
BLAKE2b-256 acfd5df9e18506eb7b8e9873efae4b324c9cd3b24d1d1b9c851ff16efa043416

See more details on using hashes here.

File details

Details for the file ocrscreen-0.0.4-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for ocrscreen-0.0.4-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 cec19868f0446d00321668e346e81d408ecd58c915f3190159798490a6b79628
MD5 4ee036a1d77e02c4225a513d6ee5823b
BLAKE2b-256 adaf35954214105e46f56a93f3f50bde18aff361ab5c3d77c94248d8c1a92c68

See more details on using hashes here.

File details

Details for the file ocrscreen-0.0.4-cp310-cp310-win_amd64.whl.

File metadata

File hashes

Hashes for ocrscreen-0.0.4-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 b3103d89c7370d950874cbaf18ebe7621688b7cb39c82debab6e20d8260a1e4c
MD5 a3256c77bccbab3988854e61063d97a4
BLAKE2b-256 b956e2057a670ee3aa90c4630a59d60ec46cd1317eeefd5fade2bb917427d936

See more details on using hashes here.

File details

Details for the file ocrscreen-0.0.4-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for ocrscreen-0.0.4-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 9d574cc6ac63d0b98572841472a7babba11add38d5f1b9d5ac1b6b7f32dc2666
MD5 5619a71b1f68899436d4451ac3db7a40
BLAKE2b-256 4ac6d5ed7c64f00c8a0b97737066845a22ac7bf5561347d59f8d2a6230571ee6

See more details on using hashes here.

File details

Details for the file ocrscreen-0.0.4-cp39-cp39-win_amd64.whl.

File metadata

  • Download URL: ocrscreen-0.0.4-cp39-cp39-win_amd64.whl
  • Upload date:
  • Size: 95.5 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

Hashes for ocrscreen-0.0.4-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 5e4a941b4c9e5e01a3e4afcceef869cc64d26b1a2afc317608ee18f6fe1481d1
MD5 2580781e865cd5074f9052021cb142c1
BLAKE2b-256 3259427bfbe9ca64b6be920d5928e2cf375a4a5e604fea7f3fc306f19f11922c

See more details on using hashes here.

File details

Details for the file ocrscreen-0.0.4-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for ocrscreen-0.0.4-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 4dbd680fe5902aa71b91350bab79e45464b26bd02dba1c4e2b9f566167d7f943
MD5 46719b3fa61070414c37782a92bf6fc7
BLAKE2b-256 b396aecac31a5a35bd868bb0abd1217592398a5e56eb9d3e29d9fd8fca5a5b4c

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page