Jump to content

Working OCR - Thoughts?


Alek

Recommended Posts

I've always wanted a way to collect data visually and although this approach is impractical for many applications, there are a few advantages in having optical character recognition. Below is a short demonstration video in scanning the screen for the character 'E'.

 

https://www.youtube.com/watch?v=itYcXz5603w

 

This is my first time ever trying to make an OCR type of system and I am pretty clueless to what algorithms already exist. Searching a canvas for a single character alone consumes a ton of resources and ensuring that my search is optimized is very important. 

 

When developing the OCR search, I initially came up with something I called the ink blot. The ink blot would search pixel by pixel and try to create a shape based on the color of pixels which surround it. This shape would then be compared against the character which I was searching for and determined if they had identical points. The problem was clear, after about 500 pixels (I was searching over 250k pixels), creating shapes for each pixel point was too resource intensive.

 

The second search method which I created is something I'll refer to as the typewriter. The character which I'm looking for is essentially stamped at each position and checked to see if the colors at that stamp match the points of my character. This means the character 'E' was checked quickly over a few thousands times at varying positions on the screen. 

 

        ocr.setBot(getBot());
        if (ocr.getBot() != null) {
            OC character = ocr.findChar('E');
            if (character != null) {
                System.out.println("Found character at: " + character.getX() + "," + character.getY());
            } else {
                System.out.println("The character was not found!");
            }
        } else {
            System.out.println("The OCR bot is null");
        }

This was a fun project which took me a little under 3 hours to complete, so searching for full words and other features from a fully developed OCR system is not apparent.

 

With this said, would any script developers or botters find use from something like this? 

  • Like 5
Link to comment
Share on other sites

I've always wanted a way to collect data visually and although this approach is impractical for many applications, there are a few advantages in having optical character recognition. Below is a short demonstration video in scanning the screen for the character 'E'.

 

https://www.youtube.com/watch?v=itYcXz5603w

 

This is my first time ever trying to make an OCR type of system and I am pretty clueless to what algorithms already exist. Searching a canvas for a single character alone consumes a ton of resources and ensuring that my search is optimized is very important. 

 

When developing the OCR search, I initially came up with something I called the ink blot. The ink blot would search pixel by pixel and try to create a shape based on the color of pixels which surround it. This shape would then be compared against the character which I was searching for and determined if they had identical points. The problem was clear, after about 500 pixels (I was searching over 250k pixels), creating shapes for each pixel point was too resource intensive.

 

The second search method which I created is something I'll refer to as the typewriter. The character which I'm looking for is essentially stamped at each position and checked to see if the colors at that stamp match the points of my character. This means the character 'E' was checked quickly over a few thousands times at varying positions on the screen. 

 

        ocr.setBot(getBot());
        if (ocr.getBot() != null) {
            OC character = ocr.findChar('E');
            if (character != null) {
                System.out.println("Found character at: " + character.getX() + "," + character.getY());
            } else {
                System.out.println("The character was not found!");
            }
        } else {
            System.out.println("The OCR bot is null");
        }

This was a fun project which took me a little under 3 hours to complete, so searching for full words and other features from a fully developed OCR system is not apparent.

 

With this said, would any script developers or botters find use from something like this? 

 

 

In what way did you ultimately decide to compare the pixles? I am somewhat familiar with letter recognition using linear algebra. You can compare two vectors and finding the difference determine what character you are currently examining, or not examining. I have never really thought to do this with a bot client, but you kind of sparked an interest, maybe I will do it for fun once I have some time. :p

Just get 5 pixel and check if they are the same color = Finish.

 

 

This would be the worst character recognition system to date.

Link to comment
Share on other sites

do you not response code m9s

 

https://rswiki.moparisthebest.com/index.php?title=317_Protocol#Response_Codes

 

just 1 byte

 

for system update theres a tiny packet which i'm sure isnt difficult to identify tongue.png

 

Ontopic: GJ on ocr man, i remember talking about it XD

Edited by Czar
Link to comment
Share on other sites

But for checking if you are banned it works perfect.

but there's already a method that tells us if the player has been banned or if there's an update

and more. Not exactly sure what method it is.

It's a method within either the bot or client class it returns an int and depending on the int is what is happening

Edited by josedpay
  • Like 1
Link to comment
Share on other sites

Yeah, sometimes simple OCR is very good, if bot have'nt some API for example, and need identify text or object on screen. But, algorithm chosen depends on task needed to solve. In botting, usually can do pixel-based search of specific color key pixel(s), then test possible candidate areas more precisely. It gives high performance.

  • Like 1
Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...