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.5.tar.gz (136.9 kB view details)

Uploaded Source

Built Distributions

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

Uploaded CPython 3.11 Windows x86-64

ocrscreen-0.0.5-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.5-cp310-cp310-win_amd64.whl (84.1 kB view details)

Uploaded CPython 3.10 Windows x86-64

ocrscreen-0.0.5-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.5-cp39-cp39-win_amd64.whl (95.5 kB view details)

Uploaded CPython 3.9 Windows x86-64

ocrscreen-0.0.5-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.5.tar.gz.

File metadata

  • Download URL: ocrscreen-0.0.5.tar.gz
  • Upload date:
  • Size: 136.9 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.5.tar.gz
Algorithm Hash digest
SHA256 370a88b8d8b99c2f99bf2fe4d1051280988652b47cec4a8e227a094c9c75b65e
MD5 2ab0fd02567aa9e5edfd99e4affa77a8
BLAKE2b-256 11960650fd4f2b27d5e3074eceee8d3cdf1091beeca6ba76519c937bcbf0f83a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ocrscreen-0.0.5-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 a8425397417ce50b8fef391834fb878617db1df4766b2359d3de09a91751e1ad
MD5 9014b070b3c41e2724cca0756e750b9f
BLAKE2b-256 0ac8b96d497d92fd731e0ae9ce83ce13f1e483befd8eaa2c0346b919d5552227

See more details on using hashes here.

File details

Details for the file ocrscreen-0.0.5-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.5-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 0210b9bf25ee0135660c97c6e341dc8d2eab6005dffd51c392e9ff2ff7b07901
MD5 206e7315ba11b57d02d07076638389ea
BLAKE2b-256 1a4f18410979597228446b4d03928ea47ebd6a7f9cfce9ba1cce4ceb057ecb51

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ocrscreen-0.0.5-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 660b322a39e7c6fdcd7fef74a6f7c553541731c91e616b261af6d90a43e34db7
MD5 3f2cb76f13053ebff54fa4f9f018c6b6
BLAKE2b-256 5a77ea3ce3e3bcfa57503f3e3fe37fb12fcf7ea1c4ffd3dbb12b3c7cc4becd6a

See more details on using hashes here.

File details

Details for the file ocrscreen-0.0.5-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.5-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 4303e70e35dcc6972e0a3faaef2c557fb59755669f60c4761f07c50cc246b6e1
MD5 8b0aaafcd679a3fc5b2893b7345db8ae
BLAKE2b-256 8f7ce99165ce418c398a19ea5dd234c0ca74a8d6cfba9d581d634c7ef74d441d

See more details on using hashes here.

File details

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

File metadata

  • Download URL: ocrscreen-0.0.5-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.5-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 3b748763abf6d54fc2d19dff5b07a73d2997387ffa5cf783cc765834f9a3bd8f
MD5 955e0116985e97902e94d036cb5b1ccc
BLAKE2b-256 4693b5186bc4583b56f18c5867b0c04c5fdbac8879ac1d28957f1986b0b97418

See more details on using hashes here.

File details

Details for the file ocrscreen-0.0.5-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.5-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 ef6dc00bbc4db51cac266d259527df39a5e8a4d5c6097659f09155333094f4a0
MD5 f66bb0d565835f24c73feee2046cf320
BLAKE2b-256 db1b5b7cd3cb31c1f55716a32ac67a0736adbde40ee2f5af10a9cf065c79c872

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