文本识别怎么设置 ,能够实现 途径城市 填充到字段中?
云煮鸡 2022-01-12 21:22:46涛哥,我不会代码,能写个明道云能用的案例吗?
var image=''
var list=JSON.parse(input.imglist?input.imglist:'[]')
if(list.length>0){image=list[0]}
var fetch=require('node-fetch');
var query= require('querystring');
var data= await fetch(image).then(r => r.buffer()).then(buf => buf.toString('base64'));
var fetch = require('node-fetch');
var url='https://aip.baidubce.com/rest/2.0/ocr/v1/travel_card?access_token='+input.token;
var data="image="+query.escape(data);
const res = await fetch(url,{
method:"POST",
headers:
{
"Content-Type": "application/x-www-form-urlencoded"
},
body:data
}).then(function(response){
if(response.ok){
return response.json();
}else{
return {"code":-1,"result_msg":response}
}
}).catch(function(err){
return {"code":102,"error":"Fetch 错误:"+err};
});
var result = await res;
output = {result:result,str:JSON.stringify(result)};
识别率不行。。识别出了图片中未出现的内容。
李恩涛(Team) 2022-01-12 20:58:25
涛哥,我不会代码,能写个明道云能用的案例吗?