按键精灵多点找色数字识别问题 20
DimArr_number(9)Arr_number(0)=array("FFFFF8","1|0|FFFEF7")Arr_number(1)=array("FFFFF6...
Dim Arr_number(9)
Arr_number(0) = array("FFFFF8","1|0|FFFEF7")
Arr_number(1) = array("FFFFF6","0|1|FFFFF7")
Arr_number(2) = array("FFFFF5","1|-1|FFFFF4")
Arr_number(3) = array("FFFFF7","0|-1|FFFFF4")
Arr_number(4) = array("FAF6F1","0|-1|FFFEFE,1|-2|FFFFFB")
Arr_number(5) = array("FFFFF6","0|1|FFFFF5,0|2|FFFFF7,0|3|FFFFF7")
Arr_number(6) = array("FFFFF6","0|1|FFFFF5,0|2|FFFFF7,0|3|FFFFF7")
Arr_number(7) = array("FFFFF1","0|-1|FFFFF0,0|-2|FFF6E4,1|-2|FFFFF0")
Arr_number(8) = array("FFFFF7","1|0|FFFFF9,2|1|FFFCFB,3|1|FFFFF9")
Arr_number(9) = array("FFFFF8","1|0|FFFFFB,2|1|FFFFFB,3|1|FFFFF7")
'开始判断
TracePrint GetNumber(0, 0, Plugin.Sys.GetScRX, Plugin.Sys.GetScRY, Arr_number, 0)
EndScript
'a,b,c,d 传入范围四个坐标参数
'arr 传入数字多点字符串特征的数组参数
'n 是表示每个字符的间距超过多少像素则中间以竖线隔开。例子123|456,0表示无需判断。
Function GetNumber( a, b, c, d, arr, n)
GetNumber = - 1
Dim i, temp_number_a, temp_number_c, xy, temp_number, temp_Fm, temp_txt, s, temp_arr, temp_n, temp_x
temp_number_a = a : temp_txt = - 1 : s = - 1
Do
temp_number = - 1 : temp_number_c = c
For i = 0 To UBound(arr)
temp_Fm = Plugin.Color.FindMutiColorEx(temp_number_a, b, c, d, arr(i)(0), arr(i)(1), 0.9, 0)
If temp_Fm <> "-1|-1" Then
xy = Split(temp_Fm, "|")
If temp_number = - 1 or Clng(xy(0)) < temp_number_c Then
temp_number = i : temp_number_c = Clng(xy(0))
End If
End If
Next
If temp_number = - 1 Then
If n > 0 and s > - 1 Then
GetNumber = Mid(GetNumber, 1, s) & "|" & Mid(GetNumber, s + 1, Len(GetNumber) - s)
End If
Exit Function
End If
temp_arr = Split(arr(temp_number)(1), ",")
temp_x = 0
For i = 0 To UBound(temp_arr)
temp_n = Int(Split(temp_arr(i), "|")(0))
If temp_n > temp_x Then
temp_x = temp_n
End If
Next
temp_number_a = temp_number_c + temp_x
If n > 0 Then
If temp_txt = - 1 Then
temp_txt = temp_number_a
Else
If temp_number_a - temp_txt > n Then s = Len(GetNumber)
temp_txt = temp_number_a
End If
End If
If GetNumber = - 1 Then
GetNumber = temp_number
Else
GetNumber = GetNumber * 10 + temp_number
End If
Loop
End Function
这个特征吗子太多我都删了, 传入范围怎么输入?? 展开
Arr_number(0) = array("FFFFF8","1|0|FFFEF7")
Arr_number(1) = array("FFFFF6","0|1|FFFFF7")
Arr_number(2) = array("FFFFF5","1|-1|FFFFF4")
Arr_number(3) = array("FFFFF7","0|-1|FFFFF4")
Arr_number(4) = array("FAF6F1","0|-1|FFFEFE,1|-2|FFFFFB")
Arr_number(5) = array("FFFFF6","0|1|FFFFF5,0|2|FFFFF7,0|3|FFFFF7")
Arr_number(6) = array("FFFFF6","0|1|FFFFF5,0|2|FFFFF7,0|3|FFFFF7")
Arr_number(7) = array("FFFFF1","0|-1|FFFFF0,0|-2|FFF6E4,1|-2|FFFFF0")
Arr_number(8) = array("FFFFF7","1|0|FFFFF9,2|1|FFFCFB,3|1|FFFFF9")
Arr_number(9) = array("FFFFF8","1|0|FFFFFB,2|1|FFFFFB,3|1|FFFFF7")
'开始判断
TracePrint GetNumber(0, 0, Plugin.Sys.GetScRX, Plugin.Sys.GetScRY, Arr_number, 0)
EndScript
'a,b,c,d 传入范围四个坐标参数
'arr 传入数字多点字符串特征的数组参数
'n 是表示每个字符的间距超过多少像素则中间以竖线隔开。例子123|456,0表示无需判断。
Function GetNumber( a, b, c, d, arr, n)
GetNumber = - 1
Dim i, temp_number_a, temp_number_c, xy, temp_number, temp_Fm, temp_txt, s, temp_arr, temp_n, temp_x
temp_number_a = a : temp_txt = - 1 : s = - 1
Do
temp_number = - 1 : temp_number_c = c
For i = 0 To UBound(arr)
temp_Fm = Plugin.Color.FindMutiColorEx(temp_number_a, b, c, d, arr(i)(0), arr(i)(1), 0.9, 0)
If temp_Fm <> "-1|-1" Then
xy = Split(temp_Fm, "|")
If temp_number = - 1 or Clng(xy(0)) < temp_number_c Then
temp_number = i : temp_number_c = Clng(xy(0))
End If
End If
Next
If temp_number = - 1 Then
If n > 0 and s > - 1 Then
GetNumber = Mid(GetNumber, 1, s) & "|" & Mid(GetNumber, s + 1, Len(GetNumber) - s)
End If
Exit Function
End If
temp_arr = Split(arr(temp_number)(1), ",")
temp_x = 0
For i = 0 To UBound(temp_arr)
temp_n = Int(Split(temp_arr(i), "|")(0))
If temp_n > temp_x Then
temp_x = temp_n
End If
Next
temp_number_a = temp_number_c + temp_x
If n > 0 Then
If temp_txt = - 1 Then
temp_txt = temp_number_a
Else
If temp_number_a - temp_txt > n Then s = Len(GetNumber)
temp_txt = temp_number_a
End If
End If
If GetNumber = - 1 Then
GetNumber = temp_number
Else
GetNumber = GetNumber * 10 + temp_number
End If
Loop
End Function
这个特征吗子太多我都删了, 传入范围怎么输入?? 展开
展开全部
你这是要识别数字吗?
那就用大漠ocr
就算用按键精灵识别数字也不用这么写吧
光找色 正常数字5*8范围一个
dim a(9)
a(0)="100011000110001=0"
a(1)="001000010000100=1"
a(2)="100010001000100=2"
a(3)="000010011000001=3"
a(4)="010100101010010=4"
a(5)="100001111000001=5"
a(6)="100001111010001=6"
a(7)="000100010000100=7"
a(8)="100010111010001=8"
a(9)="100011000101111=9"
那就用大漠ocr
就算用按键精灵识别数字也不用这么写吧
光找色 正常数字5*8范围一个
dim a(9)
a(0)="100011000110001=0"
a(1)="001000010000100=1"
a(2)="100010001000100=2"
a(3)="000010011000001=3"
a(4)="010100101010010=4"
a(5)="100001111000001=5"
a(6)="100001111010001=6"
a(7)="000100010000100=7"
a(8)="100010111010001=8"
a(9)="100011000101111=9"
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询