函数:ocrImage 图片打码识别

函数名称:图片打码识别

函数功能:图片文件打码识别

函数方法

text,tid = ocrImage(path,kind,timeout,scale);

参数 类型 必填 说明
path string 需要打码图片的路径,默认触动 res 目录,支持绝对路径
kind number 打码类型,对应打码官网查询,QQ 超人填写任意数字
timeout number 超时时间,默认超时 60 秒
scale number 缩放比例范围 0 - 1,不写默认为 1,
值越小图片质量(文件大小)越低,不影响图片大小
返回值 类型 说明
text string.boolean 正确返回打码结果,错误返回 nil
tid string 正常返回 id,错误返回错误信息

函数用例

require "TSLib"--使用本函数库必须在脚本开头引用并将文件放到设备 lua 目录下
ocrInfo("haoi23","username","password")--先初始化
text,tid = ocrImage("img.png",103,30,1)

注意事项

  • 支持平台

  • 出现多次打码或者平台有结果脚本返回空的情况,请延长超时时间参数

  • path 图片路径可以使用 userPath 进行获取。

Copyright 北京帮你玩科技有限公司 2023 all right reserved,powered by Gitbook该文章修订时间: 2024-03-06 17:50:18

results matching ""

    No results matching ""