方法介绍

命令功能: 将Json字符串转换成数组

语法格式: 类_Json.解Json格式(str)

参数:

str:json字符串

返回值: 返回数组

local paddle = require("libpaddleocr")


require("懒人综合插件")



print("脚本开始",paddle.ocr)
local path = getWorkPath()
extractAssets("paddle.rc",path,"*")
print(path)
for i=1,100 do
    local image = "/mnt/sdcard/test.png"
    snapShot(image,275,74,451,129)
    local begintm = tickCount()
    local ret = paddle.ocr(path,image)
    local endtm  =tickCount()
    print("结果:",ret,"耗时:",(endtm - begintm).."毫秒")

    local list=类_Json.解Json格式(ret) 
    if #list.words_result==0    then
        return nil
    end

    --print(#list.words_result)    
    print(list.words_result_num)
    print(list.words_result[1].words)
    print(list.words_result[1].pos)
    print(list.words_result[1].score)

end

Copyright © 湖南合鑫网络科技有限公司 2020 all right reserved,powered by Gitbook该文件修订时间: 2020-12-01 20:12:34

results matching ""

    No results matching ""