OCR文字识别白嫖

[复制链接]
查看5483 | 回复16 | 2021-11-30 18:07:33 | 显示全部楼层 |阅读模式
本帖最后由 flk100207 于 2021-11-30 18:19 编辑

local tick = tickCount()
snapShot("/storage/emulated/0/test.png",0,0,720,1280)
local b64 = getFileBase64("/storage/emulated/0/test.png")
b64 = 类_字符串.uft8字符转URL编码(b64)
b64=httpPost("https://aip.baidubce.com/rest/2.0/ocr/v1/accurate_basic?access_token=24.013a64e3e007fda91f102cf8f6c8a9c3.2592000.1640690211.282335-11278949&aipSdk=Android&aipSdkVersion=1_4_4&aipDevid=c0852d69-9910-4dd5-92ae-ec4fab9cb549","Content-Type=application/x-www-form-urlencoded&image="..b64)
--print(b64)
b64 = splitStr(b64,":[")
local 数组={}
if #b64 >= 2 then
        b64 = splitStr(b64[2],"]")
        if #b64 >= 2 then
                b64 = splitStr(b64[1],"},{")
                for pxwzs=1,#b64 do
                        pxt = string.match(b64[pxwzs], "words"..'":"'.."(.-)"..'"')
                        数组[pxwzs]=pxt
                end
        end
end
print(tickCount()-tick)
print(数组)
          只要有图灵

         生活就有希望
回复

使用道具 举报

ss0920 | 2021-11-30 20:18:16 | 显示全部楼层
学习下
回复

使用道具 举报

cyc262 | 2021-12-9 11:13:38 | 显示全部楼层
大佬大佬
好★天
好★天
学★向
习★
回复

使用道具 举报

lyxqge | 2022-4-9 10:13:57 | 显示全部楼层
大佬大佬!!!学习了。谢谢
回复

使用道具 举报

1534245922 | 2022-4-11 15:04:42 | 显示全部楼层
学习学习
回复

使用道具 举报

zhaosanpao | 2022-4-27 18:33:25 | 显示全部楼层
:lol
回复

使用道具 举报

jzl6668 | 2022-5-19 19:30:33 | 显示全部楼层


谢谢大佬分享 !
回复

使用道具 举报

vlmmwzmu | 2023-1-3 15:54:37 | 显示全部楼层
学习了!!!
回复

使用道具 举报

pkmqodlf | 2023-2-24 00:33:56 | 显示全部楼层

大佬大佬
回复

使用道具 举报

ca55512345 | 2023-4-2 15:09:45 | 显示全部楼层
全屏找不到呢
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

35

主题

72

帖子

436

积分

中级会员

Rank: 3Rank: 3

积分
436