Skip to main content

QQOcr

A package used for simple OCR.


Examples are as follows:

For learn:

from qqocr import QQOcr

# You must provide a method to binarize the characters in the picture 
# and import the external library in the function.
def binary(image):
    import numpy as np
    import cv2

    low_range = np.array([0, 0, 0][::-1])
    high_range = np.array([100, 100, 100][::-1])
    return cv2.inRange(image, low_range, high_range)

qq = QQOcr()
# Dataset folder consists of many pictures and a 'label.txt'.
# For 'label.txt', the format of each line is "[filename]\t[text]".
# For example, it can be: "1.png   12345".
qq.load_dataset('./dataset')
qq.set_binary(binary)
qq.learn()
# The suffix must be '.qmodel'.
qq.save_model('./1.qmodel')

For predict:

from qqocr import QQOcr
import cv2

qq = QQOcr()
qq.load_model('./1.qmodel')
text = qq.predict(cv2.imread('test.png'))
print(text)

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

qqocr-0.3.2.tar.gz (4.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

qqocr-0.3.2-py3-none-any.whl (4.4 kB view details)

Uploaded Python 3

File details

Details for the file qqocr-0.3.2.tar.gz.

File metadata

  • Download URL: qqocr-0.3.2.tar.gz
  • Upload date:
  • Size: 4.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.8.8

File hashes

Hashes for qqocr-0.3.2.tar.gz
Algorithm Hash digest
SHA256 da3a613e43d310e553bb655da785dada7e444a4428a0bd0b72a200eb61624314
MD5 3d8dac48c990e6d90bd26e74d006c227
BLAKE2b-256 9bea442856d4db65dedd64c76e6e0b2777f31ab6046aae1560bf5ebd8326da0a

See more details on using hashes here.

File details

Details for the file qqocr-0.3.2-py3-none-any.whl.

File metadata

  • Download URL: qqocr-0.3.2-py3-none-any.whl
  • Upload date:
  • Size: 4.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.8.8

File hashes

Hashes for qqocr-0.3.2-py3-none-any.whl
Algorithm Hash digest
SHA256 a16868fee7654bfb436f492cbb83a6decbd582e944ca6e2b95c4d5d419d99dab
MD5 03f3ffb10a11e291b57bee6aed36e1f4
BLAKE2b-256 b29b2aaf5ca59b8187af7d21162c6407e044cc207e74502ee93911806c0d0302

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.3.2 This release

2 files

0.3.1

2 files

0.3

2 files

0.2

2 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page