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)
License
This file is part of arcaea-offline-ocr, as called "This program" below.
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see https://www.gnu.org/licenses/.
Credits
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for arcaea-offline-ocr-0.0.98.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 328c7b52b73290fbf3ae2c131baa13762eb2914dd963ae118b943fdfaf31eb73 |
|
MD5 | 94e58e6e8f53dc372233521689731433 |
|
BLAKE2b-256 | 7973f155bb4948c577a30c78ad8007ef0f91818e74493c96fad289c8bb7d5fed |
Hashes for arcaea_offline_ocr-0.0.98-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | da799caef9b3f160bbf22c7f08e3f38978a8d987064f4cab67332c6ac7f22d07 |
|
MD5 | 890f71082818ec3634a4650642e32f6c |
|
BLAKE2b-256 | 181fe7ce8e2f00bec794ba317a99ebeef9ba8b588387390bab65a4297352fd8c |