Skip to main content

Extract your Arcaea play result from screenshot.

Project description

Arcaea Offline OCR

Example

import cv2
from arcaea_offline_ocr.device.ocr import DeviceOcr
from arcaea_offline_ocr.device.rois.definition import DeviceRoisAutoT2
from arcaea_offline_ocr.device.rois.extractor import DeviceRoisExtractor
from arcaea_offline_ocr.device.rois.masker import DeviceRoisMaskerAutoT2
from arcaea_offline_ocr.phash_db import ImagePhashDatabase

img_path = "/path/to/opencv/supported/image/formats.jpg"
img = cv2.imread(img_path, cv2.IMREAD_COLOR)

rois = DeviceRoisAutoT2(img.shape[1], img.shape[0])
extractor = DeviceRoisExtractor(img, rois)
masker = DeviceRoisMaskerAutoT2()

knn_model = cv2.ml.KNearest.load("/path/to/trained/knn/model.dat")
phash_db = ImagePhashDatabase("/path/to/image/phash/database.db")

ocr = DeviceOcr(extractor, masker, knn_model, phash_db)
print(ocr.ocr())
$ python example.py
DeviceOcrResult(rating_class=2, pure=1135, far=11, lost=0, score=9953016, max_recall=1146, song_id='ringedgenesis', song_id_possibility=0.953125, clear_status=2, partner_id='45', partner_id_possibility=0.8046875)

Credits

283375/image-phash-database

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

arcaea-offline-ocr-0.0.96.tar.gz (14.2 kB view details)

Uploaded Source

Built Distribution

arcaea_offline_ocr-0.0.96-py3-none-any.whl (19.4 kB view details)

Uploaded Python 3

File details

Details for the file arcaea-offline-ocr-0.0.96.tar.gz.

File metadata

  • Download URL: arcaea-offline-ocr-0.0.96.tar.gz
  • Upload date:
  • Size: 14.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.5

File hashes

Hashes for arcaea-offline-ocr-0.0.96.tar.gz
Algorithm Hash digest
SHA256 46f2106a69911eaaa64efe7aebe8834eaccf8d8a42602c629475e0de4555c140
MD5 dd6a3a42d7013b1a7bfc614e6bd855f0
BLAKE2b-256 a8b43225fff21b1650ffdebf60ad159de8aaf19cdddaee1fb6c0cca4f1c4ed1f

See more details on using hashes here.

File details

Details for the file arcaea_offline_ocr-0.0.96-py3-none-any.whl.

File metadata

File hashes

Hashes for arcaea_offline_ocr-0.0.96-py3-none-any.whl
Algorithm Hash digest
SHA256 a0e52d0fd99b641ec82b9488ceb6e8f1f15c4e7e98ae76403a6fc92a1a55d7f8
MD5 9cb80d1501d575be79dc9a622dca5ad9
BLAKE2b-256 c355888516a2221fcd71b93b72a200a389ce560e642298bd733a9d5d207410be

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