发帖
充值
 找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
首页源码分享毫秒级快速找字OCR识别文字API接口比肩百度AI ...

毫秒级快速找字OCR识别文字API接口比肩百度AI

26
回复
17846
查看
[ 复制链接 ]
已绑定手机
已实名认证

35

主题

37

回帖

436

积分

中级会员

积分
436
2021-11-23 00:02:41 显示全部楼层 阅读模式
本帖最后由 flk100207 于 2021-12-24 14:06 编辑

function  识别原文字本地(IP地址,左,上,右,下,查找文字,是否点击,精准找字,语言,模式)
        --local b64 = 类_服务.识别原文字本地("http://110.40.196.160:5689",265,350,451,400)
        --local b64 = 类_服务.识别原文字本地("http://110.40.196.160:5689",265,350,451,400,"设置",true)
        --语言----日=japan  中=ch 韩=korean  英=en
        --模式----模式一=h  模式二=m
        if 语言 == nil or 语言 == 0 then 语言="ch" end
        if 查找文字 == "" or 查找文字 == 0 then 查找文字 = nil end
    if 模式 == nil or 模式 == 0 then 模式="m" end
        snapShot("/storage/emulated/0/test.png",左,上,右,下)
        local b64 = getFileBase64("/storage/emulated/0/test.png")
        b64 = encodeUrl(b64)
        local formStr = "img=" .. b64 .. "&lan=" .. 语言 .. "&model="..模式.."&rotate=0"
        b64 = httpPost(IP地址.."/report?",formStr)
        --print(b64)
        b64 = string.gsub(b64, "\n","")
        b64 = string.gsub(b64, " ","")
        b64 = string.gsub(b64, '","',"|")
        b64 = string.gsub(b64, '"',"")
        b64 = splitStr(b64,":[")
        local 数组={}
        local pxt,pxx,pxy
        if #b64 >= 2 then
                b64 = splitStr(b64[2],"]")
                if #b64 >= 2 then
                        b64 = splitStr(b64[1],"},{")
                        for pxwzs=1,#b64 do
                                --print(b64[pxwzs])
                                pxt = string.match(b64[pxwzs], "content:".."(.-)".."|")
                                if 查找文字 ~= nil then
                                        if 精准找字 then
                                                if pxt ==  查找文字 then
                                                        if 是否点击 then
                                                                pxx= string.match(b64[pxwzs], "ind_x1:".."(.-)".."|")
                                                                pxy= string.match(b64[pxwzs], "ind_y1:".."(.-)".."|")
                                                                pxx = splitStr(pxx,",")
                                                                pxy = splitStr(pxy,",")
                                                                tap(math.floor((tonumber(pxy[1])-tonumber(pxx[1]))/2+tonumber(pxx[1])+左),math.floor((tonumber(pxy[2])-tonumber(pxx[2]))/2+tonumber(pxx[2])+上))
                                                        end
                                                        return true
                                                end
                                        else
                                                if  string.find(pxt,查找文字) ~= nil then
                                                        if 是否点击 then
                                                                pxx= string.match(b64[pxwzs], "ind_x1:".."(.-)".."|")
                                                                pxy= string.match(b64[pxwzs], "ind_y1:".."(.-)".."|")
                                                                pxx = splitStr(pxx,",")
                                                                pxy = splitStr(pxy,",")
                                                                tap(math.floor((tonumber(pxy[1])-tonumber(pxx[1]))/2+tonumber(pxx[1])+左),math.floor((tonumber(pxy[2])-tonumber(pxx[2]))/2+tonumber(pxx[2])+上))
                                                        end
                                                        return true
                                                end
                                        end
                                else
                                        pxx= string.match(b64[pxwzs], "ind_x1:".."(.-)".."|")
                                        pxy= string.match(b64[pxwzs], "ind_y1:".."(.-)".."|")
                                        pxx = splitStr(pxx,",")
                                        pxy = splitStr(pxy,",")
                                        数组[pxwzs]={
                                        text = pxt ,
                                        l = tonumber(pxx[1])+左 ,
                                        t = tonumber(pxx[2])+上 ,
                                        r = tonumber(pxy[1])+左 ,
                                        b = tonumber(pxy[2])+上 ,
                                        x = math.floor((tonumber(pxy[1])-tonumber(pxx[1]))/2+tonumber(pxx[1])+左) ,
                                        y = math.floor((tonumber(pxy[2])-tonumber(pxx[2]))/2+tonumber(pxx[2])+上)
                                        }
                                end
                        end
                        if 查找文字 ~= nil then
                                return false
                        else
                                return  数组
                        end
                end
        end
end

local tick = tickCount()
aa=识别原文字本地("http://110.40.196.160:5678",0,0,720,1280)
if #aa >= 1 then
        print(aa)
        for v=1,#aa do
                print(aa[v])
        end
end
print("遍历速度:"..tickCount()-tick)

local tick = tickCount()
if 识别原文字本地("http://110.40.196.160:5689",0,0,720,1280,"脚本列表",true,true) then
        print("找到文字")
else
        print("没找到文字")
end
print("找字速度:"..tickCount()-tick)
--IP端口均为临时体验,如需服务端自行进群下载

点击链接加入群聊【OCR】:https://jq.qq.com/?_wv=1027&k=JfIHeBpJ


          只要有图灵

         生活就有希望
使用道具
举报
已绑定手机

0

主题

33

回帖

115

积分

注册会员

积分
115
感觉好厉害,备份下,
回复
使用道具
举报

3

主题

60

回帖

423

积分

中级会员

积分
423
学习学习,好牛逼的样子
好★天
好★天
学★向
习★
回复
使用道具
举报

3

主题

60

回帖

423

积分

中级会员

积分
423
attempt to get length of a nil value (global 'aa')
好★天
好★天
学★向
习★
回复
使用道具
举报

13

主题

28

回帖

1552

积分

金牌会员

积分
1552
大佬 这个那里是不是有 点不对啊 post 提交之后 没返回啊 为print  不显示
回复
使用道具
举报

10

主题

18

回帖

158

积分

注册会员

积分
158
用不了0.0
免费写脚本,好项目免费写。要求你自己了解项目,拒绝上来就复制某某脚本。qq2605250162
回复
使用道具
举报
已绑定手机
已实名认证

35

主题

37

回帖

436

积分

中级会员

积分
436
2021-11-24 23:02:08 楼主 显示全部楼层

不可能不可能不可能不可能
          只要有图灵

         生活就有希望
回复
使用道具
举报

0

主题

8

回帖

212

积分

中级会员

积分
212
哈哈哈用不了--
回复
使用道具
举报

0

主题

24

回帖

47

积分

新手上路

积分
47
支持支持支持
回复
使用道具
举报

0

主题

24

回帖

50

积分

注册会员

积分
50
不会用,先来学习
回复
使用道具
举报
123下一页
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则