Sign in to follow this  
Followers 0
cageman

tyring to make an OCR

1 post in this topic

#1 ·  Posted (edited)

i got the code below, but it gives me alot of errors. How can i make a for loop that gives me different $slot variables? and how should i pass the $slot to the item function

with the two for loops in the item function im trying to get a area of 10x5 pixels and compare them with some given values to determine what letter it is. Is it right what im doing?

im getting confused help pls:)

Func Scan()
For $i = 2 to $totslots+1
$slot[$i]=$PixelSearch(777,350+18*($i-1),778,850,0x000000)
Next
For $i = 2 to $totslots+1
$itemstring[$i]=item($slot[$i],0x000000)
Next
EndFunc

Func item($sloti,$itemcolor)
For $b = 1 to 10
For $a = 1 to 5
$welkepixel[$b][$a]=PixelGetColor($sloti[0]+$b,$sloti[1]+$a)
If $welkepixel[$b][$a]=0x000000 Then
$letterstring=$letterstring & 1
Else
$letterstring=$letterstring & 0
EndIf
Next
Next
MsgBox(0,"letter",$letterstring)
EndFunc
Edited by cageman

Share this post


Link to post
Share on other sites



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
Sign in to follow this  
Followers 0