点阵字库
from ascript.android.screen import OcrX
对特殊图像,做点阵字库. 从而进行识别,该方法不支持全分辨率
查找文字
给定字库,从字库中识别文字
- 函数
OcrX.find_all(font_lib: str, rect: list = None, region=0.9):
- 参数
参数 | 类型 | 是否必填 | 说明 |
---|---|---|---|
font_lib | str | 是 | 字库文件 |
rect | list | 否 | 识别范围 |
region | float | 否 | 识别精度 0-1之间, 默认0.9=90%精度 |
- 返回值
返回值为 识别到的文字, 类型为str
from ascript.android.system import R
from ascript.android.screen import OcrX
res = OcrX.find_all(R.res("font.t"),rect=[90,529,343,612])
print(res[0])
如何制作字库?
制作字库用到了图色工具中的点阵识字