Jump to content

Recommended Posts

Posted

Hi!

@theguy0000:

I always script with the latest beat cause many good functions are availble which not belong to v3.1.1. So you need to run the script with the AutIt.exe from the folder where your beta-installtion is located.

good luck, peethebee

vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvGerman Forums: http://www.autoit.deGerman Help File: http://autoit.de/hilfe vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv

Posted

Hi!

I would like to port the prject to C or C++ in order to make it much faster and still availible for AutoIt as one of the new plugins. I have many ideas but I'm not able to code C/C++ (I tried it but I didn't get started) :-(. So I would enjoy if someone of you could code it for me.

peethebee

vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvGerman Forums: http://www.autoit.deGerman Help File: http://autoit.de/hilfe vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv

Posted

As you know with AutoIT, usually no one will code things for you =\

Best I can say is look up a few tutorials, and you're on your way :whistle:

"I thoroughly disapprove of duels. If a man should challenge me, I would take him kindly and forgivingly by the hand and lead him to a quiet place and kill him." - Mark TwainPatient: "It hurts when I do $var_"Doctor: "Don't do $var_" - Lar.
  • 1 month later...
Posted

Is any work still going on with this project? I think an OCR script that you could point at any spot on the screen would be awesome! Sort of like the programs kleptomania and others... except they don't work on pictures! Cool script!

Kevin

Posted

Hi!

As I said before I would have to port it to C++ and use the plugin feature in oder to make it work in an acceptable speed, but my C++ skills are not yet good enough.

If you could help, feel free to PM me!

peethebee

vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvGerman Forums: http://www.autoit.deGerman Help File: http://autoit.de/hilfe vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv

  • 2 weeks later...
Posted

peethebee great work and thank you for releasing the source code on your MYOCR script, however there is no comments on your coding and therefore i cant understand the script.

Can you please put some comments in the script and explain to newbies like me how OCR works, i really need this OCR script to work as i am trying to read some text of a GUI.

If you could provide me with some links that show the basics of OCR and how its coded.

I understand most of the coding besides this part:

characters:

[1]

1=0x000000

return=1

2=0x000000,-1,1

3=0x000000,0,1

4=0x000000,-2,2

5=0x000000,0,2

6=0x000000,-3,3

7=0x000000,0,3

8=0x000000,-4,4

9=0x000000,0,4

10=0x000000,0,5

11=0x000000,0,6

12=0x000000,0,7

13=0x000000,0,8

14=0x000000,0,9

15=0x000000,0,10

16=0x000000,0,11

Is that hexedicemal? and how is this defining the chareactors.

I really need a basic OCR that reads 0 - 9 no other text required in currior font.

I am unable to change your source code to accomplish that as i dont understand it.

any help will be greatly appreateted.

Posted

peethebee great work and thank you for releasing the source code on your MYOCR script, however there is no comments on your coding and therefore i cant understand the script.

Can you please put some comments in the script and explain to newbies like me how OCR works, i really need this OCR script to work as i am trying to read some text of a GUI.

If you could provide me with some links that show the basics of OCR and how its coded.

I understand most of the coding besides this part:

characters:

[1]

1=0x000000

return=1

2=0x000000,-1,1

3=0x000000,0,1

4=0x000000,-2,2

5=0x000000,0,2

6=0x000000,-3,3

7=0x000000,0,3

8=0x000000,-4,4

9=0x000000,0,4

10=0x000000,0,5

11=0x000000,0,6

12=0x000000,0,7

13=0x000000,0,8

14=0x000000,0,9

15=0x000000,0,10

16=0x000000,0,11

Is that hexedicemal? and how is this defining the chareactors.

I really need a basic OCR that reads 0 - 9 no other text required in currior font.

I am unable to change your source code to accomplish that as i dont understand it.

any help will be greatly appreateted.

Hi!

I am definately no expert in ORC (look at the speed of the implementation...). There is a quite good port of the OCR concept to C# by "Insolence".

My concept is the following:

1. Scan all pixels for the start color (color format is hex in the rgb format (see help file!))

If the pixel color is the same, scan next pixel. If equal, check next one, if not, Exit the loop and jump to point 1.

Example: "2=0x000000,-1,1" This is the definition for the second pixel. It is 1 pixel left (-1) and one under (1) the starting pixel. If a minus is added before the colour, it means thqat it musn't be of that color.

I hope it helped. If you need more info about OCR in general, please goolge for it or use www.wikipedia.org and do not mind to contact me again, if any problems occur.

peethebee

vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvGerman Forums: http://www.autoit.deGerman Help File: http://autoit.de/hilfe vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv

  • 4 weeks later...
Posted (edited)

It seems good work Peethebee, but is there any chance to scan text like this one what is attached? And if I dont know what is this text...Like random numbers?

Pilt.bmp

Edited by poisonkiller
Posted (edited)

Hi!

This is no problem. The script is exactly designed to scan text you do not know (what should it do else *g*).

You just have to edit the definitions file and add all posible chars.

Some posts ago there is a short explanation on how to do this.

peethebee

Edited by peethebee

vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvGerman Forums: http://www.autoit.deGerman Help File: http://autoit.de/hilfe vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv

Posted (edited)

But if i dont know the number what is on the picture? Your examples need text what is writed on picture... So can you make me example, that if i run example then it searches text and tells me that.... Thanks!

Edited by poisonkiller
Posted

Okey i messed with it a little, and should this code searches text?

#include "myOCR.au3"
SplashImageOn("", "testtext.bmp", 200, 100, -10, -10)
$scan = _scan(@ScriptDir & "\characters.ocr", 0, 0, 200, 100)
$txt = _scan_extract_text($scan)
MsgBox(0, "Text: ", $txt)
SplashOff()

When i run it, then it do nothing and it will not exit too.

Is it not correct?

  • 1 month later...
Posted

I made my version of OCR read your text under 1 seconds :lmao:;)

; Coded by Royal Miah
; ntl_cable_guy @   Ho tmail .c  o  m
; enjoy

while 1
    
$bs = _ocr("61","51","162","71")

MsgBox(0,"Result", $bs,1)
WEnd
Func _OCR($Ax, $Ay, $Dx, $Dy)
    
    $width = $Dx - $Ax
    $length = $Dy - $Ay
    
    Local $char[$width][$length]
    
    For $xwidth = 0 To $width - 1
        For $xlength = 0 To $length - 1
            $char[$xwidth][$xlength] = Hex(PixelGetColor($Ax, $Ay), 6)
            $Ay = $Ay + 1
        Next
        $Ax = $Ax + 1
        $Ay = $Ay - $length
    Next
;scans entire area 
    

    $p = 1
    Local $row[$width]
    For $xwidth = 0 To $width - 1
        
        For $xlength = 0 To $length - 1
            If $char[$xwidth][$xlength] = "000000" Then
                If $p = 1 Then
                    $div = $xwidth
                    $p += 2
                EndIf
                $x = $xwidth - $div
                $row[$x] +=1
                
            EndIf
            
        Next
    Next
;seriales the array
    
    Local $result
    For $xwidth = 0 To $width - 1
        Select
        
        Case $row[$xwidth+0] = "1" And $row[$xwidth+1] = "1" And $row[$xwidth+2] = "1" And $row[$xwidth+3] = "1" And $row[$xwidth+4] = "12" 
        $result &= "1"
    
        Case $row[$xwidth+0] = "5" And $row[$xwidth+1] = "5" And $row[$xwidth+2] = "5" And $row[$xwidth+3] = "3" And $row[$xwidth+4] = "4" And $row[$xwidth+5] = "4" And $row[$xwidth+6] = "4" And $row[$xwidth+7] = "4" And $row[$xwidth+8] = "6" And $row[$xwidth+9] = "6" And $row[$xwidth+10] = "1" And $row[$xwidth+11] = "1" And $row[$xwidth+12] = "2" And $row[$xwidth+13] = "4" 
        $result &= "2"
            
        Case $row[$xwidth+0] = "7" And $row[$xwidth+1] = "6" And $row[$xwidth+2] = "3" And $row[$xwidth+3] = "4" And $row[$xwidth+4] = "4" And $row[$xwidth+5] = "4" And $row[$xwidth+6] = "6" And $row[$xwidth+7] = "6" And $row[$xwidth+8] = "4" And $row[$xwidth+9] = "6" And $row[$xwidth+10] = "11" 
        $result &= "9"
                
        Case $row[$xwidth+0] = "6" And $row[$xwidth+1] = "7" And $row[$xwidth+2] = "3" And $row[$xwidth+3] = "2" And $row[$xwidth+4] = "2" And $row[$xwidth+5] = "2" And $row[$xwidth+6] = "3" And $row[$xwidth+7] = "2" And $row[$xwidth+8] = "2" And $row[$xwidth+9] = "2" And $row[$xwidth+10] = "3" And $row[$xwidth+11] = "8"  
        $result &= "0"

        EndSelect
        
    Next
    
    Return $result

    EndFunc
Posted (edited)

now it's about time to include this script into a bigger program say, for security testing purposes???

Edited by Digetal
  • 1 month later...
Posted

I don't mean to be a pain in the butt, and this is no complaint whatsoever, but is there any chance you could provide a some simple documentation in English. I run a spanish version os and besides a couple of rude words, my german is non existent.

As it turns out, I can't even get the demo of MyOCR to work, since I don't know what send(!azn) is doing. I follow the instruction opening testimage.bmp in Paint... Then I get a msbox with an empty text.

I also downloaded the EasyOcr and got the following error code after running (of course I have no clue what the input boxes are asking for):

>"C:\Program Files\AutoIt3\SciTe\CompileAU3\CompileAU3.exe" /run /beta /ErrorStdOut /in "C:\Documents and Settings\Ivan\Desktop\au3.1.87\EasyOCR_0.5\EasyOCR.au3" /autoit3dir "C:\Program Files\AutoIt3\beta" /UserParams

>Running AU3Check...C:\Program Files\AutoIt3\SciTe\Defs\Unstable\Au3Check\au3check.dat

>AU3Check Ended.

>Running: (3.1.1.113):C:\Program Files\AutoIt3\beta\autoit3.exe "C:\Documents and Settings\Ivan\Desktop\au3.1.87\EasyOCR_0.5\EasyOCR.au3"

C:\Documents and Settings\Ivan\Desktop\au3.1.87\EasyOCR_0.5\EasyOCR.au3 (100) : ==> Array variable subscript badly formatted.:

ReDim $array[$count - 1]

ReDim $array[^ ERROR

>AutoIT3.exe ended.

>Exit code: 0 Time: 150.770

  • 1 year later...
  • 8 months later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

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