function OCR文字识别(IP地址,左,上,右,下)
snapShot("/storage/emulated/0/test.png",左,上,右,下)
local b64 = getFileBase64("/storage/emulated/0/test.png")
b64 = encodeUrl(b64)
local formStr = "img=" .. b64 .. "&lan=ch&model=1"
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,":[")
if #b64 >= 2 then
b64 = splitStr(b64[2],"]")
if #b64 >= 2 then
return b64[1]
else
return false
end
else
return false
end
end
aa= OCR文字识别("http://110.40.196.160:5689",265,69,468,137)
print(aa)
|