Jump to content

Recommended Posts

Posted

I am working on my OCR script.

my method currently employed the baseline concept,

the first point is input and then it counts a few pixels up.

this will get the string.

Func    ocr_string( $first_point, $width_to_check)
    Local $string
    Local $x_offset = 0
    Local $y_offset = 0
    Local $box = 0
    
    Do
        Do

        
        ;MouseMove ( ($first_point[0] + $x_offset) , ($first_point[1] + $y_offset  ) )
        
        $color_ocr_sample = PixelGetColor ( ($first_point[0] + $x_offset) , ($first_point[1] + $y_offset  ) )
        
        $red   =  _ColorGetRed($color_ocr_sample)
        $green =  _ColorGetGreen($color_ocr_sample)
        $blue  =  _ColorGetBlue($color_ocr_sample)
            
            If $green > $red AND $green > $blue Then
                $box = $box + 1
                EndIf

            $y_offset = $y_offset - 1
        Until $y_offset = -10
            
            
            
        $y_offset = 0
        $string = $string & $box
        $x_offset = $x_offset + 1
        $box = 0
            
    Until $x_offset = $width_to_check          

    Return $string
EndFuncoÝ÷ ٩ݶ§¶¬Â)e¶¼­¢f­ray×x­ÚºÚ"µÍ[ÈÚXÚ×ÙY[][Û ÌÍÜÝ[È
BBNÒY  ÌÍÜÝ[ÈOH   ][ÝÌLLLI][ÝÂU[NÂT] ][ÝËI][ÝÂNÂQ[YNÓÙÐÞ
    ][ÝÙYHHÝ[ÈÉ][ÝË  ÌÍÜÝ[È
BBRY    ÌÍÜÝ[ÈOH   ][ÝÌLLLI][ÝÂU[BT]   ][ÝËI][ÝÂQ[YBRY ÌÍÜÝ[ÈOH   ][ÝÍN
I][ÝÂU[BT]    ][ÝÌ  ][ÝÂQ[YRY ÌÍÜÝ[ÈOH   ][ÝÌI][ÝÂU[BT]  ][ÝÌI][ÝÂBQ[YRY ÌÍÜÝ[ÈOH   ][ÝÌÍM

LÉ][ÝÂU[BT]  ][ÝÌ][ÝÂQ[YRY   ÌÍÜÝ[ÈOH   ][ÝÌÌÎ
I][ÝÂU[BT]    ][ÝÌÉ][ÝÂBQ[YRY    ÌÍÜÝ[ÈOH   ][ÝÌÎI][ÝÂU[BT]    ][ÝÍ  ][ÝÂQ[YRY ÌÍÜÝ[ÈOH   ][ÝÌMLÍ  ][ÝÂU[BT] ][ÝÍI][ÝÂBQ[YRY ÌÍÜÝ[ÈOH   ][ÝÍMÍÍÉ][ÝÂU[BT]    ][ÝÍ][ÝÂQ[YRY   ÌÍÜÝ[ÈOH   ][ÝÌLÍMM][ÝÂU[BT]  ][ÝÍÉ][ÝÂBQ[YRY    ÌÍÜÝ[ÈOH   ][ÝÍNÌÎ
I][ÝÂU[BT]    ][ÝΠ ][ÝÂQ[YRY ÌÍÜÝ[ÈOH   ][ÝÌÍÍ
ÍI][ÝÂU[BT]  ][ÝÎI][ÝÂBQ[Y[[

now though, to take it a step further, I need to recognize graphics that may be upside down, or left to right.

the arrow: >

might look like this ^

and it might rotate all over the place, how do we recognize it anyway?

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...