Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Low accuray recognizing battle id #19

Closed
yztxwd opened this issue Feb 25, 2020 · 1 comment
Closed

Low accuray recognizing battle id #19

yztxwd opened this issue Feb 25, 2020 · 1 comment
Labels
enhancement New feature or request

Comments

@yztxwd
Copy link

yztxwd commented Feb 25, 2020

First, great project, thanks!
But I found some problems when using automatic battle, the source of these problems are usually caused by failure to interpret battle id, and I tried adding grayscale/binary conversion to solve the problem, now it works well.

for core.util get_battle_id function:
Replace

    text = image_to_string(
        region, config='--psm 7 --oem 3 -c tessedit_char_whitelist=/1234')

to

    THRESHOLD = 200
    BINARY_TABLE=[0 if i < THRESHOLD else 1 for i in range(256)]
    text = image_to_string(
        region.convert('L').point(BINARY_TABLE, '1'), config='--psm 7 --oem 3 -c tessedit_char_whitelist=/1234')
@Meowcolm024
Copy link
Owner

Meowcolm024 commented Feb 25, 2020

Great, thanks a lot.
I would fix it , but I can't test it right now... maybe future testing is required.
Besides, feel free to enhance these features and raising pull requests :)

Meowcolm024 added a commit that referenced this issue Feb 25, 2020
@Meowcolm024 Meowcolm024 added the enhancement New feature or request label Feb 25, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants