[RELEASE] OCR - Tesseract trainedata for attackspeed

06/26/2020 17:29 Interløgy#1
Hello,

Here is a small release for people who want to make an external lol script.

SpaceGlider uses a screenshot to read the attack speed.
A machine can not read out numbers from a picture. Therefore Tesseract was used, because this is probably the best open source OCR.

The advantage of the training data of SpaceGlider is:
- Size of the HUD doesn't matter
- Very high accuracy
- Much faster (about 60 ms faster)


I initialized it like this:
Code:
instance = new Tesseract();
instance.setTessVariable("user_defined_dpi", "1000");
instance.setTessVariable("tessedit_char_whitelist", "0123456789.");
instance.setDatapath("./tessdata");
instance.setLanguage("LoL");
Meanwhile there is an API to read out the attack speed.
But nobody knows if it will stay forever, because this API is quite abused.

Credits to trickory#0616, who trained the font for Tesseract. <3

[Only registered and activated users can see links. Click Here To Register...]
06/27/2020 03:53 aman2424#2
How to use?
06/27/2020 11:17 f00lish#3
Using tesseract alone in your script will be very slow as it requires many steps to be taken for each iteration. Especially when you have a potato pc.

I would recommend it for experimental use only.


Quote:
Originally Posted by aman2424 View Post
How to use?

It's a language file designed for the league of legends font style.
06/27/2020 20:40 Interløgy#4
Quote:
Originally Posted by f00lish View Post
Using tesseract alone in your script will be very slow as it requires many steps to be taken for each iteration. Especially when you have a potato pc.

I would recommend it for experimental use only.





It's a language file designed for the league of legends font style.
It takes 10ms to 15ms to read out the attack speed (Instead of 60-100ms)
So it could be used for attackspeed easy without Autoattack-Cancel.


Quote:
Originally Posted by aman2424 View Post
How to use?
Which programming language you´re using?
Just look for a tutorial how to use Tesseract.

When initializing the instance of Tesseract, you must specify my trainedata.

I initialized it like this:
Code:
instance = new Tesseract();
instance.setTessVariable("user_defined_dpi", "1000");
instance.setTessVariable("tessedit_char_whitelist", "0123456789.");
instance.setDatapath("./tessdata");
instance.setLanguage("LoL");
I've also prepared the picture a bit:
(May you should not overwrite the parameter like i did)
Code:
public BufferedImage improveQuality(BufferedImage subimage) {
    subimage = ImageHelper.convertImageToGrayscale(subimage);
    subimage = ImageHelper.invertImageColor(subimage);
    subimage = ImageHelper.getScaledInstance(subimage, subimage.getWidth() * 3, subimage.getHeight() * 3);
    return subimage;
}
06/29/2020 03:19 LeagueAddons#5
Nice release!
Thank you for this ^^
06/29/2020 14:44 moechenten#6
but How can that helps with the attack cast time ?
06/29/2020 23:45 kaioken1#7
Interesting, thanks will be useful to play around with.
07/01/2020 00:09 Interløgy#8
Quote:
Originally Posted by moechenten View Post
but How can that helps with the attack cast time ?
If you make an external Orbwalker, this file will help you to make your tesseract more accurate and faster.