跳到主要内容

百度OCR

baiduFreeOnline 百度免费在线识别接口

提示
  • 老接口,可能会有次数限制,或已失效,未测试
参数名必选类型说明
x1numberx1
y1numbery1
x2numberx2
y2numbery2
返回示例
let ret = laoleng.ocr.baiduFreeOnline(0, 0, 500, 500)
logd(JSON.stringify(ret))
if (ret.errno === 0) {
logd("识别成功")
for (let i = 0; i < ret.data.words_result.length; i++) {
logd(JSON.stringify(ret.data.words_result[i]))
logd(ret.data.words_result[i].words)
logd(ret.data.words_result[i].location.top)
logd(ret.data.words_result[i].location.left)
logd(ret.data.words_result[i].location.width)
logd(ret.data.words_result[i].location.height)
}
}
/*
[2021-12-28 21:58:50.157]【远程设备】(js/main.js#26 ){"errno":0,"msg":"success","data":{"words_result":[{"words":"只","location":{"top":227,"left":429,"width":62,"height":65}},{"words":"易点云测","location":{"top":307,"left":75,"width":84,"height":22}},{"words":"QQ","location":{"top":308,"left":274,"width":28,"height":22}},{"words":"按键精灵高","location":{"top":308,"left":387,"width":110,"height":20}},{"words":"7","location":{"top":407,"left":479,"width":9,"height":14}}],"words_result_num":5,"log_id":"1475828588782819423"}}
[2021-12-28 21:58:50.157]【远程设备】(js/main.js#28 )识别成功
[2021-12-28 21:58:50.157]【远程设备】(js/main.js#30 ){"words":"只","location":{"top":227,"left":429,"width":62,"height":65}}
[2021-12-28 21:58:50.158]【远程设备】(js/main.js#31 )只
[2021-12-28 21:58:50.158]【远程设备】(js/main.js#32 )227
[2021-12-28 21:58:50.159]【远程设备】(js/main.js#33 )429
[2021-12-28 21:58:50.159]【远程设备】(js/main.js#34 )62
[2021-12-28 21:58:50.159]【远程设备】(js/main.js#35 )65
[2021-12-28 21:58:50.160]【远程设备】(js/main.js#30 ){"words":"易点云测","location":{"top":307,"left":75,"width":84,"height":22}}
[2021-12-28 21:58:50.161]【远程设备】(js/main.js#31 )易点云测
[2021-12-28 21:58:50.161]【远程设备】(js/main.js#32 )307
[2021-12-28 21:58:50.163]【远程设备】(js/main.js#33 )75
[2021-12-28 21:58:50.208]【远程设备】(js/main.js#34 )84
[2021-12-28 21:58:50.208]【远程设备】(js/main.js#35 )22
[2021-12-28 21:58:50.208]【远程设备】(js/main.js#30 ){"words":"QQ","location":{"top":308,"left":274,"width":28,"height":22}}
[2021-12-28 21:58:50.208]【远程设备】(js/main.js#31 )QQ
[2021-12-28 21:58:50.208]【远程设备】(js/main.js#32 )308
[2021-12-28 21:58:50.209]【远程设备】(js/main.js#33 )274
[2021-12-28 21:58:50.209]【远程设备】(js/main.js#34 )28
[2021-12-28 21:58:50.209]【远程设备】(js/main.js#35 )22
[2021-12-28 21:58:50.209]【远程设备】(js/main.js#30 ){"words":"按键精灵高","location":{"top":308,"left":387,"width":110,"height":20}}
[2021-12-28 21:58:50.212]【远程设备】(js/main.js#31 )按键精灵高
[2021-12-28 21:58:50.212]【远程设备】(js/main.js#32 )308
[2021-12-28 21:58:50.212]【远程设备】(js/main.js#33 )387
[2021-12-28 21:58:50.212]【远程设备】(js/main.js#34 )110
[2021-12-28 21:58:50.212]【远程设备】(js/main.js#35 )20
[2021-12-28 21:58:50.212]【远程设备】(js/main.js#30 ){"words":"7","location":{"top":407,"left":479,"width":9,"height":14}}
[2021-12-28 21:58:50.212]【远程设备】(js/main.js#31 )7
[2021-12-28 21:58:50.212]【远程设备】(js/main.js#32 )407
[2021-12-28 21:58:50.212]【远程设备】(js/main.js#33 )479
[2021-12-28 21:58:50.212]【远程设备】(js/main.js#34 )9
[2021-12-28 21:58:50.212]【远程设备】(js/main.js#35 )14
[2021-12-28 21:58:50.212]【远程设备】运行结束
*/
返回参数说明
返回值类型说明
objectobject识别结果