百度自动按键精灵脚本代码大全精灵?

Import "ShanHai.lua"
Import "Cjson.lua"
//Dim pic = File.Read("/storage/emulated/0/Pictures/1.jpg")
//Dim pic = File.Read("/sdcard/Pictures/1.jpg")
//Dim picBase64 = ShanHai.Base64En(pic)
Dim picBase64 = ShanHai.ReadFileBase("/sdcard/Pictures/1.jpg")
dim picUrlEncode =
ShanHai.CharToUrl(picBase64)
Dim api_url = "https://aip.baidubce.com/rest/2.0/ocr/v1/general_basic?access_token=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
//用山海post,得不到结果,不知道为什么,可能是默认的包头不一样
//dim RetJson2 = ShanHai.PostHttp(api_url, "image="&picUrlEncode)
dim RetJson = Url.Post(api_url, "image="&picUrlEncode)
Dim retTable = Cjson.Decode(RetJson)
TracePrint RetJson
TracePrint "识别文字行数:" & retTable["words_result_num"]
Dim words_results= retTable["words_result"]
For i=0 to UBound(words_results)
Dim oneUnit = words_results(i)
Dim words = oneUnit["words"]
TracePrint words
Next
不同地址-不同识别能力,一览表(后台地址:https://console.bce.baidu.com/ai/?fromai=1#/ai/ocr/app/detail~appId=665090)
分类专栏
您愿意向朋友推荐“博客详情页”吗?
强烈不推荐
不推荐
一般般
推荐
强烈推荐

我要回帖

更多关于 按键精灵脚本代码大全 的文章

 

随机推荐